1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2026-04-01 17:41:06 +02:00

Support other mode symbols -- e.g. 'U' and '^' from Perl shasum

Accept any symbol for future-proofing
This commit is contained in:
Ivan Pozdeev
2025-12-15 23:31:16 +03:00
parent 1944a7145e
commit 4fe3377029

View File

@@ -140,7 +140,7 @@ def parse(data, raw=False, quiet=False):
file_mode = ""
# standard md5sum and shasum command output
else:
m = re.match('([0-9a-f]+) ([ ?*])(.*)$', line)
m = re.match('([0-9a-f]+) (.)(.*)$', line)
if not m:
raise ValueError(f'Invalid line format: "{line}"')
file_hash, file_mode, file_name = m.groups()