<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/patch/patch.c, branch upstream/11.2.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=upstream%2F11.2.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=upstream%2F11.2.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2018-03-16T05:29:30Z</updated>
<entry>
<title>MFC r311106,r311109,r311110,r320579,r327063,r327064,:</title>
<updated>2018-03-16T05:29:30Z</updated>
<author>
<name>Eitan Adler</name>
<email>eadler@FreeBSD.org</email>
</author>
<published>2018-03-16T05:29:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9fdbbb322563274a0962b7aec5f263974e76f31c'/>
<id>urn:sha1:9fdbbb322563274a0962b7aec5f263974e76f31c</id>
<content type='text'>
patch(1): replace strnlen() with a simpler strlen().
patch(1): add support for git generated diffs.
patch: rejname[] is also -r option buffer, and should be PATH_MAX.
patch: further cleanup to git-style diffs.
</content>
</entry>
<entry>
<title>MFC r326084: patch(1): don't assume match if we run out of context to check</title>
<updated>2018-01-18T21:53:07Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-01-18T21:53:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b3c902eda721781e628a520a6551fee7541acdbc'/>
<id>urn:sha1:b3c902eda721781e628a520a6551fee7541acdbc</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
</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>
<entry>
<title>patch(1): Add -Vnone option to disable backup files</title>
<updated>2015-07-21T22:57:27Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2015-07-21T22:57:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=300ca9a86e0642c9f9285ace20fbb7f4d2695ba8'/>
<id>urn:sha1:300ca9a86e0642c9f9285ace20fbb7f4d2695ba8</id>
<content type='text'>
Differential Revision:	https://reviews.freebsd.org/D3146
Reviewed by:	pfg
Approved by:	markj (mentor)
MFC after:	1 week
Relnotes:	yes
Sponsored by:	EMC / Isilon Storage Division
</content>
</entry>
<entry>
<title>Fixes to exit status.</title>
<updated>2014-12-31T16:30:33Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-12-31T16:30:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f718bedc4f28c4407e9b873a356c4d2cffbdfe36'/>
<id>urn:sha1:f718bedc4f28c4407e9b873a356c4d2cffbdfe36</id>
<content type='text'>
Exit with EXIT_FAILURE for invalid arguments.
Fixes NetBSD-PR 43517.

Print version string to stdout instead of stderr;
it is user-requested and not an error.

Obtained from:	NetBSD
MFC after:	5 days
</content>
</entry>
<entry>
<title>patch: Bring in xstrdup and use it when appropriate.</title>
<updated>2014-12-25T21:51:28Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-12-25T21:51:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=547e0acbec32a6bb2dc1e75804460ed9fd201d27'/>
<id>urn:sha1:547e0acbec32a6bb2dc1e75804460ed9fd201d27</id>
<content type='text'>
The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in.  In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).

Clean up some whitespaces while here

Obtained from:	OpenBSD
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Prefer setvbuf() to setlinebuf().</title>
<updated>2014-12-07T20:15:07Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-12-07T20:15:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ab761cdbfa355a486d0df954faf6172d4d60628c'/>
<id>urn:sha1:ab761cdbfa355a486d0df954faf6172d4d60628c</id>
<content type='text'>
On FreeBSD's libc setlinebuf is a wrapper to setvbuf anyways.

Obtained from:	OpenBSD
MFC after:	5 days
</content>
</entry>
<entry>
<title>patch: add dry-run alias for compatibility with other implementations.</title>
<updated>2014-06-15T16:38:17Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-06-15T16:38:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5e64d66ca4365c2a3ebc22a9fd4a333876d8e29a'/>
<id>urn:sha1:5e64d66ca4365c2a3ebc22a9fd4a333876d8e29a</id>
<content type='text'>
Other implementations of patch(1), including GNU patch and "svn patch"
have a --dry-run option which does the same as our -C or --check
option.

Add a new alias to make our implementation more compatible.

MFC after:	1 week
</content>
</entry>
<entry>
<title>patch: unsign the line length to avoid overflows.</title>
<updated>2014-06-15T03:54:23Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-06-15T03:54:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c1a08643e3f6c6af2672fc7fd50251465f580489'/>
<id>urn:sha1:c1a08643e3f6c6af2672fc7fd50251465f580489</id>
<content type='text'>
Patch(1) uses a short int for the line length, which is usually
sufficient for regular diffs, but makes no effort to signal
when there is an overflow.

Change the line length to an unsigned short int to better use
the fact that a length is never negative.  The change is loosely
inspired on a related change in DragonFly, but we avoid spending
more memory than necessary.

While here adjust the messages to be clearer on what is happening.

MFC after:	1 week
</content>
</entry>
<entry>
<title>Improve bsdpatch usability:</title>
<updated>2013-09-26T18:00:45Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2013-09-26T18:00:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e11cd3bc59ee77f33a2d253d462dac6b3891e6e4'/>
<id>urn:sha1:e11cd3bc59ee77f33a2d253d462dac6b3891e6e4</id>
<content type='text'>
 - Ask only once for "Apply anyway". [1]
 - Tell user what file have failed patch rather than just how
   many hunks failed.

Reported by:	jmg via pfg [1]
Tested by:	pfg [1]
Approved by:	re (gjb)
</content>
</entry>
</feed>
