Home | History | Annotate | Download | only in patch
History log of /src/usr.bin/patch/patch.c
RevisionDateAuthorComments
 1.35  12-Jul-2024  manu Let patch(1) handle lines of length beyond INT16_MAX

Borrowed from OpenBSD
https://marc.info/?l=openbsd-bugs&m=168907249732754
 1.34  16-Jun-2023  wiz branches: 1.34.2;
patch: add --backup-if-mismatch and --no-backup-if-mismatch for GNU patch 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.
 1.33  20-Sep-2021  dholland Fix the message that appears if you patch -R an unapplied patch.
 1.32  25-May-2021  cjep As per OpenBSD, use malloc for the line buffer. Fixes the known issue
with long lines and makes our ATF test suite pass fully.
Closes PR bin/54620 from coypu who suggested the approach.
Reviewed by christos.
 1.31  20-Feb-2021  nia branches: 1.31.2;
patch(1): use PATH_MAX for the size of rejname

via freebsd, openbsd
 1.30  19-Feb-2021  nia patch: make '-V none' work in the expected way

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?
 1.29  06-Sep-2011  joerg branches: 1.29.34; 1.29.44;
Consistently use __dead and __printflike.
 1.28  26-Mar-2011  dholland Exit with EXIT_FAILURE for invalid arguments. PR 43517.
 1.27  19-Sep-2008  joerg branches: 1.27.4;
Update patch to the version used by DragonFly and derived from OpenBSD.
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.
 1.26  10-Aug-2008  gdt Add error checking to use of fputs in creating output file in
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).
 1.25  14-Oct-2007  lukem branches: 1.25.8;
Convert to using raise_default_signal(3).
 1.24  25-Mar-2005  wiz branches: 1.24.12;
Sort options. Add -C to usage.
 1.23  25-Mar-2005  skd add --dry-run like gnu patch.
 1.22  09-Dec-2004  mycroft Fix an array overrun in option parsing.
Fixes PR 26732, PR 26775, PR 28416 and PR 28589.
 1.21  14-Aug-2004  cube Remove debug printf (hi mycroft!).
 1.20  06-Aug-2004  mycroft Parse multiple options that are specified together; e.g. "-fs".
XXX It is not clear to me why patch(1) doesn't get getopt_long(3).
 1.19  30-Jul-2003  itojun use bounded string op
 1.18  08-Jul-2003  kristerw Const poisoning.
 1.17  30-May-2003  kristerw Fix some lint warnings.
 1.16  30-May-2003  kristerw Remove stuff that are not needed any longer.
 1.15  30-May-2003  kristerw Simplify handling of memory allocation, and make sure all return values
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...)
 1.14  29-May-2003  kristerw Be consistent with use of types (e.g. do not use LINENUM for quantities
that are not line numbers).
 1.13  19-Jan-2003  kristerw Do not try to write a rejects file for those cases where the user has
told us to skip a patch due to missing file to patch.

Solves PR 19827 from Toru TAKAMIZU.
 1.12  16-Mar-2002  kristerw branches: 1.12.2;
Check result of malloc and strdup
Made some functions static
Removed unneccessary buffer
Increased size of some buffers that could overflow
 1.11  11-Mar-2002  kristerw Ansify
Remove unused defines
Remove #ifndef lint
Remove redundant and incorrect casts.
 1.10  08-Mar-2002  kristerw Ansify
Remove 'register'
Make local functions static.
Remove most '#ifndef lint'
 1.9  06-Mar-2002  ragge License change; patch.c now has a BSD license.
From Larry Wall via Niklas Hallqvist, <niklas@appli.se>.
 1.8  16-Oct-2000  kleink Support the 1003.2-92 -i option to specify a patchfile;
fixes PR standards/11221.
 1.7  06-Nov-1998  christos branches: 1.7.10;
char -> unsigned char
rindex -> strrchr
 1.6  22-Feb-1998  christos WARNSify
 1.5  22-Mar-1997  lukem use mkstemp() instead of mktemp() to create the tempfile
 1.4  19-Sep-1996  thorpej RCS id police.
 1.3  19-Sep-1996  thorpej Decode long (GNU-style) options. Changes originally from Niklas Hallqvist,
but modified some by me.
 1.2  02-Aug-1993  mycroft Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.1  09-Apr-1993  cgd branches: 1.1.1;
patch 2.0.12u8, from prep.ai.mit.edu. this is not under the GPL.
 1.1.1.1  09-Jan-1997  tls Import from 4.4BSD-Lite2
 1.7.10.1  03-Feb-2001  he Pull up revision 1.8 (requested by kleink):
Support the 1003.2-92 -i option. Fixes PR#11221.
 1.12.2.1  26-Jan-2003  jmc Pullup revisions 1.12-1.13 (requested by kristerw in ticket #1108)
Do not try to write a rejects file for those cases where the user has
told us to skip a patch due to missing file to patch.
 1.24.12.1  06-Nov-2007  matt sync with HEAD
 1.25.8.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.27.4.1  20-May-2011  bouyer Pull up following revision(s) (requested by dholland in ticket #1614):
usr.bin/patch/patch.c: revision 1.28
Exit with EXIT_FAILURE for invalid arguments. PR 43517.
 1.29.44.1  26-Feb-2021  martin Pull up following revision(s) (requested by nia in ticket #1215):

usr.bin/patch/backupfile.c: revision 1.16
usr.bin/patch/backupfile.h: revision 1.7
usr.bin/patch/patch.c: revision 1.30

patch: make '-V none' work in the expected way

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?
 1.29.34.1  26-Feb-2021  martin Pull up following revision(s) (requested by nia in ticket #1660):

usr.bin/patch/backupfile.c: revision 1.16
usr.bin/patch/backupfile.h: revision 1.7
usr.bin/patch/patch.c: revision 1.30

patch: make '-V none' work in the expected way

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?
 1.31.2.1  31-May-2021  cjep sync with head
 1.34.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed