From nobody Fri Jun 07 21:16:13 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 4VwvBk1Xrdz5MJQB; Fri, 07 Jun 2024 21:16:14 +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 4VwvBj6X0mz4Fh2; Fri, 7 Jun 2024 21:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717794973; 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=duk+UrzK872ZJNR/sAux8Y/4eO3Cd7iWxkB32JVOoKg=; b=ZFhAd5X24pFjd6Sep3wSOe3uVa5d48GaDrDUckQ+HNS6zZQEdiIb4BFz90YLtJo+ouuQ9L ecTEVvCC8oSDCjB1fd4o7FpCAN5AirvAhSMJwtZPKQZPkUbZMLMJGsvCH5355MmrAezCPs oOns1xRubUENoyoScDAW249WAFZAv8hT0+aZz25Z3bEWhl6sdONTzfbH1+eMT2qbO8rurh 8zxJBVUYq27+9Y1lqMZLyA4DI+Ae0y+mypIxHRMop+rZ0EvmlVVvWC6OOD7MF+j6gRXVED 6KRES3wuTQp6ZQwpWEnqGM04qp2gvAQ0B/ud5c9pgCOZe5kSc7wYxLUIeJTQSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717794973; a=rsa-sha256; cv=none; b=CwYEIwbtL8MWEgYFvnVwOMV9r366s+joCTCTr/Fm3XFUZPEOSayZ+KmtUet2ottIOm8CoC YmVWCdeZj4dDH92bBB17OuvJ2EupDOjxLPaQMOsamRSeSPDeRBUO6T/Nh1srSXWEeECBfe jSlg4x04z5twyMGJIy3ZN008gL6mBBkH8eW4+6NfutljUc/6fTvNTLbDvjZz2nw8oFhbGv 9Z0XmQGif7WfQkDBIGABfDLefWoIWNbM8qQWjY01/oF6PuQOWhO29f2wEPfl+ZNGACkWQl IaB0IwZo+UgGzz3XcFx5BiTlIu0cPX9/84K/wp+j2i6lK/nrLAAqtyA+UtHUwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717794973; 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=duk+UrzK872ZJNR/sAux8Y/4eO3Cd7iWxkB32JVOoKg=; b=w300FzIoxEY0ZgtQBySp+Tfl3u7u3ofxwOY80gdJMVwBYFESRr7/GkX+KM71lNrt3xcL5m yjg9RxtZvjqiuNLASBLC6qN7NBp52bYeTSRKmgRZko9WjqKI6AsxaNM1PMNtWvj5XBo6Xk US7xIl90ZGGThWUnvxJ/xRpVmHmhD5XaKiyvmHITvpqtlISfL7eb0dAJnTPkxUt37qGICi 0/y3iRTwk/lSsKdJCu79LMCBKydVw4/6qHEwPjYCB+ddM/ScCudyD/CVb23DtHzj4RiHaR F3bPT6EO/J/49aBu1HTWHtZFX8Wo0LhyhZqMHbfODsESGEqyeYDPzIZy8IcPiw== 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 4VwvBj67TzzWFH; Fri, 7 Jun 2024 21:16:13 +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 457LGDUo031715; Fri, 7 Jun 2024 21:16:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 457LGDMC031712; Fri, 7 Jun 2024 21:16:13 GMT (envelope-from git) Date: Fri, 7 Jun 2024 21:16:13 GMT Message-Id: <202406072116.457LGDMC031712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 12ea2d04c379 - stable/13 - diff: honour -B flag with -q 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12ea2d04c37982cabf7865e8897226c81aae4ab0 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=12ea2d04c37982cabf7865e8897226c81aae4ab0 commit 12ea2d04c37982cabf7865e8897226c81aae4ab0 Author: Ed Maste AuthorDate: 2024-05-16 14:53:23 +0000 Commit: Ed Maste CommitDate: 2024-06-07 21:15:57 +0000 diff: honour -B flag with -q PR: 278988 Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45220 (cherry picked from commit fb623aab3927a6825ff7731198ec2e33426f7607) (cherry picked from commit 1b7672ed992963e1c79ccc152f4afd72c91481f3) --- usr.bin/diff/diffreg.c | 3 ++- usr.bin/diff/tests/diff_test.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 322c66c76839..a73020c44a80 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -374,7 +374,8 @@ diffreg(char *file1, char *file2, int flags, int capsicum) } if (diff_format == D_BRIEF && ignore_pats == NULL && - (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) == 0) + (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE| + D_SKIPBLANKLINES|D_STRIPCR)) == 0) { rval = D_DIFFER; status |= 1; diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index a3821b4deb2f..29ab0eaec161 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -10,6 +10,7 @@ atf_test_case brief_format atf_test_case b230049 atf_test_case stripcr_o atf_test_case b252515 +atf_test_case b278988 atf_test_case Bflag atf_test_case Nflag atf_test_case tabsize @@ -85,6 +86,14 @@ b252515_body() diff -qw b252515_a.in b252515_b.in } +b278988_body() +{ + printf 'a\nb\nn' > b278988.a.in + printf 'a\n\nb\nn' > b278988.b.in + atf_check -o empty -s eq:0 \ + diff -Bw b278988.a.in b278988.b.in +} + header_body() { export TZ=UTC @@ -288,6 +297,7 @@ atf_init_test_cases() atf_add_test_case b230049 atf_add_test_case stripcr_o atf_add_test_case b252515 + atf_add_test_case b278988 atf_add_test_case Bflag atf_add_test_case Nflag atf_add_test_case tabsize