summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/patch/pch.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove our hacked GNU patch.pfg2013-09-031-1449/+0
| | | | | | | | | | | The old (2.1) GNU patch has outlived its days. The major local changes have been moved into the less restrictedly licensed patch(1) we adopted in usr.bin/ . A much newer version of GNU patch is available in the ports tree (devel/patch). Disconnect from the build and remove.
* Properly handle input lines containing NUL characters such that pgets()obrien2013-07-021-1/+1
| | | | | | | accurately fills the read buffer. Callers of pgets() still mis-process the buffer contents if the read line contains NUL characters, but this at least makes pgets() accurate.
* Make it so that 'patch < FUBAR' and 'patch -i FUBAR' operate the same.obrien2013-07-021-2/+7
| | | | | | | The former makes a copy of stdin, but was not accurately putting the content of stdin into a temp file. This lead to the undercounting the number of lines in hunks containing NUL characters when reading from stdin. Thus resulting in "unexpected end of file in patch" errors.
* The buffer returned by fgenln is not a "C" string and might not be NULsepotvin2009-09-161-1/+2
| | | | | | | terminated. Make sure that it is before using it. Reviewed by: marck@ MFC after: 3 days
* Add support for diffs generated by Perforce.ed2009-08-231-0/+24
| | | | | It basically picks the filenames from the "====" line and strips off the # revision number.
* Change the internal buffer used to store input lines from a static buffersepotvin2009-05-081-41/+56
| | | | | | | | to a dynamically allocated one in order to support input lines of arbitrary length. Approved by: kan (mentor) MFC after: 1 month
* Change parts of the source code to make it closer to style(9), mainlygad2002-05-211-466/+489
| | | | | | | | | | changing indentation and some comments. Main goal is not perfect style, but just to reduce differences with NetBSD. The object code is exactly the same after this change as before it (except for assert() statements which have moved). Reviewed by: /sbin/md5 on i386 Obtained from: NetBSD
* Add many prototypes and ANSI-ize 'patch. Not a complete job of it, but it getsgad2002-04-281-69/+77
| | | | | | | | | 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
* Modify our 'patch' utility to recognize thegad2002-04-261-0/+64
| | | | | | | | | | | | | | | | | \ No newline at end of file line that some versions of diff print out if the last line of the two files are different, and one of the two files does not have a newline character on that last line. This change is still somewhat under discussion in -arch and -standards, but I want to commit it to -current today so I'd have the chance to MFC it to -stable before the code freeze for 4.6-release (which would be May 1st). Note: the related change to 'diff' (so it might *generate* that line) is NOT expected to be included in 4.6-release. We can debate that change later. Obtained from: NetBSD (1.13 of basesrc/usr.bin/patch/pch.c, by kristerw) MFC after: 4 days
* Fix patch such that skipping files does not count as a failure.kbyanc2000-08-021-1/+1
| | | | | | | | | | | | | | | 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
* Clean up some $Log$ debris, including some real messes.peter1999-09-051-109/+0
|
* $Header$ -> $FreeBSD$peter1999-08-281-1/+9
|
* Add -I or --index-first option to take Index: precedence over context diff,ache1998-01-211-2/+11
| | | | as it was in hacked FreeBSD version
* Resurrect patch 2.1 without FreeBSD Index: hackache1998-01-211-0/+1401
|
* Upgrade to 2.5 (contrib version)ache1998-01-041-1381/+0
|
* Back out Index over +++/--- precedence.ache1998-01-031-5/+10
| | | | | | | It maybe right, if patch was FreeBSD-own program, but it break compatibility with pre-existent patches in other systems. The example is big ncurses patch which don't apply on FreeBSD due to "fixed" precedence.
* Add (unsigned char) cast to ctype macrosache1997-10-231-24/+50
|
* Fix a problem with patch in that is will always default, even when thejmg1997-02-131-5/+10
| | | | | | | | | | | | | 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
* Attempt to break a $Log$ snafu where a *** /--- (minus space)markm1996-04-121-1/+16
| | | | was fouling up a comment in the checked-out code.
* Priorities were broken. If there was an Index: line and ***/--- linesmarkm1996-04-111-4/+11
| | | | | | | | | | | | | | | with valid names, the ***/---names were taken first. this broke eg: Index: foo/Makefile ========== RCS <blah> Retrieving <blah> diff <blah> *** Makefile <blah> --- Makefile <blah> By trying to patch the Makefile in the _curent_ directory, rather than the one in the foo/ directory.
* Give "Index" specified filenames preference over other filenames specifiedgibbs1995-09-141-3/+6
| | | | | | | in the diff. This makes it so that diffs containing files in different subdirectories that have the same name not patch the same file. For example a diff with patches to Makefile, des/Makefile, usr.bin/Makefile would attempt to patch Makefile three times.
* Remove trailing whitespace.rgrimes1995-05-301-18/+21
|
* added the -C/-check again.phk1994-02-251-1/+6
|
* Put this back - I was somehow under the erroneous impression that patch was injkh1994-02-171-2/+5
| | | | ports, until I saw the the commit messages, that is! :-) All changed backed out.
* From Poul-Henning Kamp - Implement a -C option to verify the integrity ofjkh1994-02-171-2/+6
| | | | a patch before actually applying it.
* b-maked patch-2.10paul1993-06-191-0/+1305
OpenPOWER on IntegriCloud