[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace i
From: |
Collin Funk |
Subject: |
Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames |
Date: |
Sun, 05 Jan 2025 10:57:43 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi everyone,
Andreas Grünbacher <andreas.gruenbacher@gmail.com> writes:
> [] FUTURE DIRECTIONS
> []
> [] If this utility is directed to display a pathname that contains any
> bytes that have the encoded value of a <newline> character
> [] when <newline> is a terminator or separator in the output format
> being used, implementations are encouraged to treat this as an error.
> [] A future version of this standard may require implementations to
> treat this as an error.
>
> I'm not sure about the intention behind those two conflicting
> statements. Any thoughts?
As far as I remember, POSIX 2024 added commentary similar to the one
above to all programs that interact with files. I believe the reasoning
was to prevent behavior like this which may be unexpected:
$ for file in `find . -type f`; do echo "$file"; done
./abc
def
./file1
./file2
$ ls
'abc'$'\n''def' file1 file2
This recommendation also applies to something like touch. So the
recommendation would be for this to fail:
$ touch 'abc
def'
Coreutils doesn't follow that recommendation so I was able to create the
file.
I don't disagree with the recommendation, but it will be a bit awkward
if some programs work with newlines and some do not. And just before the
release is probably too late to change it.
Collin
- Fwd: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames, Jim Meyering, 2025/01/05
- Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames, Andreas Grünbacher, 2025/01/05
- Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames,
Collin Funk <=
- Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames, Jim Meyering, 2025/01/05
- Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames, Paul Eggert, 2025/01/08
- Re: [bug-diffutils] bug#68695: Please, fix documentation on whitespace in pathnames, Jim Meyering, 2025/01/11