diff options
author | Pádraig Brady <P@draigBrady.com> | 2022-08-27 18:40:14 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2022-08-27 18:41:10 +0100 |
commit | 708ae170c987dab83273cb885496e1a8a90233e8 (patch) | |
tree | 5489c64b61569630c9e7380ba6adfe13a67d99f1 /tests | |
parent | c88f08f9b6d7b509ece19b746d57b73133ab6618 (diff) | |
download | coreutils-708ae170c987dab83273cb885496e1a8a90233e8.tar.gz |
comm: fix NUL --output-delimiter with --total
* src/comm.c (compare_files): Handle the single character
--output-delimeter case separately so that NUL is appropriately
handled.
* doc/coreutils.texi (comm invocation): Fix the description
of --output-delimiter to say an empty delimeter is treated
as a NUL separator, rather than being disallowed.
* tests/misc/comm.pl: Add a test case.
Reported at https://bugs.debian.org/1014008
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/comm.pl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/misc/comm.pl b/tests/misc/comm.pl index 73e8c3720..5d0c4f175 100755 --- a/tests/misc/comm.pl +++ b/tests/misc/comm.pl @@ -157,6 +157,9 @@ my @Tests = {OUT=>"1\n\0002\n\0002\n\000\0003\n\000\0003\n\000\0003\n"} ], ['zdelim-empty', '-z', '-z --output-delimiter=', @zinputs, {OUT=>"1\000\0002\000\0002\000\000\0003\000\000\0003\000\000\0003\000"} ], + ['total-delim-empty', '--total --output-delimiter=', @inputs, + {OUT=>"1\n\0002\n\0002\n\000\0003\n\000\0003\n\000\0003\n" + . "1\0002\0003\000total\n"} ], # invalid dual delimiter ['delim-dual', '--output-delimiter=,', '--output-delimiter=+', @inputs, |