diff options
author | Pádraig Brady <P@draigBrady.com> | 2013-11-01 16:14:44 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2013-11-01 22:34:24 +0000 |
commit | 4d94e65d06772c41b8ac11e8b55f749c57c18f5b (patch) | |
tree | 833345afed768a30fa9486a683253201c80167f5 /tests/misc/md5sum.pl | |
parent | 979f59f77c69535ff1fb916f73a88658db04df0b (diff) | |
download | coreutils-4d94e65d06772c41b8ac11e8b55f749c57c18f5b.tar.xz |
maint: simplify printing of md5sum file names
* src/md5sum.c (main): Add a comment as to why we continue
to escape names that do not have '\n' but do have '\\' chars.
(print_filename): Use the predetermined boolean to decide
whether to escape or not, so that in the common case we
can output the file name directly, rather than inspecting each char.
* tests/misc/md5sum.pl: Add case to show '\\' chars cause escaping.
* tests/misc/sha1sum.pl: Likewise.
Diffstat (limited to 'tests/misc/md5sum.pl')
-rwxr-xr-x | tests/misc/md5sum.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/misc/md5sum.pl b/tests/misc/md5sum.pl index 5192d55f4..a89fa62cc 100755 --- a/tests/misc/md5sum.pl +++ b/tests/misc/md5sum.pl @@ -38,7 +38,9 @@ my @Tests = {OUT=>"d174ab98d277d9f5a5611c2c9f419d9f f\n"}], ['7', {IN=> {f=> '1234567890' x 8}}, {OUT=>"57edf4a22be3c955ac49da2e2107b67a f\n"}], - ['backslash', {IN=> {".\\foo"=> ''}}, + ['backslash-1', {IN=> {".\nfoo"=> ''}}, + {OUT=>"\\$degenerate .\\nfoo\n"}], + ['backslash-2', {IN=> {".\\foo"=> ''}}, {OUT=>"\\$degenerate .\\\\foo\n"}], ['check-1', '--check', {AUX=> {f=> ''}}, {IN=> {'f.md5' => "$degenerate f\n"}}, |