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