1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

fixes for multiple consecutive newlines and trailing newlines in filenames

This commit is contained in:
Kelly Brazil
2020-02-24 16:38:29 -08:00
parent 964868c8af
commit 116e07f161

View File

@ -246,18 +246,17 @@ def parse(data, raw=False, quiet=False):
parsed_line = entry.split(maxsplit=8)
if new_section \
and not re.match('^[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', entry) \
if not re.match('^[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', entry) \
and entry.endswith(':'):
parent = entry[:-1]
new_section = False
new_section = True
# fixup to remove trailing \n in previous entry
raw_output[-1]['filename'] = raw_output[-1]['filename'][:-1]
continue
if re.match('^total [0-9]+', entry):
continue
if entry == '':
new_section = True
new_section = False
continue
# fixup for filenames with newlines