From nobody Fri May 24 23:59:23 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 4VmMTS28xgz5LZ0m; Fri, 24 May 2024 23:59:24 +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 4VmMTR6vj2z4tCS; Fri, 24 May 2024 23:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716595164; 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=0gilGHBDgXo62t+7ROHTbhTD+2pOG7VDkPrcqRrj8e0=; b=TwATDbNPz9s1sxujJpSUBm/MQAnt2qCSo3OA0QqtWYyUO3lQ2OeTHXEXOV/7Yqq3fIcAMX 11A/fdcUcAYkx9jIBYSvpYgKP9IFvreEFnMitQdIZ5gQee95tUt1aIt6EVbPugyzuqgP2H XP6gsu997vRU5C4SfCfQAGczw+DBafLqBEgbGwxahR5cdd3QPDHg9MS+71qVmYDGKWQHTL ChJtmWjtPShk9PUkR/y7A1CSMU8isfNICR8g13+LlaKNC8aLmKdFvOGGJJSp8AsnIYm02J HgXfgvpWQBvx0rYm9TJT1OJuyC1+KS70WFFS4G5Th/khCHl6hmk+fPBT3vB+MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716595164; a=rsa-sha256; cv=none; b=xpWqI6ngDYJsbbwEgD6XsxHNtam4UUAWJCsW7U1qAbxMK+7wwIKVd5/dR6PlLQxxTJou+1 2CQXia7dx495DPGfZoPxMPGs4dqhRryXgYJEzLSViRFf5iiv5vQTDiCeDxqSs1haPVxD67 3q2fqPJk7sFBZRMm5D+nPMXYMphK0HUa+8WL4xdBYV7u2l0GiJR3kaifaK2bPxONr5LVDs KB9vtTH7EoBdPDe02qo1llhAGOfcc9NlbzCSo0Sz5oRO/dkEPEkSAqkp54bOwrqo5hCvXS 07NK6DxbdlMdaLFq0FLJ5iMj2ZA5aKxM/KYBOu1eveLgva82yF4awMeRUEq3tQ== 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=1716595164; 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=0gilGHBDgXo62t+7ROHTbhTD+2pOG7VDkPrcqRrj8e0=; b=ekz53rSQ87XFKe6KnOp/2ymOpxccb4DCVr68T6oFfom4JRbj2fyPOAPAN0Uy2GFRD6sgpH uLGjhfD+LduqIqU9ib3CjngjqsPv89udjRpIwO1aGF3x1cEEH8cWByPZjm3R6muRMbMJyp oVFcdj2EvR+tEoXYeXaCLE/3r5O7IGXDEybVeAflNcZ4jfmhK+tu4EhPQ6fQcEkqJD+oR9 G0Ra5MqAysQ8BfNfYu5G4X5HfnPWf4lGALpbrhkvKCgTg34mZ1MgOwexpvbi4F4m9R0wnA 14fIsL5YeytRO8gjSy/8gZ+q1jg6jad9nDiUzJEAI4DoAr3yp+jWhXx0t3f0tg== 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 4VmMTR6P3Bztn9; Fri, 24 May 2024 23:59:23 +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 44ONxNTM050614; Fri, 24 May 2024 23:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ONxNeY050611; Fri, 24 May 2024 23:59:23 GMT (envelope-from git) Date: Fri, 24 May 2024 23:59:23 GMT Message-Id: <202405242359.44ONxNeY050611@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: 1b7672ed9929 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 1b7672ed992963e1c79ccc152f4afd72c91481f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1b7672ed992963e1c79ccc152f4afd72c91481f3 commit 1b7672ed992963e1c79ccc152f4afd72c91481f3 Author: Ed Maste AuthorDate: 2024-05-16 14:53:23 +0000 Commit: Ed Maste CommitDate: 2024-05-24 23:59:11 +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) --- 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 8042003cd836..ffb3f90beede 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -383,7 +383,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 66596bae8a46..c29c0a93d5d8 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -11,6 +11,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 @@ -89,6 +90,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 @@ -365,6 +374,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