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:
@ -246,18 +246,17 @@ def parse(data, raw=False, quiet=False):
|
|||||||
|
|
||||||
parsed_line = entry.split(maxsplit=8)
|
parsed_line = entry.split(maxsplit=8)
|
||||||
|
|
||||||
if new_section \
|
if not re.match('^[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', entry) \
|
||||||
and not re.match('^[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', entry) \
|
|
||||||
and entry.endswith(':'):
|
and entry.endswith(':'):
|
||||||
parent = entry[:-1]
|
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
|
continue
|
||||||
|
|
||||||
if re.match('^total [0-9]+', entry):
|
if re.match('^total [0-9]+', entry):
|
||||||
continue
|
new_section = False
|
||||||
|
|
||||||
if entry == '':
|
|
||||||
new_section = True
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# fixup for filenames with newlines
|
# fixup for filenames with newlines
|
||||||
|
Reference in New Issue
Block a user