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. --- doc/coreutils.texi | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'doc/coreutils.texi') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index d6e98c6d6..b89147ea8 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4787,11 +4787,17 @@ If there is an error it exits with nonzero status. @macro checkOrderOption{cmd} If the @option{--check-order} option is given, unsorted inputs will cause a fatal error message. If the option @option{--nocheck-order} -is given, unsorted inputs will never cause an error message. If -neither of these options is given, wrongly sorted inputs are diagnosed -only if an input file is found to contain unpairable lines. If an -input file is diagnosed as being unsorted, the @command{\cmd\} command -will exit with a nonzero status (and the output should not be used). +is given, unsorted inputs will never cause an error message. If neither +of these options is given, wrongly sorted inputs are diagnosed +only if an input file is found to contain unpairable +@ifset JOIN_COMMAND +lines, and when both input files are non empty. +@end ifset +@ifclear JOIN_COMMAND +lines. +@end ifclear +If an input file is diagnosed as being unsorted, the @command{\cmd\} +command will exit with a nonzero status (and the output should not be used). Forcing @command{\cmd\} to process wrongly sorted input files containing unpairable lines by specifying @option{--nocheck-order} is @@ -5672,7 +5678,9 @@ c c1 c2 b b1 b2 @end example +@set JOIN_COMMAND @checkOrderOption{join} +@clear JOIN_COMMAND The defaults are: @itemize -- cgit v1.2.3-70-g09d2