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> MFC after: 1 week
This commit is contained in:
parent
7304bd7a52
commit
95bf75895d
|
@ -380,9 +380,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