1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00

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.
This commit is contained in:
Pádraig Brady
2011-01-27 07:17:16 +00:00
parent 32626bde6d
commit 877ca5bf85
4 changed files with 29 additions and 9 deletions

View File

@@ -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',