summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-4/+3
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Handle ed command "s" as a one line command, which it is.tobias2014-12-141-3/+3
| | | | | | Prevents arbitrary ed command executions in following lines. ok millert
* The function savestr allows NULL return values during Plan A patching so intobias2014-12-134-17/+34
| | | | | | 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).
* Fix division by zero for files with long lines (> 1024) in Plan B modetobias2014-12-091-19/+37
| | | | | | by supporting arbitrarily long lines just like Plan A does. ok tedu
* spacesderaadt2014-12-082-5/+5
|
* three trivial reallocarray() usesderaadt2014-12-011-4/+4
|
* Prefer setvbuf() to setlinebuf() for portability; ok deraadt@millert2014-11-261-3/+3
|
* Properly validate line ranges supplied in diff file to prevent overflows.tobias2014-11-261-4/+27
| | | | | | | Also fixes an out of boundary memory access because the resulting values are used as array indices. ok millert
* Introduce strtolinenum to properly check line numbers while parsing:tobias2014-11-252-33/+51
| | | | | | no signs, no spaces, just digits, 0 <= x <= LONG_MAX ok millert, otto
* Prevent null pointer dereference on empty input files when diff requirestobias2014-11-251-2/+2
| | | | | | a specific version. ok millert
* Remove SCCS support. For this to work, we would need "get", which we don'ttobias2014-11-225-23/+12
| | | | | | even have in ports. XSI functionality of POSIX, therefore optional. ok deraadt, schwarze, tedu
* Remove the README. It history from more than 20 years ago, and whilederaadt2014-11-211-123/+0
| | | | | interesting it has no impact on the maintainance of this stuff. ok tobias
* Avoid iterating over end of string.tobias2014-11-181-3/+3
| | | | ok millert, otto
* 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@