Commit Graph

22 Commits

Author SHA1 Message Date
sepotvin
e89e15c13d Change the internal buffer used to store input lines from a static buffer
to a dynamically allocated one in order to support input lines of
arbitrary length.

Approved by:	kan (mentor)
MFC after:	1 month
2009-05-08 02:18:46 +00:00
kris
cf195c5ed6 Prevent stack-smashing buffer overflows in -D and -r options by using
buffer-safe string functions.  The rest of the code is still probably
unsafe.

MFC after:	1 week
2002-10-13 01:18:33 +00:00
gad
b200c6709f Add many prototypes and ANSI-ize 'patch. Not a complete job of it, but it gets
our patch to look a little more like NetBSD's, and has the nice characteristic
that the object code is exactly the same after the change as before it (even in
patch.c and pch.c, which have pesky 'assert' statements in them).

Reviewed by:	/sbin/md5 on i386, alpha, sparc64
MFC after:	3 days
2002-04-28 01:33:45 +00:00
mike
d3aa0af1fe Add -i option (SUSv3) to patch(1). This allows one to specify a
patch file on command line instead of stdin.

Submitted by:	Joseph Mallett <jmallett@xMach.org>
MFC after:	1 month
2002-02-08 02:05:32 +00:00
kbyanc
9e62d03623 Fix previous commit such that only -S/--skip ignores errors when applying
a patch, returning -f/--force and -t/--batch to their previous semantics.

Pointed out by:	asami
2000-08-02 22:31:34 +00:00
kbyanc
76931d16a9 Fix patch such that skipping files does not count as a failure.
Previously, using -S/--skip, -f/--force, or -t/--batch to skip a patch in
a patchset still registers a failure which causes patch to return a
non-zero exit code. This is particularly undesirable with regards to
ports as there is no way to ignore the non-zero code. (Luckily, we don't
currently have any ports that make use of any of these options.)

The PR (yes, my own) is slightly incorrect: It states that -f does indeed
properly skip patches. It does, but it still sets the failure flag causing
patch to return non-zero.

PR:		19638
Submitted by:	kbyanc@posi.net
2000-08-02 06:54:21 +00:00
peter
605340bddb Clean up some $Log$ debris, including some real messes. 1999-09-05 17:31:55 +00:00
peter
c81dbb3c98 $Header$ -> $FreeBSD$ 1999-08-28 05:11:36 +00:00
ache
2d8b453009 Add PATCH_INDEX_FIRST environment variable to do the same as -I option 1998-01-22 07:44:04 +00:00
ache
cbe4653fb0 Update usage line with new option 1998-01-21 15:15:39 +00:00
ache
3fb81ed571 Add -I or --index-first option to take Index: precedence over context diff,
as it was in hacked FreeBSD version
1998-01-21 15:10:14 +00:00
ache
bcf27ec126 Resurrect patch 2.1 without FreeBSD Index: hack 1998-01-21 14:37:27 +00:00
ache
0c8025c02b Upgrade to 2.5 (contrib version) 1998-01-04 21:41:46 +00:00
ache
11e6b28c31 Add (unsigned char) cast to ctype macros 1997-10-23 02:44:23 +00:00
jmg
5a9515e418 fix compilation warnings in patch... (with slight modification)
also remove -Wall that I acidentally committed last time I was here...

Submitted-by: Philippe Charnier

Closes PR#2998
1997-03-17 01:44:43 +00:00
jmg
fddb79c0af Fix a problem with patch in that is will always default, even when the
controlling terminal is closed.  Now the function ask() will return 1 when th
input is known to come from a file or terminal, or it will return 0 when ther
was a read error.

Modified the question "Skip patch?" so that on an error from ask it will skip
the patch instead of looping.

Closes PR#777

2.2 candidate
1997-02-13 21:10:45 +00:00
rgrimes
2ad6f3dee6 Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
hsu
b5ccaa010d Fix bug that created new files even when running in -C check mode.
Reviewed by: phk
1995-01-12 22:09:40 +00:00
phk
17a5179b1d added the -C/-check again. 1994-02-25 21:46:07 +00:00
jkh
6a471bf87c Put this back - I was somehow under the erroneous impression that patch was in
ports, until I saw the the commit messages, that is! :-)  All changed backed out.
1994-02-17 22:20:36 +00:00
jkh
98554d2175 From Poul-Henning Kamp - Implement a -C option to verify the integrity of
a patch before actually applying it.
1994-02-17 22:16:05 +00:00
paul
146bcedccd b-maked patch-2.10 1993-06-19 14:21:53 +00:00