GNU bug report logs - #33113
ls: incorrect quoting of "="

Previous Next

Package: coreutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Sun, 21 Oct 2018 23:45:02 UTC

Severity: normal

Tags: confirmed

Full log


Message #23 received at 33113 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Vincent Lefevre <vincent <at> vinc17.net>
Cc: 33113 <at> debbugs.gnu.org, Pádraig Brady <P <at> draigBrady.com>
Subject: Re: bug#33113: incorrect and inconsistent quoting in ls output
Date: Sun, 28 Oct 2018 13:11:33 -0700
Vincent Lefevre wrote:
>> Now we could quote with -F only if these chars are at the end,
>> though I'm not sure that complexity is warranted.
> In any case, this form of quoting incorrect with -b, as \= is invalid
> in ISO C.

That's right, we need another way to escape classifier characters with -bF, 
since the current method is clearly wrong.

Let's use ""= instead, as it's valid ISO C. In other words, where we currently 
do this:

$ python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('b')"
$ touch b= b=x
$ ls -bF
b=  b\=  b\=x

the last command should output this instead:

b=  b""=  b=x

This works because in ISO C "b""=" is equivalent to "b=". We should do this only 
with characters at the end, because it's not needed elsewhere and the "" is 
annoying.




This bug report was last modified 6 years and 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.