1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 03:12:48 +02:00

all: avoid quoting file names when possible

Quote file names using the "shell-escape" or "shell-escape-always"
methods, which quote as appropriate for most shells,
and better support copy and paste of presented names.
The "always" variant is used when the file name is
embedded in an error message with surrounding spaces.

* cfg.mk (sc_error_shell_quotes): A new syntax check rule
to suggest quotef() where appropriate.
(sc_error_shell_always_quotes): Likewise for quoteaf().
* src/system.h (quotef): A new define to apply shell quoting
when needed.  I.E. when shell character or ':' is present.
(quoteaf): Likewise, but always quote.
* src/*.c: Use quotef() and quoteaf() rather than quote()
where appropriate.
* tests/: Adjust accordingly.
This commit is contained in:
Pádraig Brady
2015-11-01 18:53:26 +00:00
parent 1e8f9afac5
commit 08e8fd7e38
98 changed files with 702 additions and 662 deletions

View File

@@ -34,7 +34,7 @@ if test "$(df --output=fstype . | tail -n1)" != '-'; then
fi
cat <<\EOF > exp || framework_failure_
df: '_does_not_exist_': No such file or directory
df: _does_not_exist_: No such file or directory
EOF
# Ensure that df writes the error message also in the following case.