mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05: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 95bf75895ddcf17402b1f69dce26cb821c922476)
This commit is contained in:
parent
c0565e7d34
commit
aaefd6898a
1 changed files with 2 additions and 2 deletions
|
|
@ -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