]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
patch(1): Exit successfully if we're fed a 0-length patch
authorkevans <kevans@FreeBSD.org>
Fri, 1 Mar 2019 01:20:21 +0000 (01:20 +0000)
committerkevans <kevans@FreeBSD.org>
Fri, 1 Mar 2019 01:20:21 +0000 (01:20 +0000)
commit1bb2153f61d59b5c152b84725ff5a71355109470
tree1b8c26650c4d2ea7dae4fe745ad995b5c8372bfb
parentad1be94443fbdb8443d44f01d39450bc0301e0dc
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.

Reported by: db
MFC after: 2 weeks
usr.bin/patch/common.h
usr.bin/patch/patch.c
usr.bin/patch/pch.c