OpenBSD CVS

CVS log for src/usr.bin/patch/patch.c


[BACK] Up to [local] / src / usr.bin / patch

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.76 / (download) - annotate - [select for diffs], Fri Mar 22 19:22:23 2024 UTC (8 weeks, 1 day ago) by jcs
Branch: MAIN
CVS Tags: HEAD
Changes since 1.75: +7 -4 lines
Diff to previous 1.75 (colored)

add "-V none" to prevent making any backups

from FreeBSD

ok bluhm deraadt

Revision 1.74.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 17:56:22 2023 UTC (5 months, 4 weeks ago) by bluhm
Branch: OPENBSD_7_4
Changes since 1.74: +19 -6 lines
Diff to previous 1.74 (colored) next main 1.75 (colored)

Fix unveil(2) in patch(1) with explicit patchfile.

A backup file should be created in the directory of the original
file, but only the current directory was unveiled.  Then the patched
file was created in /tmp and did not replace the original patchfile
in place.  If a patchfile is passed in argv[0], unveil its directory
instead of current directory.

OK florian@ deraadt@ millert@

this is errata/7.4/003_patch.patch.sig

Revision 1.75 / (download) - annotate - [select for diffs], Wed Oct 25 20:05:43 2023 UTC (6 months, 3 weeks ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.74: +19 -6 lines
Diff to previous 1.74 (colored)

Fix unveil(2) in patch(1) with explicit patchfile.

A backup file should be created in the directory of the original
file, but only the current directory was unveiled.  Then the patched
file was created in /tmp and did not replace the original patchfile
in place.  If a patchfile is passed in argv[0], unveil its directory
instead of current directory.

OK florian@ deraadt@ millert@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jul 19 13:26:20 2023 UTC (10 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE
Branch point for: OPENBSD_7_4
Changes since 1.73: +6 -1 lines
Diff to previous 1.73 (colored)

Partially fix interactive mode in patch

If ask() can't open /dev/tty for reading, it assumes the default answer
and carries on. Add missing unveil, so that ask() waits for an answer.
This isn't a full fix since it won't allow giving paths outside the tree
rooted at the current directory, but that's expected by the recent change.
Questions are only asked outside of force or batch mode.

fix suggested by op and semarie
ok deraadt florian

Revision 1.73 / (download) - annotate - [select for diffs], Sat Jul 15 10:42:54 2023 UTC (10 months ago) by florian
Branch: MAIN
Changes since 1.72: +34 -2 lines
Diff to previous 1.72 (colored)

Prevent patch(1) from scribbling all over the place.

Arguably the only sensible use of patch(1) is changing files in the
current working directory and subdirectories.

However, patch(1) has this anti-feature, or dare I say bug, where it
will happily follow "../" upwards and outside of the current working
directory to find files to change. All it takes is a line like
+++ ../../../../home/florian/.ssh/authorized_keys
in the patchfile.

patch(1) operates on untrusted input and it already pledge(2)'ed to
not execute arbitrary programs, but of course it needs to write
files.

A simple unveil(".", "rwc") restricts patch(1) to its current working
directory.

We also need to allow /tmp and potentially the output file and reject
file if given on the command line. But those paths are safe.

input op, deraadt
OK millert, sthen

Revision 1.72 / (download) - annotate - [select for diffs], Wed Jul 12 11:26:13 2023 UTC (10 months, 1 week ago) by tb
Branch: MAIN
Changes since 1.71: +4 -4 lines
Diff to previous 1.71 (colored)

Use ssize_t instead of short for line lengths

sthen hit a binary patch containing a 'line' of length > 32kB. This made
the short used for storing the line length wrap and resulted in a buffer
underflow and segfault.  This uses a larger type, which doesn't actually
fix the problem, but makes it much less likely to be hit.

ok florian otto sthen

Revision 1.71 / (download) - annotate - [select for diffs], Wed Aug 3 07:30:37 2022 UTC (21 months, 2 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

fix locate_hunk in empty files

if `first_guess' is zero then main() assumes that locate_hunk has failed
and aborts the patch operation.  Instead, make sure to return 1 (the
line number) so that the patch operation can continue.

Issue originally found by Neels Hofmeyr in the regress suite of the diff
implementation for got, where the tests assume that applying a diff with
`patch' and then again with `patch -R' yields back the original file.

ok stsp@

Revision 1.70 / (download) - annotate - [select for diffs], Wed Aug 3 07:25:44 2022 UTC (21 months, 2 weeks ago) by op
Branch: MAIN
Changes since 1.69: +7 -2 lines
Diff to previous 1.69 (colored)

fix dwim for reversed patches

patch(1) fails to recognize the reversal application of a patch that
cerates a file.  since an empty context always matches, the idea is to
run the dwim ("do what I mean") code also when locate_hunk succeeds but
the patch would create a file and the match is on the first line.
fixes the (disabled) test t3.

ok stsp@

Revision 1.69 / (download) - annotate - [select for diffs], Mon Dec 2 22:17:32 2019 UTC (4 years, 5 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.68: +8 -2 lines
Diff to previous 1.68 (colored)

Use getline(3) to handle lines longer than 8192 bytes in patch files

Spotted by jsg@ when working on mesa.  Diff tested by sthen@ in
a partial i386 bulk.  Input from and ok jsg@ millert@

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:02 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jun 28 05:35:35 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.66: +5 -5 lines
Diff to previous 1.66 (colored)

mkstemp() returns -1 on failure

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jun 22 15:37:15 2018 UTC (5 years, 10 months ago) by zhuk
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (colored)

Add --dry-run as synonym to -C/--check.

FreeBSD and NetBSD has this for a while, and GNU patch got it even earlier
than we got -C.

input from sthen@ & jca@; okay sthen@, jca@ and deraadt@.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Apr 7 14:55:13 2018 UTC (6 years, 1 month ago) by anton
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

Remove unused pathnames.h header since patch was refactoring into not invoking
ed back in 2015; ok millert@ tb@ tobias@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Jun 12 14:23:26 2017 UTC (6 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

rejname[] is also -r option buffer, and should be PATH_MAX
ok millert

Revision 1.63 / (download) - annotate - [select for diffs], Mon Jan 4 14:09:46 2016 UTC (8 years, 4 months ago) by gsoares
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

usage() should exit 2 here, not EXIT_SUCCESS
ok tb@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Dec 29 19:04:46 2015 UTC (8 years, 4 months ago) by gsoares
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

fix exit status on pledge(2) failure.

OK tb@ jsg@

Revision 1.61 / (download) - annotate - [select for diffs], Wed Nov 11 02:52:46 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.60: +4 -2 lines
Diff to previous 1.60 (colored)

exit() after perror() for pledge failure.  Perhaps this got introduced
as a test idiom, either when pledge was young or during the transition
to strings.... dunno

Revision 1.60 / (download) - annotate - [select for diffs], Fri Oct 16 07:33:47 2015 UTC (8 years, 7 months ago) by tobias
Branch: MAIN
Changes since 1.59: +9 -7 lines
Diff to previous 1.59 (colored)

Add native support for ed-style diffs. No need to pledge "proc exec" anymore.

ok deraadt

Revision 1.59 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:08 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.58 / (download) - annotate - [select for diffs], Wed Oct 7 06:29:26 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

patch(1) can move to "stdio rpath wpath cpath tmppath fattr proc exec"
(adding proc exec), now that "exec" has arrived in the kernel.  This
permits the dangerous game of feeding ed-style diffs with popen() via
/bin/ed.  Shocked yet?  Your mission, should you choose to accept it,
is to replace this code with an builtin ed-style patcher, maybe cribbing
code from ed itself.

I'm sorry, but we can't fix the entire world all at once.  Noone loves
deprecating standarized features as much as we do, but there are some
lines.  Maybe if people become aware of how crappy the implimentations
of some standard features are, they could help decide the path.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Oct 4 18:11:22 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

remove tame "proc".  it is not useful, because the "ed" diffs require
fork+execve, and execve is not going to become available in this fashion.
ed diffs should be handled using a built-in handler, and various folks
have been discussing this behind the scenes.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Oct 3 13:49:51 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

As pointed out by tobiasu, ed-style patches still use popen() and execute
/bin/ed.  This is RETARDED.  Nothing learned from the last year?

Add tame "proc" until that is fixed, to allow fork+exec.

I beg for someone to cross-link the guts of ed directly into patch, or
write a ed-subset which can do the job.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Oct 3 02:35:56 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.54: +4 -1 lines
Diff to previous 1.54 (colored)

patch appears to work fully with tame "stdio rpath wpath cpath tmppath fattr".
in case of exploitation, no more network access, fork, execve, etc.
I wonder if we could use whitepath lists here - if it is reasonable to
limit operation in directories known early on?

Revision 1.54 / (download) - annotate - [select for diffs], Sat Dec 13 10:31:07 2014 UTC (9 years, 5 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.53: +8 -8 lines
Diff to previous 1.53 (colored)

The function savestr allows NULL return values during Plan A patching so in
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).

Revision 1.53 / (download) - annotate - [select for diffs], Mon Dec 8 21:59:36 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

spaces

Revision 1.52 / (download) - annotate - [select for diffs], Wed Nov 26 18:34:51 2014 UTC (9 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)

Prefer setvbuf() to setlinebuf() for portability; ok deraadt@

Revision 1.51 / (download) - annotate - [select for diffs], Tue Nov 26 13:19:07 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.50: +7 -7 lines
Diff to previous 1.50 (colored)

unsigned char casts for ctype
ok krw

Revision 1.50 / (download) - annotate - [select for diffs], Tue May 15 19:32:02 2012 UTC (12 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.49: +7 -8 lines
Diff to previous 1.49 (colored)

Fix confusing patch(1) output on failure when using -C.  From
dragonflybsd via Loganaden Velvindron.  OK mikeb@ and deraadt@

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jul 24 01:10:12 2010 UTC (13 years, 9 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.48: +3 -5 lines
Diff to previous 1.48 (colored)

Send normal output to stdout instead of everything to stderr. This
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

Revision 1.48 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:41 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.47: +1 -5 lines
Diff to previous 1.47 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
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

Revision 1.47 / (download) - annotate - [select for diffs], Sun Apr 5 13:36:00 2009 UTC (15 years, 1 month ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.46: +10 -2 lines
Diff to previous 1.46 (colored)

If no patch can be found in input, in addition to complaining on stderr,
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@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Aug 20 18:28:46 2008 UTC (15 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.45: +3 -9 lines
Diff to previous 1.45 (colored)

The code to detect multiple applied diffs to empty files I introduced 4
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@

Revision 1.45 / (download) - annotate - [select for diffs], Wed Apr 18 21:52:24 2007 UTC (17 years, 1 month ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.44: +6 -5 lines
Diff to previous 1.44 (colored)

adds a detailed synopsis to the man page; sorts options in
the description list and adds missing arguments; syncs usage()

written with a lot of useful advice by jmc@

ok by jmc@

Revision 1.44 / (download) - annotate - [select for diffs], Sat Mar 11 19:41:30 2006 UTC (18 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

type police and assorted cleanup. From Lionel Fourquaux; ok ray@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Nov 19 20:08:11 2004 UTC (19 years, 6 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.42: +84 -4 lines
Diff to previous 1.42 (colored)

Write reject file in unified format if the original diff was in
unified format.
ok deraadt@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Sep 14 23:54:21 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.41: +3 -4 lines
Diff to previous 1.41 (colored)

remove unused variable

Revision 1.41 / (download) - annotate - [select for diffs], Fri Jul 9 19:13:46 2004 UTC (19 years, 10 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.40: +17 -2 lines
Diff to previous 1.40 (colored)

Properly detect if a patch already has been applied, even if there
are no eols at eofs involved. Tested by quite some people.

ok deraadt@

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jun 18 17:52:25 2004 UTC (19 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.39: +9 -4 lines
Diff to previous 1.39 (colored)

Unbreak handling of standard diffs (which have an empty context).

ok @millert

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jun 14 18:26:33 2004 UTC (19 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.38: +5 -5 lines
Diff to previous 1.38 (colored)

Teach patch(1) to detect if a diff creating a file (or one adding
lines to an empty file) already has been applied; be a bit less
chatty about empty contexts. Testing hshoexer@ ok millert@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Oct 31 20:20:45 2003 UTC (20 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.37: +12 -9 lines
Diff to previous 1.37 (colored)

o fairly major man page reorganization
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@

Revision 1.37 / (download) - annotate - [select for diffs], Sun Aug 10 21:28:48 2003 UTC (20 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.36: +24 -15 lines
Diff to previous 1.36 (colored)

Do not add an extra newline at the end if the last line of the input
file contains no newline and the diff does not touch the last line.
Contributions from millert@.

ok millert@ tedu@

Revision 1.36 / (download) - annotate - [select for diffs], Sun Aug 10 18:39:43 2003 UTC (20 years, 9 months ago) by otto
Branch: MAIN
Changes since 1.35: +10 -3 lines
Diff to previous 1.35 (colored)

Warn if the diff is a context or unified diff and the context
is empty. In this case, a previously applied patch cannot be detected.

ok millert@ tedu@

Revision 1.35 / (download) - annotate - [select for diffs], Fri Aug 1 20:30:48 2003 UTC (20 years, 9 months ago) by otto
Branch: MAIN
Changes since 1.34: +58 -59 lines
Diff to previous 1.34 (colored)

- use stdbool.h instead of roll-your-own booleans
- 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@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jul 31 21:07:35 2003 UTC (20 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.33: +6 -6 lines
Diff to previous 1.33 (colored)

Historically, patch would treat a bare -p as -p0.  This contradicts
POSIX and GNU patch has also removed this, so we will too.  No
objections on icb (no one even seemed to know about this "feature").

Revision 1.33 / (download) - annotate - [select for diffs], Thu Jul 31 14:10:21 2003 UTC (20 years, 9 months ago) by otto
Branch: MAIN
Changes since 1.32: +4 -2 lines
Diff to previous 1.32 (colored)

Print a maximum of one invalid line number warning per patch in a patch file.
Thanks to espie@ for spotting the problem.

ok millert@ henning@ espie@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Jul 30 16:45:44 2003 UTC (20 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.31: +19 -9 lines
Diff to previous 1.31 (colored)

Add POSIX -i option; tedu@ OK

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jul 29 20:10:17 2003 UTC (20 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.30: +23 -20 lines
Diff to previous 1.30 (colored)

o add pathnames.h
o ignore empty TMPDIR environment variable
o strip any trailing slashes from TMPDIR
otto@ OK

Revision 1.30 / (download) - annotate - [select for diffs], Mon Jul 28 19:15:34 2003 UTC (20 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +8 -8 lines
Diff to previous 1.29 (colored)

minor knf and cleanups; otto ok

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jul 28 18:28:52 2003 UTC (20 years, 9 months ago) by otto
Branch: MAIN
Changes since 1.28: +114 -59 lines
Diff to previous 1.28 (colored)

Be more exact on how backup files are handled.
ok millert@ tedu@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jul 28 16:13:53 2003 UTC (20 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.27: +7 -9 lines
Diff to previous 1.27 (colored)

Make patch(1) exit value match POSIX and be consistent with diff.
Comments and OK from otto@

Revision 1.27 / (download) - annotate - [select for diffs], Fri Jul 25 02:12:45 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.26: +28 -10 lines
Diff to previous 1.26 (colored)

Add POSIX -b option but don't change the default beahvior wrt backups
yet.  The old -b option is now -z (matches GNU patch).

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jul 23 07:31:21 2003 UTC (20 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.25: +16 -7 lines
Diff to previous 1.25 (colored)

New version of invalid line number fix. Passes patch(1) regressions.

ok millert@ deraadt@

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jul 22 20:48:58 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.24: +8 -3 lines
Diff to previous 1.24 (colored)

Make rejname[] static to patch.c and crank its size to NAME_MAX+1

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jul 22 20:17:06 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.23: +141 -204 lines
Diff to previous 1.23 (colored)

Use getopt_long() to parse options instead of rolling our own.
OK deraadt@ and otto@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Jul 22 17:18:49 2003 UTC (20 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.22: +66 -73 lines
Diff to previous 1.22 (colored)

More cleanup.
ok millert@ tedu@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jul 21 21:01:45 2003 UTC (20 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.21: +3 -8 lines
Diff to previous 1.21 (colored)

Back out invalid line number fix. It core dumps in some cases. Problem found by
marc@.
ok henning@

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jul 21 14:32:21 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

fix header

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 21 14:00:41 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.19: +753 -787 lines
Diff to previous 1.19 (colored)

knf and other cleanup; ok otto

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jul 18 02:00:09 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.18: +126 -144 lines
Diff to previous 1.18 (colored)

remove junk; ok otto tedu

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jul 16 16:06:53 2003 UTC (20 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.17: +8 -3 lines
Diff to previous 1.17 (colored)

Do not produce garbage if the patch file contains invalid line numbers.
ok millert@ tedu@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jul 2 00:21:16 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
Changes since 1.16: +6 -6 lines
Diff to previous 1.16 (colored)

bump randomness of mktemp to from 6 to 10 X's, as recommended by mktemp(3)

Revision 1.16 / (download) - annotate - [select for diffs], Sat Apr 5 17:17:53 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.15: +6 -20 lines
Diff to previous 1.15 (colored)

string fixes; ok miod henning

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jul 4 04:22:48 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.14: +10 -2 lines
Diff to previous 1.14 (colored)

4 unchecked mallocs; cloder@acm.org

Revision 1.14 / (download) - annotate - [select for diffs], Tue Mar 5 08:56:55 2002 UTC (22 years, 2 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.13: +19 -4 lines
Diff to previous 1.13 (colored)

patch(1) is now free, thanks Larry!

Revision 1.13 / (download) - annotate - [select for diffs], Sat Dec 4 01:01:06 1999 UTC (24 years, 5 months ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.12: +9 -5 lines
Diff to previous 1.12 (colored)

avoid overflows

Revision 1.12 / (download) - annotate - [select for diffs], Tue Aug 31 21:29:19 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.11: +6 -2 lines
Diff to previous 1.11 (colored)

patch file should hold at least one patch, otherwise we're entitled to
a diagnostic.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Nov 25 00:30:26 1998 UTC (25 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.10: +27 -16 lines
Diff to previous 1.10 (colored)

add -C

Revision 1.10 / (download) - annotate - [select for diffs], Mon Sep 22 05:45:27 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.9: +7 -2 lines
Diff to previous 1.9 (colored)

Start of -Wall and cleaning up icky bits.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jan 17 07:13:04 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

r?index -> strr?chr

Revision 1.8 / (download) - annotate - [select for diffs], Tue Sep 24 04:19:28 1996 UTC (27 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.7: +9 -9 lines
Diff to previous 1.7 (colored)

sprintf -> snprintf except where guaranteed safe.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Sep 24 02:58:52 1996 UTC (27 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.6: +14 -6 lines
Diff to previous 1.6 (colored)

Use mkstemp().  Since temp files get re-used we use mkstemp() to make
us a "place holder" (and discard the fd) to protect from DOS attacks
and then just re-use that.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Sep 23 10:54:21 1996 UTC (27 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +4 -8 lines
Diff to previous 1.5 (colored)

undo last; mkstemp is *hard* to do in here

Revision 1.5 / (download) - annotate - [select for diffs], Sun Sep 15 19:19:54 1996 UTC (27 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.4: +10 -6 lines
Diff to previous 1.4 (colored)

Be slightly safer opening temp files.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jul 1 20:40:09 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +4 -14 lines
Diff to previous 1.3 (colored)

undo mktemp cleanup until i get it right

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jun 25 23:06:39 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +16 -6 lines
Diff to previous 1.2 (colored)

mktemp w/ open & fdopen

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jun 10 11:21:31 1996 UTC (27 years, 11 months ago) by niklas
Branch: MAIN
Changes since 1.1: +79 -5 lines
Diff to previous 1.1 (colored)

Support the long options that FSF's patch version has.  $OpenBSD$ added

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:55 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:55 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.