<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/patch/patch.c, branch release/13.2.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F13.2.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F13.2.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2019-11-04T03:07:01Z</updated>
<entry>
<title>patch(1): give /dev/null patches special treatment</title>
<updated>2019-11-04T03:07:01Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2019-11-04T03:07:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=50dacbf6c2a3d32f7e3f20ca98cda23f38817e7f'/>
<id>urn:sha1:50dacbf6c2a3d32f7e3f20ca98cda23f38817e7f</id>
<content type='text'>
We have a bad habit of duplicating contents of files that are sourced from
/dev/null and applied more than once... take the more sane (in most ways)
GNU route and complain if the file exists and offer reversal options.

This still falls short a little bit as selecting "don't reverse, apply
anyway" will still give you duplicated file contents. There's probably other
issues as well, but awareness is the first step to happiness.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21535
</content>
</entry>
<entry>
<title>patch(1): Exit successfully if we're fed a 0-length patch</title>
<updated>2019-03-01T01:20:21Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2019-03-01T01:20:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ef30b5a80910bd877f582248004200065eeb3ef5'/>
<id>urn:sha1:ef30b5a80910bd877f582248004200065eeb3ef5</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>patch: rejname[] is also -r option buffer, and should be PATH_MAX.</title>
<updated>2017-12-21T16:19:10Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-12-21T16:19:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c844f14e37e57b9f259fb60423456b297b3951e1'/>
<id>urn:sha1:c844f14e37e57b9f259fb60423456b297b3951e1</id>
<content type='text'>
Obtained from:	OpenBSD (CVS 1.64)
</content>
</entry>
<entry>
<title>patch(1): don't assume a match if we run out of context to check</title>
<updated>2017-11-22T03:44:19Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2017-11-22T03:44:19Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bc4f0fe3588183058f52c53f9cf59b77e19842db'/>
<id>urn:sha1:bc4f0fe3588183058f52c53f9cf59b77e19842db</id>
<content type='text'>
Patches with very little context (-U0 and -U1) could get misapplied if
the file to be patched changes and a hunk is no longer applicable. Matching
with fuzz would be attempted and default to a match when we unexpectedly ran
out of context.

This also affected patches with higher levels of context but had limited
actual context due to the hunk being located near the beginning/end of file.

PR:		74127, 223545 (exp-run)
Reviewed by:	emaste, pfg
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D12631
</content>
</entry>
<entry>
<title>Revert r325365</title>
<updated>2017-11-08T23:11:15Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2017-11-08T23:11:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=752e881db7398b10410d26c7d69176ec998d9c3b'/>
<id>urn:sha1:752e881db7398b10410d26c7d69176ec998d9c3b</id>
<content type='text'>
r325365 caused several ports to fail to patch correctly. Revert it for the
time being until an exp-run can be completed.

Requested by:	antoine
Approved by:	emaste (implicit)
</content>
</entry>
<entry>
<title>patch(1): don't assume a match if we run out of context to check</title>
<updated>2017-11-03T17:04:30Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2017-11-03T17:04:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ed3b30599370432f6ac501e36099f597f5999d27'/>
<id>urn:sha1:ed3b30599370432f6ac501e36099f597f5999d27</id>
<content type='text'>
Patches with very little context (-U0 and -U1) could get misapplied if
the file to be patched changes and a hunk is no longer applicable. Matching
with fuzz would be attempted and default to a match when we unexpectedly ran
out of context.

PR:		74127
Reviewed by:	emaste, pfg
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D12631
</content>
</entry>
<entry>
<title>patch(1): replace strnlen() with a simpler strlen().</title>
<updated>2017-01-02T18:27:35Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-01-02T18:27:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fa812237434edee9745e7cf6e9ef4481cf2b5a8c'/>
<id>urn:sha1:fa812237434edee9745e7cf6e9ef4481cf2b5a8c</id>
<content type='text'>
Small style fix with here.

Pointed out by:	kib
</content>
</entry>
<entry>
<title>Revert r311106:</title>
<updated>2017-01-02T18:23:31Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-01-02T18:23:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4f548c1916e86995b61b678743c91d689bba8581'/>
<id>urn:sha1:4f548c1916e86995b61b678743c91d689bba8581</id>
<content type='text'>
patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.

This doesn't really work for 32 bit platforms.

Pointed out by:	kib
</content>
</entry>
<entry>
<title>patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.</title>
<updated>2017-01-02T17:12:14Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-01-02T17:12:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ad8469feec8a84469d38b4a1237fd39abea16198'/>
<id>urn:sha1:ad8469feec8a84469d38b4a1237fd39abea16198</id>
<content type='text'>
We can handle such "big data" without much trouble.
Try to do a better job at detecting the rejection cause while here.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Adjust a type from r267490.</title>
<updated>2016-04-24T04:28:04Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-04-24T04:28:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3548708c4713b248a839f3ef8928dba5c9642a91'/>
<id>urn:sha1:3548708c4713b248a839f3ef8928dba5c9642a91</id>
<content type='text'>
Independent of the maximum length, the return type for strnlen(3)
is always size_t.
</content>
</entry>
</feed>
