From e34657cfde6816ab7a7415d83580df0a1d98a5a6 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 8 May 2020 15:26:11 -0700 Subject: [PATCH] fix issue #60 that was skipping the first file in some instances using -R without -l --- jc/parsers/ls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index bf2f046d..149617d4 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -235,8 +235,9 @@ def parse(data, raw=False, quiet=False): if not re.match(r'[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', linedata[0]) \ and linedata[0].endswith(':'): parent = linedata.pop(0)[:-1] - # Pop following total line - linedata.pop(0) + # Pop following total line if it exists + if re.match(r'total [0-9]+', linedata[0]): + linedata.pop(0) if linedata: # Check if -l was used to parse extra data