From nobody Wed Jan 31 08:54:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPwpK2Khnz58nWb; Wed, 31 Jan 2024 08:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPwpK1pfYz45jX; Wed, 31 Jan 2024 08:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706691289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7t0TIHlYDoLVf1B8dPTH8XP+tq1GcRFxbnM/945wdcE=; b=c1j1oSfOBnNKZLwhfReR5X51zFfzG12Y8MQcuJfV0GxAxAnuwdxJu2TQ/NbHOd+YG9ll2E du+/jU7ojTmXqEiHFG2uqA/hHywOKZp4xp75kqmh5vkMe7POB5kECfUZ0/eVkxbOEAVyqf s/b/89x8M6896QPIANUMosHj4k/6/BKjwwjBwWeSILECYjemoL8pYoc9aW+IKEj7xM5/NK pBnLC94xnphtArET0FUtVLthM//786G+sCEcUClYAlT9VLkHE6ENvOkdwGSP4dS61xrxAy bh+o5v3lWjo+Z1AKMBZvIl1tz4EJshX84Ngwq1oHu2AhssUSRfH3yxMdPCf12A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706691289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7t0TIHlYDoLVf1B8dPTH8XP+tq1GcRFxbnM/945wdcE=; b=XCTNzDM3isgfZwyWwkUWGfZjrRGzsblKImf3tdcD0gst6DsJzBOb+KVODdQELKkzU9cOwZ r/2i3taPQy96eFUzGSwon/o+M2nX6Ja9IGiYaYmYGzWQ5TkKc55nRnbi35WGyZP7unkPDT CuUc5j3Dmo8Az4JNxg6fQ9QdabuaQupRMVzOQcryTX9Gdd1bA8XFzxiTm1cKDUPqA4K0GG SYclQuTOSSgBdg9BoZYtalMBN0dTNea9H+mLI6+lm0wEKqN6hR55l1HhfpwhsB9MfqTSxA 8WuwvNAmKp9JtJDlVzPu7r+YYy7XKnwvBD4u+CIuOawef5Qfs9rBpCjMw5eI/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706691289; a=rsa-sha256; cv=none; b=rfckz9OPI79nwgM8dWifmIp9t4NSrlGIo5uEPlEQKiqebpkhPfbpRRFoLwxo9ADRPWQBIe fOI6aogMbjjTwVPy7QW4obswxc1UEVusqKxx0XWNlSgMvNa1FifJbj1jTVq9j97Dq82zNn TCe7IR3R1ug22oBD9ZkCyqTCIdhBHEmO7bazEsrCbOSh1c4C0U5S2QAQoGwM5S368t9fYm hi6USr2MzaFZVFIQJjuAulKAs2nPAz0TsSkIPTAyEOWfSOwlyz0RTZJ7fDE92ABuYj9umh 4zTgycmMksx2LgF82M+JsyzLN+kzAdyWrp4DF8YSlXBBMxjO6C1y93bYDoZBww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPwpK0t50z1Bnl; Wed, 31 Jan 2024 08:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40V8snaK087197; Wed, 31 Jan 2024 08:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V8snKx087194; Wed, 31 Jan 2024 08:54:49 GMT (envelope-from git) Date: Wed, 31 Jan 2024 08:54:49 GMT Message-Id: <202401310854.40V8snKx087194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: aaefd6898a73 - stable/14 - join(1): Fix ordering in case of missing fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaefd6898a73528d3888331a51983cbcc9f06125 Auto-Submitted: auto-generated The branch stable/14 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=aaefd6898a73528d3888331a51983cbcc9f06125 commit aaefd6898a73528d3888331a51983cbcc9f06125 Author: Tijl Coosemans AuthorDate: 2024-01-22 10:35:31 +0000 Commit: Tijl Coosemans CommitDate: 2024-01-31 08:53:11 +0000 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 (cherry picked from commit 95bf75895ddcf17402b1f69dce26cb821c922476) --- usr.bin/join/join.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c index b9e708dd98cd..eab0dbcac900 100644 --- a/usr.bin/join/join.c +++ b/usr.bin/join/join.c @@ -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])); }