* src/ls.c (decode_switches): Flag ',' for quoting when needed.
* tests/ls/m-option.sh: Add a test case.
* NEWS: Mention the improvement.
'install -C' will now avoid updating file metadata when the destination
already has the appropriate ownership and permissions.
+ 'ls -m' now quotes files names containing commas when appropriate,
+ so users can better distinguish separating commas.
+
'sort' will now better use available memory and parallel operation
when reading from unknown sized inputs like pipes.
for (char const *p = &"*=>@|"[indicator_style - file_type]; *p; p++)
set_char_quoting (filename_quoting_options, *p, 1);
}
+ if (format == with_commas
+ && (qs == shell_quoting_style
+ || qs == shell_escape_quoting_style
+ || qs == c_maybe_quoting_style
+ || qs == escape_quoting_style))
+ set_char_quoting (filename_quoting_options, ',', 1);
dirname_quoting_options = clone_quoting_options (NULL);
set_char_quoting (dirname_quoting_options, ':', 1);
ls -w5 -m a bb > out || fail=1
compare exp out || fail=1
+# Ensure commas in names are quoted appropriately for all quoting styles.
+# Without this quoting, interactive output could become confusing,
+# especially in the presence of NBSP etc.
+touch 'com,ma' || framework_failure_
+cat <<\EOF > exp || framework_failure_
+literal: com,ma
+shell: 'com,ma'
+shell-always: 'com,ma'
+shell-escape: 'com,ma'
+shell-escape-always: 'com,ma'
+c: "com,ma"
+c-maybe: "com,ma"
+escape: com\,ma
+locale: 'com,ma'
+clocale: "com,ma"
+EOF
+for qs in $(cut -d: -f1 exp); do
+ printf '%s: ' "$qs"
+ ls -m --quoting-style="$qs" 'com,ma' || fail=1
+done > out
+compare exp out || fail=1
+
Exit $fail