From nobody Sat May 18 00:05:31 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 4Vh3xl6LKCz5Kd0V; Sat, 18 May 2024 00:05:31 +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 4Vh3xl4qywz4gvG; Sat, 18 May 2024 00:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715990731; 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=RipKbH+YH9ep/vXshw3v/1tr+egNyIEtjHvoCggx0HA=; b=PiOHQTIe3nuYUExPJZI2kYd9c7Y8oGkSb4LePry6fl6vZOgzykj7TtcBPnDwLie40tT/Rc 6kNgm1UOk8HemMV4X63R8MrzHhUrLJ2im71FVMDoiY0Wl9rl5mRk6kLtk3zvfhehUqGHSn hnef70f/q8kzoQXAnEBfd3EaXkVJBIB7EZfKpRmSP3pTGbzbChalr5xLlO3Dmh/hNobplC crerqtSFiUwpb89hd0JfTwJsmqrdXcUqAdI/GBnKYrVLNDzcsQrjLsC0BDcxSJ9n55e0eK jk7L++1U3p307bfaxvZ8X2tBbKmi2heemaLEG625WYXFjuLGgJgsfNaVhBZMZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715990731; a=rsa-sha256; cv=none; b=hJ30nPi26PTmCxRR1QYEBKcKL6RYK+V6HLZd9rvmpHLUOYgzway8egCN8GKWx4tNHgsjv9 pTUw4dsdZiIGLK0mSx5jrJJN/o9qvF8sI5EYIRGLF4z/fgJWrQhuM4S/T5Dskr9klw4LHV UL+GRIBf851KlF1qxB9QnLOf4S+NrcUjNDEoki6YmgYpLKA8BLQp5b6yOZN6GkNxc3HCbm TbemjCUttVCnpdbig7B50Ej/yirbl1ahUzpWNLbj1ekMHbz+pjMJEmzmRT2NxtF6ddhG+u 6pycFEGmfqLvFFWKeDaTgLsgO2LrIxf34TR9JyLRF5JLQSD6L8ewavlRaHePJg== 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=1715990731; 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=RipKbH+YH9ep/vXshw3v/1tr+egNyIEtjHvoCggx0HA=; b=c/we+NS7AVbiZruPYKcehoyNWkNdHWQ9SXhazwym8rjDGEvIbWt3WPPzPkTuuUwECTewFD BLc5TaJXQHFxMf6bLDNL6QB7K9XmHmwU7gM0TTD1w5/tCd1wWWM/yYBOvQ/cLS5oZ8amEh ObmMkogZqZ8oxJNNUsCzewbysDtBquHM0Tzl0RuLWu+/drG6gOF8/WGp3WX+pZ+VN+Xqwf /tezQ7kl+HBvXKgG5NV9qaD341AYrAymKR9gTpYe4nH5Wck4IDOfn5KkntaOR9Fi+KIP+d pU02Z9+scBN5xhr9H7NvljYY9C1F+jCqaZOhVGCYPwlJaZ3ACdG8EOypFNb5iw== 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 4Vh3xl4K46z13TL; Sat, 18 May 2024 00:05:31 +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 44I05V6s061668; Sat, 18 May 2024 00:05:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44I05VSN061665; Sat, 18 May 2024 00:05:31 GMT (envelope-from git) Date: Sat, 18 May 2024 00:05:31 GMT Message-Id: <202405180005.44I05VSN061665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: fb623aab3927 - main - 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/main X-Git-Reftype: branch X-Git-Commit: fb623aab3927a6825ff7731198ec2e33426f7607 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fb623aab3927a6825ff7731198ec2e33426f7607 commit fb623aab3927a6825ff7731198ec2e33426f7607 Author: Ed Maste AuthorDate: 2024-05-16 14:53:23 +0000 Commit: Ed Maste CommitDate: 2024-05-18 00:03:56 +0000 diff: honour -B flag with -q PR: 278988 Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45220 --- usr.bin/diff/diffreg.c | 3 ++- usr.bin/diff/tests/diff_test.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 06d914215b11..6073feebf5fb 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -408,7 +408,8 @@ diffreg_stone(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 146c23fa303d..9a17d180da02 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,15 @@ 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 @@ -369,6 +379,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