mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 10:19:04 +00:00
join(1): Fix ordering in case of missing fields
The comparison function had the ordering reversed causing join(1) to
miss some matching lines.
PR: 232405
Submitted by: Martijn van Duren <martijn@openbsd.org>
(cherry picked from commit 95bf75895d
)
This commit is contained in:
parent
1b70e4f53b
commit
085ab2c143
|
@ -392,9 +392,9 @@ static int
|
|||
cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2)
|
||||
{
|
||||
if (lp1->fieldcnt <= fieldno1)
|
||||
return (lp2->fieldcnt <= fieldno2 ? 0 : 1);
|
||||
return (lp2->fieldcnt <= fieldno2 ? 0 : -1);
|
||||
if (lp2->fieldcnt <= fieldno2)
|
||||
return (-1);
|
||||
return (1);
|
||||
return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2]));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue