summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Check fstat return value. Also, use off_t for file size and offsets astobias2014-11-171-37/+39
| | | | | | suggested by bluhm@. ok schwarze@
* Call munmap with the same size argument as mmap.tobias2014-11-151-2/+2
| | | | ok millert, otto
* userland reallocarray audit.doug2014-10-081-2/+2
| | | | | | | Replace malloc() and realloc() calls that may have integer overflow in the multiplication of the size argument with reallocarray(). ok deraadt@
* Use errc/warnc to simplify code.guenther2014-05-201-2/+2
| | | | | | Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
* patch was moved from user portability (UP) to base in issue 7jmc2014-04-151-8/+5
| | | | and is no longer optional;
* unsigned char casts for ctypederaadt2013-11-265-44/+49
| | | | ok krw
* pull in local .h files to satisfy protoderaadt2013-11-121-1/+4
|
* Bring file selection in accordance with the man page; from Stefan Esserotto2013-07-111-35/+33
| | | | ok millert@
* Fix confusing patch(1) output on failure when using -C. Frommillert2012-05-151-8/+7
| | | | dragonflybsd via Loganaden Velvindron. OK mikeb@ and deraadt@
* Silence gcc warnings.ajacoutot2012-04-111-1/+3
| | | | ok deraadt@
* Don't try to mmap a zero length file, from NetBSD.ajacoutot2012-04-101-6/+10
| | | | | | Needed after the recent mmap(2) change. ok ariane@
* add an EXIT STATUS section for /usr/bin;jmc2010-09-031-18/+18
|
* Send normal output to stdout instead of everything to stderr. Thisray2010-07-242-8/+6
| | | | | | | | | | is currently done in the latest versions of GNU patch. Please watch out for output appearing out-of-order. Discussed with millert and deraadt. OK deraadt
* Don't leak memory after strdup() in makedirs().oga2010-01-081-2/+4
| | | | | | From Igor Zinovik; thanks! ok stsp@, millert@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-275-25/+5
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* If no patch can be found in input, in addition to complaining on stderr,stsp2009-04-051-2/+10
| | | | | | | | have the exit code indicate failure, not success. Discrepancy with GNU patch pointed out by Arfrever Frehtes Taifersar Arahesis. Help from and ok djm@, "sounds good to me" millert@
* updates to IEEE Std 1003.1-2008;jmc2009-02-081-2/+2
|
* bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewjmc2009-02-081-5/+5
| | | | updates to follow;
* over-rule -> overrule; from Thomas Pfaffjmc2008-10-191-3/+3
|
* The code to detect multiple applied diffs to empty files I introduced 4otto2008-08-201-9/+3
| | | | | | years ago is not correct if the diff has an empty context for other reasons, so revert that change. Problem found by Joerg Sonnenberger; ok tedu@ millert@
* update the description of -b and STANDARDS; suggested by grunkjmc2008-06-061-7/+14
| | | | ok millert
* providing MLINKS for shell builtins makes little sense: what we had was outjmc2008-01-111-5/+4
| | | | | | | | | | | of date for ever (no ksh builtins), and since we have two shells, pointing to one page or the other is never going to work; so remove MLINKS for csh(1); the cd(1) and wait(1) pages (also builtins); and update any trailing Xr's; please, there are tools like whence, man, and locate for finding this stuff; ok deraadt miod
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-021-5/+5
|
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* - note some apps which are xpg4, not posixjmc2007-05-311-1/+14
| | | | | | - note that some apps are optional to posix after some discussion w/ otto
* adds a detailed synopsis to the man page; sorts options insobrado2007-04-182-57/+96
| | | | | | | | the description list and adds missing arguments; syncs usage() written with a lot of useful advice by jmc@ ok by jmc@
* type police and assorted cleanup. From Lionel Fourquaux; ok ray@otto2006-03-116-24/+27
|
* constuct -> constructmiod2005-11-141-3/+3
|
* umask juggling not needed; with Lionel Fourquaux.otto2005-06-203-14/+8
| | | | ok millert@ espie@
* Do not call out mkdir -p, but reuse the code from mkdir(1).espie2005-05-164-12/+91
| | | | | | | | | | | Removes the possibility of nasty stuff happening thanks to unquoted arguments in system(1). Also plug a small memory leak. Problems noticed by Lionel Fourquaud. okay millert@, deraadt@
* Write reject file in unified format if the original diff was inotto2004-11-191-4/+84
| | | | | unified format. ok deraadt@
* Allow for path names containing spaces and other funny chars (exceptotto2004-11-191-4/+6
| | | | | | | | tab) by scanning for the tab that separates the date from the pathname. If no tab is found, revert back to the old behaviour. Posix says there should be a space between the pathname and the date, but all known implementations of diff(1) use a tab. ok kurt@ deraadt@
* remove unused variablederaadt2004-09-141-4/+3
|
* spacingderaadt2004-08-055-21/+21
|
* Properly detect if a patch already has been applied, even if thereotto2004-07-092-4/+25
| | | | | | are no eols at eofs involved. Tested by quite some people. ok deraadt@
* Unbreak handling of standard diffs (which have an empty context).otto2004-06-181-4/+9
| | | | ok @millert
* Teach patch(1) to detect if a diff creating a file (or one addingotto2004-06-141-5/+5
| | | | | lines to an empty file) already has been applied; be a bit less chatty about empty contexts. Testing hshoexer@ ok millert@
* Fix a segv when patch cannot find a file and the user indicatesotto2004-01-281-3/+3
| | | | | | to use the file anyway. Problem found by david@ ok david@ millert@
* MAP_FILE is the default and MAP_PRIVATE has to be given or produces evil warnings in debug kernelmickey2003-12-081-3/+3
|
* madvise(sequential) the mmap()ed file and plug an fd leak on mmap() failure; millert@ okmickey2003-11-211-2/+5
|
* o fairly major man page reorganizationmillert2003-10-317-256/+495
| | | | | | o add --posix option for strict POSIX conformance o change filename determination to match GNU patch Tested by various people, including a full ports build by naddy@
* realloc(3) cleanup.otto2003-09-282-12/+35
| | | | ok cloder@ tedu@
* Add license from patch.c to original source files missing a license.otto2003-08-157-10/+192
| | | | ok deraadt@
* Fix no newline at end of file case for Plan B.otto2003-08-121-7/+16
| | | | ok millert@ tedu@
* Do not add an extra newline at the end if the last line of the inputotto2003-08-103-19/+31
| | | | | | | file contains no newline and the diff does not touch the last line. Contributions from millert@. ok millert@ tedu@
* Warn if the diff is a context or unified diff and the contextotto2003-08-101-3/+10
| | | | | | is empty. In this case, a previously applied patch cannot be detected. ok millert@ tedu@
* Avoid scanning the input file twice.otto2003-08-081-21/+35
| | | | ok millert@ tedu@
* spacingderaadt2003-08-052-16/+16
|
* - Use mmap(2) instead of malloc(3) and read(2) to get an image of the inputotto2003-08-051-27/+61
| | | | | | | file into memory. Some suggestions by tedu@. - Add a debug option to force using Plan B. ok millert@ deraadt@
* - use stdbool.h instead of roll-your-own booleansotto2003-08-016-181/+184
| | | | | | | | | - fix some -Wall warnings - fix asserts: in some cases remove them, in other cases they have become Internal errors or detection of malformed patch files. - fix some free() related code ok millert@ tedu@