]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r320210:
authoreadler <eadler@FreeBSD.org>
Mon, 19 Mar 2018 03:22:43 +0000 (03:22 +0000)
committereadler <eadler@FreeBSD.org>
Mon, 19 Mar 2018 03:22:43 +0000 (03:22 +0000)
commit4e3ba9af0dd7c08a2c003dbd3019b64758d456f1
treec5aaf8fc0894ad7f2d22e6cb7ea316f719967e1c
parent78eb5a01e11e41c78876b5cf1d8ffff02f42fefe
MFC r320210:

join(1): Fix field ordering for -v output

Per POSIX, join(1) (in modes other than -o) is a concatenation of selected
character fields.  The joined field is first, followed by fields in the
order they occurred in the input files.

Our join(1) utility previously handled this correctly for lines with a match
in the other file.  But it failed to order output fields correctly for
unmatched lines, printed in -a and -v modes.

A simple test case is:

$ touch a
$ echo "2 1" > b
$ join -v2 -2 2 a b
1 2

PR: 217711
usr.bin/join/join.c