ccheck
ccheck copied to clipboard
handle unusual filenames
Linux allows any byte in filenames besides null and /
If this should be reliable, it needs to handle them.
Especially line breaks are very confusing.
$ echo x > $'ccheck/a\nb'
$ ccheck --nosign ccheck/ ccheck.cc2
Computing checksums for all files...
New file: ccheck/a
b
$ ccheck --nosign ccheck/ ccheck.cc2
Computing checksums for all files...
WARNING: missing file: b 73cb3858a687a8494ca3323053016282f3dad39d42cf62ca4e79dda2aac7d9ac
Use of uninitialized value $db_checksums{""} in concatenation (.) or string at ./ccheck/ccheck.pl line 132.
WARNING: missing file:
New file: ccheck/a
b
...
Here are some more files that break all things everywhere, including invalid utf-8 names: https://github.com/benibela/nasty-files
Can't use an undefined value as a symbol reference at /tmp/ccheck/ccheck.pl line 170.