Skip to content

handle unusual filenames #1

Description

@benibela

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions