summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/patch.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r276218:pfg2015-01-081-10/+10
| | | | | | | | | | | | | patch: Bring in xstrdup and use it when appropriate. 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 r276472:pfg2015-01-051-1/+1
| | | | | | | | | | | | Minor fixes to exit status. 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 r275531, r275581, r275582;pfg2014-12-161-3/+3
| | | | | | | | | | patch(1): Small changes to sync with OpenBSD Update OpenBSD CVS revision tag for our r255232. Prefer setvbuf() to setlinebuf(). Small space changes, mostly to keep in sync with OpenBSD Obtained from: OpenBSD
* MFC r267512:pfg2014-06-221-0/+1
| | | | | | | | | | patch: add dry-run alias for compatibility with other implementations. 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 r267490:pfg2014-06-221-5/+9
| | | | | | | | | | | | | | | patch: unsign the line length to avoid overflows. 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.
* Improve bsdpatch usability:delphij2013-09-261-4/+7
| | | | | | | | | | - 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)
* patch: style fixpfg2013-07-241-2/+4
| | | | Submitted by: gogolok
* Revert r250972 to fix build.gjb2013-05-251-3/+3
|
* The error handling for writes to the target file could lead to the finalse2013-05-241-3/+3
| | | | | | | | | | fclose() being skipped. Fix this by using boolean "&" and "|" instead of short-cut operators "&&" and "||". While here, increment the last part of the version string. The reason is the fixed output file selection logic in pch.c, which was committed as r250943, yesterday. Reviewed by: pfg
* - Refresh code with latest OpenBSD revisions.delphij2013-01-291-15/+18
| | | | | | | | | - Remove $DragonFly$ tags as they are using git nowadays and VCS tags will not help merging. - Other changes to Copyright headers to make them consistent with other source code, we intend to fork from this point. Reviewed by: pfg
* - Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) fromgabor2013-01-291-0/+1066
| | | | | | | | DragonflyBSD and install it as bsdpatch. WITH_BSD_PATCH makes it default and installs GNU patch as gnupatch. Submitted by: pfg Obtained from: The DragonflyBSD Project
* kill the undeadpeter1997-07-131-800/+0
|
* Finish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,bde1997-07-061-0/+800
| | | | | pascal and vmstat.sparc. All changed files on the vendor branch should already have been imported.
* recording cvs-1.6 file deathpeter1995-12-301-800/+0
|
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+800
OpenPOWER on IntegriCloud