|
| From: | Paul Eggert |
| Subject: | bug#33113: incorrect and inconsistent quoting in ls output |
| Date: | Sun, 28 Oct 2018 13:11:33 -0700 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
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.
| [Prev in Thread] | Current Thread | [Next in Thread] |