[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ls: why does -b insert backslashes before filenames' spaces?
From: |
Paul Stoeber |
Subject: |
ls: why does -b insert backslashes before filenames' spaces? |
Date: |
Tue, 18 Jun 2002 02:55:09 +0200 |
User-agent: |
Mutt/1.3.28i |
address@hidden:~$ touch 'a b c'
address@hidden:~$ ls -lb 'a b c'
-rw-r--r-- 1 q q 0 Jun 18 00:28 a\ b\ c
^ ^
| |
? ?
address@hidden:~$
This seems to be inconsistent with how -bR displays directory names:
address@hidden:~$ rm 'a b c'
address@hidden:~$ mkdir 'a b c'
address@hidden:~$ ls -lbR './a b c'
./a b c:
total 0
address@hidden:~$
It's also incompatible with Dired of Emacs 21.2.1.
This can be fixed in Emacs, but the backslashes look distracting
in a Dired buffer, so I'm biased to see the bug in `ls' first.
What would break if these backslashes were not printed?
They seem to be caused by the following fragment in fileutils-4.1/src/ls.c:
if (get_quoting_style (filename_quoting_options) == escape_quoting_style)
set_char_quoting (filename_quoting_options, ' ', 1);
I guess this was added as an afterthought, perhaps as a response to an
earlier bug report?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ls: why does -b insert backslashes before filenames' spaces?,
Paul Stoeber <=