Paul Eggert wrote:
On 8/16/25 19:01, Collin Funk wrote:
Is there any reason that gzip doesn't use quote and error from Gnulib?
e.g. to avoid dependencies on locale stuff?

Partly that, and partly because it's a symptom of a larger issue: gzip
was written in a hurry and is poorly structured and people
understandably don't want to mess with it.

Maybe an alternative to searching for all the places where gzip would need to be patched could be to reject outright any file name containing any control char in the range ( ch <= 31 && ch >= 1 ) || ch == 127

If a file with such a name needs to be decompressed, it can be redirected to standard input.

POSIX is encouraging implementations to disallow the creation of file names containing any bytes that have the encoded value of a <newline> character. See https://pubs.opengroup.org/onlinepubs/9799919799/utilities/compress.html section CHANGE HISTORY subsection Issue 8.

Since January 2024, GNU ed is rejecting by default file names containing control chars and nobody has complained yet.

Best regards,
Antonio.



Reply via email to