summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
AgeCommit message (Collapse)Author
2023-06-16patch: add --backup-if-mismatch and --no-backup-if-mismatch for GNU patch ↵wiz
compatibility These options only make sense in POSIX mode, since NetBSD's patch has --backup enabled by default and GNU patch doesn't. In POSIX mode, GNU patch and NetBSD patch now behave the same for these two options.
2021-09-20Fix the message that appears if you patch -R an unapplied patch.dholland
2021-05-25As per OpenBSD, use malloc for the line buffer. Fixes the known issuecjep
with long lines and makes our ATF test suite pass fully. Closes PR bin/54620 from coypu who suggested the approach. Reviewed by christos.
2021-02-20patch(1): use PATH_MAX for the size of rejnamenia
via freebsd, openbsd
2021-02-19patch: make '-V none' work in the expected waynia
Internally the code confuses the concept of "the user doesn't want a backup file" and "the user hasn't defined a type of backup file". Introduce a new "undefined" backup type to serve the purpose "none" previously did, and make "none" not generate backup files, as expected. http://mail-index.netbsd.org/tech-userlevel/2021/02/19/msg012901.html XXX pullup?
2011-09-06Consistently use __dead and __printflike.joerg
2011-03-26Exit with EXIT_FAILURE for invalid arguments. PR 43517.dholland
2008-09-19Update patch to the version used by DragonFly and derived from OpenBSD.joerg
Major changes are: - better detection of double applied patches - rejects remain unified diffs for unified patches - far less limitations, e.g. patch lines may be arbitrary long This addresses PR standards/11220 by changing patch -b behavior to be POSIX compliant. Old behavior can be obtained using --suffix, which works since NetBSD 1.4. pkgsrc has been adjusted accordingly.
2008-08-10Add error checking to use of fputs in creating output file ingdt
temprorary directory. Previously, fputs was used without checking the return value, leading to silent truncation when the temporary filesystem was full (such as can easily happen when migrating to tmpfs).
2007-10-14Convert to using raise_default_signal(3).lukem
2005-03-25Sort options. Add -C to usage.wiz
2005-03-25add --dry-run like gnu patch.skd
2004-12-09Fix an array overrun in option parsing.mycroft
Fixes PR 26732, PR 26775, PR 28416 and PR 28589.
2004-08-14Remove debug printf (hi mycroft!).cube
2004-08-06Parse multiple options that are specified together; e.g. "-fs".mycroft
XXX It is not clear to me why patch(1) doesn't get getopt_long(3).
2003-07-30use bounded string opitojun
2003-07-08Const poisoning.kristerw
2003-05-30Fix some lint warnings.kristerw
2003-05-30Remove stuff that are not needed any longer.kristerw
2003-05-30Simplify handling of memory allocation, and make sure all return valueskristerw
from malloc etc. are handled. This removes the old behavior to retry the operation with a less memory- consuming method in case malloc failed (this mechanism has never really worked, and is hard to test. Besides, it is less useful now than it was 20 years ago when the code was written...)
2003-05-29Be consistent with use of types (e.g. do not use LINENUM for quantitieskristerw
that are not line numbers).
2003-01-19Do not try to write a rejects file for those cases where the user haskristerw
told us to skip a patch due to missing file to patch. Solves PR 19827 from Toru TAKAMIZU.
2002-03-16Check result of malloc and strdupkristerw
Made some functions static Removed unneccessary buffer Increased size of some buffers that could overflow
2002-03-11Ansifykristerw
Remove unused defines Remove #ifndef lint Remove redundant and incorrect casts.
2002-03-08Ansifykristerw
Remove 'register' Make local functions static. Remove most '#ifndef lint'
2002-03-06License change; patch.c now has a BSD license.ragge
From Larry Wall via Niklas Hallqvist, <niklas@appli.se>.
2000-10-16Support the 1003.2-92 -i option to specify a patchfile;kleink
fixes PR standards/11221.
1998-11-06char -> unsigned charchristos
rindex -> strrchr
1998-02-22WARNSifychristos
1997-03-22use mkstemp() instead of mktemp() to create the tempfilelukem
1996-09-19RCS id police.thorpej
1996-09-19Decode long (GNU-style) options. Changes originally from Niklas Hallqvist,thorpej
but modified some by me.
1993-08-02Add RCS identifiers, remove some completely useless RCS logs and patchkitmycroft
headers, and a few other insignificant changes.
1993-04-09patch 2.0.12u8, from prep.ai.mit.edu. this is not under the GPL.cgd