summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/inp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use <fcntl.h> instead of <sys/file.h> for open() and friends.guenther2018-04-261-4/+2
| | | | | | | Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
* parameter "lines_allocated" is a local pointer and should not be confusedderaadt2017-03-251-5/+5
| | | | with the global by the same name, so rename it "lines_allocatedp".
* Cleanup close(open idioms.deraadt2016-07-191-2/+6
| | | | ok krw
* creat() -> open equiv; from Frederic Nowakderaadt2015-11-111-2/+2
|
* Remove support for automatically checking files out of RCS. Themillert2015-07-261-63/+4
| | | | | behavior is confusing to users and even GNU patch no longer does it by default. OK krw@ guenther@
* Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@millert2015-02-051-2/+2
|
* 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
* 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-221-7/+2
| | | | | | even have in ports. XSI functionality of POSIX, therefore optional. ok deraadt, schwarze, tedu
* 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@
* unsigned char casts for ctypederaadt2013-11-261-4/+5
| | | | ok krw
* 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@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-5/+1
| | | | | | | 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
* type police and assorted cleanup. From Lionel Fourquaux; ok ray@otto2006-03-111-8/+8
|
* constuct -> constructmiod2005-11-141-3/+3
|
* spacingderaadt2004-08-051-4/+4
|
* 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
|
* realloc(3) cleanup.otto2003-09-281-5/+8
| | | | ok cloder@ tedu@
* Add license from patch.c to original source files missing a license.otto2003-08-151-2/+28
| | | | 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-101-3/+5
| | | | | | | file contains no newline and the diff does not touch the last line. Contributions from millert@. ok millert@ tedu@
* Avoid scanning the input file twice.otto2003-08-081-21/+35
| | | | ok millert@ tedu@
* spacingderaadt2003-08-051-8/+8
|
* - 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-011-19/+19
| | | | | | | | | - 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@
* Print a maximum of one invalid line number warning per patch in a patch file.otto2003-07-311-3/+6
| | | | | | Thanks to espie@ for spotting the problem. ok millert@ henning@ espie@
* minor knf and cleanups; otto okderaadt2003-07-281-5/+4
|
* More cleanup: sprinkled some const, removed ugly EXTERN/INTERN.h,otto2003-07-281-19/+22
| | | | | | some rewriting of code to make it more readable and more KNF. ok millert@ tedu@ deraadt@
* New version of invalid line number fix. Passes patch(1) regressions.otto2003-07-231-3/+3
| | | | ok millert@ deraadt@
* just about nothingderaadt2003-07-221-3/+3
|
* More cleanup.otto2003-07-221-40/+48
| | | | ok millert@ tedu@
* Back out invalid line number fix. It core dumps in some cases. Problem found byotto2003-07-211-3/+3
| | | | | marc@. ok henning@
* fix headerderaadt2003-07-211-2/+2
|
* remove a bit more junkderaadt2003-07-211-12/+6
|
* knf and other cleanup; ok ottoderaadt2003-07-211-302/+305
|
* remove junk; ok otto teduderaadt2003-07-181-58/+60
|
* Do not produce garbage if the patch file contains invalid line numbers.otto2003-07-161-4/+6
| | | | ok millert@ tedu@
* 4 unchecked mallocs; cloder@acm.orgderaadt2002-07-041-2/+4
|
* Use libc basename(3) and dirname(3) instead of defining our own. Also clean up some nasty assumptions that basename() returns a pointer that lies within its argumentmillert1999-01-031-14/+14
|
* add -Cespie1998-11-251-2/+12
|
* Start of -Wall and cleaning up icky bits.millert1997-09-221-7/+7
|
* sprintf -> snprintf except where guaranteed safe.millert1996-09-241-7/+7
|
* undo mktemp cleanup until i get it rightderaadt1996-07-011-2/+3
|
* mktemp w/ open & fdopenderaadt1996-06-251-3/+3
|
* Support the long options that FSF's patch version has. $OpenBSD$ addedniklas1996-06-101-1/+3
|
* initial import of NetBSD treederaadt1995-10-181-0/+353