1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-04 15:49:42 +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
+1 -1
View File
@@ -24,7 +24,7 @@ echo "split: invalid number of chunks: '1o'" > exp
split -n l/1o 2>err && fail=1
compare exp err || fail=1
echo "split: '-': cannot determine file size" > exp
echo "split: -: cannot determine file size" > exp
echo | split -n l/1 2>err && fail=1
compare exp err || fail=1