diff options
author | Pádraig Brady <P@draigBrady.com> | 2015-11-01 18:53:26 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2015-11-04 23:30:14 +0000 |
commit | 08e8fd7e38f2dae7c69c54eb22d508b6517e66e5 (patch) | |
tree | 63d021e305cd93bea445f9484fe8b3446dda2c3d /tests/misc/ls-misc.pl | |
parent | 1e8f9afac53a628dbc64e62bea53eb2da29c47fa (diff) | |
download | coreutils-08e8fd7e38f2dae7c69c54eb22d508b6517e66e5.tar.xz |
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.
Diffstat (limited to 'tests/misc/ls-misc.pl')
-rwxr-xr-x | tests/misc/ls-misc.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/misc/ls-misc.pl b/tests/misc/ls-misc.pl index f88c7a8ea..007e25787 100755 --- a/tests/misc/ls-misc.pl +++ b/tests/misc/ls-misc.pl @@ -235,7 +235,7 @@ my @Tests = {POST => sub {unlink 'd/s' or die "d/s: $!\n"; rmdir 'd' or die "d: $!\n"; restore_ls_colors; }}, - {ERR => "ls: cannot access d/s: No such file or directory\n"}, + {ERR => "ls: cannot access 'd/s': No such file or directory\n"}, {EXIT => 1} ], # Related to the above fix, is this case where @@ -289,7 +289,7 @@ my @Tests = # From Stéphane Chazelas. ['no-a-isdir-b', 'no-dir d', {OUT => "d:\n"}, - {ERR => "ls: cannot access no-dir: No such file or directory\n"}, + {ERR => "ls: cannot access 'no-dir': No such file or directory\n"}, $mkdir, $rmdir, {EXIT => 2}], ['recursive-2', '-R d', {OUT => "d:\ne\n\nd/e:\n"}, $mkdir2, $rmdir2], @@ -327,8 +327,8 @@ my @Tests = # at least one of which is a nonempty directory. ['multi-arg-U1', '-U1 d no-such', {OUT => "d:\nf\n"}, - {ERR_SUBST=>'s/ch:.*/ch:/'}, - {ERR => "$prog: cannot access no-such:\n"}, + {ERR_SUBST=>"s/ch':.*/ch':/"}, + {ERR => "$prog: cannot access 'no-such':\n"}, $mkdir_reg, $rmdir_reg, {EXIT => 2}, |