From 877ca5bf8588ae73a6ccc672e41f13c5b3943b14 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 27 Jan 2011 07:17:16 +0000 Subject: join: don't report disorder against an empty file This allows one to use join as a field extractor like: join -a1 -o 1.3,1.1 - /dev/null * src/join.c (join): Don't flag unpairable lines when one of the files is empty. * tests/misc/join: Add a new test for empty input, and adjust a previous test that was only checking against empty input. * doc/coreutils.texi (join invocation): Document the change. * NEWS: Likewise. --- tests/misc/join | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/misc/join b/tests/misc/join index 5086ee75e..eae3f18a8 100755 --- a/tests/misc/join +++ b/tests/misc/join @@ -209,7 +209,11 @@ my @tv = ( # Before 6.10.143, this would mistakenly fail with the diagnostic: # join: File 1 is not in sorted order -['chkodr-7', '-12', ["2 a\n1 b\n", ""], "", 0], +['chkodr-7', '-12', ["2 a\n1 b\n", "2 c\n1 d"], "", 0], + +# After 8.9, join doesn't report disorder by default +# when comparing against an empty input file. +['chkodr-8', '', ["2 a\n1 b\n", ""], "", 0], # Test '--header' feature ['header-1', '--header', -- cgit v1.2.3-54-g00ecf