From owner-svn-src-all@freebsd.org Tue Sep 3 14:06:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02A45DC514; Tue, 3 Sep 2019 14:06:12 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z73d5wz4PJ4; Tue, 3 Sep 2019 14:06:11 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 3C1871A2BA; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5A39217A86; Thu, 4 Apr 2019 17:21:33 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B876B836B2; Thu, 4 Apr 2019 17:21:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 88EF617A1B; Thu, 4 Apr 2019 17:21:32 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6156F17A19 for ; Thu, 4 Apr 2019 17:21:32 +0000 (UTC) (envelope-from kevans@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 352D0836AB; Thu, 4 Apr 2019 17:21:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8B077D0; Thu, 4 Apr 2019 17:21:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x34HLVK9030075; Thu, 4 Apr 2019 17:21:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34HLVxW030072; Thu, 4 Apr 2019 17:21:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904041721.x34HLVxW030072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345878 - in stable: 11/usr.bin/patch 12/usr.bin/patch X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.bin/patch 12/usr.bin/patch X-SVN-Commit-Revision: 345878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: B876B836B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:34 -0000 X-Original-Date: Thu, 4 Apr 2019 17:21:31 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:34 -0000 Author: kevans Date: Thu Apr 4 17:21:30 2019 New Revision: 345878 URL: https://svnweb.freebsd.org/changeset/base/345878 Log: MFC r344677: patch(1): Exit successfully if we're fed a 0-length patch This change is made in the name of GNU patch compatibility. If GNU patch is fed a zero-length patch, it will exit successfully with no output. This is used in at least one port to date (comms/wsjtx), and we break on this usage. It seems unlikely that anyone relies on patch(1) calling their completely empty patch garbage and failing, and GNU compatibility is a plus if it helps with porting, so make the switch. Modified: stable/12/usr.bin/patch/common.h stable/12/usr.bin/patch/patch.c stable/12/usr.bin/patch/pch.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/patch/common.h stable/11/usr.bin/patch/patch.c stable/11/usr.bin/patch/pch.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.bin/patch/common.h ============================================================================== --- stable/12/usr.bin/patch/common.h Thu Apr 4 17:20:55 2019 (r345877) +++ stable/12/usr.bin/patch/common.h Thu Apr 4 17:21:30 2019 (r345878) @@ -64,6 +64,7 @@ extern size_t buf_size; /* size of general purpose buf extern bool using_plan_a; /* try to keep everything in memory */ extern bool out_of_mem; /* ran out of memory in plan a */ +extern bool nonempty_patchf_seen; /* seen a non-zero-length patch file? */ #define MAXFILEC 2 Modified: stable/12/usr.bin/patch/patch.c ============================================================================== --- stable/12/usr.bin/patch/patch.c Thu Apr 4 17:20:55 2019 (r345877) +++ stable/12/usr.bin/patch/patch.c Thu Apr 4 17:21:30 2019 (r345878) @@ -53,6 +53,7 @@ size_t buf_size; /* size of the general purpose buff bool using_plan_a = true; /* try to keep everything in memory */ bool out_of_mem = false; /* ran out of memory in plan a */ +bool nonempty_patchf_seen = false; /* seen nonempty patch file? */ #define MAXFILEC 2 @@ -419,7 +420,7 @@ main(int argc, char *argv[]) set_signals(1); } - if (!patch_seen) + if (!patch_seen && nonempty_patchf_seen) error = 2; my_exit(error); Modified: stable/12/usr.bin/patch/pch.c ============================================================================== --- stable/12/usr.bin/patch/pch.c Thu Apr 4 17:20:55 2019 (r345877) +++ stable/12/usr.bin/patch/pch.c Thu Apr 4 17:21:30 2019 (r345878) @@ -179,6 +179,9 @@ there_is_another_patch(void) say("done\n"); return false; } + if (p_filesize == 0) + return false; + nonempty_patchf_seen = true; if (verbose) say("Hmm..."); diff_type = intuit_diff_type();