On 28/06/2024 20:48, наб wrote:
On Wed, Jun 26, 2024 at 11:22:07PM +0100, Pádraig Brady wrote:
Fixed upstream with:
https://github.com/coreutils/coreutils/commit/72588b291
This is wrong. Try:
$ > 'a\a'
$ ls --quoting-style=c-maybe
a\a
$ ls --quoting-style=c
"a\\a"
obviously a \ needs escaping, as proven by -qc=c escaping it,
so this needs to be listed as an exception.
This is fine I think.
Without quotes the backslash is taken literally,
so there is no ambiguity. I.e. there is "no escaping required".
Taking another example where escaping is _required_:
$ touch $'a\u' $'a\a'
$ ls --quoting-style=c-maybe a*
"a\a" a\u
The above shows another divergence from strict C escaping,
where \u means universal char escape in C, but is two chars here,
but doesn't _require_ escaping to display,
and so is to be interpreted literally.
cheers,
Pádraig