aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/patch/util.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* patch(1): give /dev/null patches special treatmentKyle Evans2019-11-041-1/+3
| | | | | | | | | | | | | | | | We have a bad habit of duplicating contents of files that are sourced from /dev/null and applied more than once... take the more sane (in most ways) GNU route and complain if the file exists and offer reversal options. This still falls short a little bit as selecting "don't reverse, apply anyway" will still give you duplicated file contents. There's probably other issues as well, but awareness is the first step to happiness. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21535 Notes: svn path=/head/; revision=354328
* Remove automatic checkout feature.Xin LI2015-08-151-27/+1
| | | | | | | | | Obtained from: DragonFly via OpenBSD Relnotes: yes MFC: never Notes: svn path=/head/; revision=286795
* patch(1): small include changes.Pedro F. Giffuni2015-04-201-3/+3
| | | | | | | | | Mostly to match OpenBSD, no functional change. Obtained from: OpenBSD Notes: svn path=/head/; revision=281800
* Fixes to exit status.Pedro F. Giffuni2014-12-311-1/+1
| | | | | | | | | | | | | | Exit with EXIT_FAILURE for invalid arguments. Fixes NetBSD-PR 43517. Print version string to stdout instead of stderr; it is user-requested and not an error. Obtained from: NetBSD MFC after: 5 days Notes: svn path=/head/; revision=276472
* patch: Bring in xstrdup and use it when appropriate.Pedro F. Giffuni2014-12-251-0/+16
| | | | | | | | | | | | | | | 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). Clean up some whitespaces while here Obtained from: OpenBSD MFC after: 2 weeks Notes: svn path=/head/; revision=276218
* Improve bsdpatch usability:Xin LI2013-09-261-1/+1
| | | | | | | | | | | | | - Ask only once for "Apply anyway". [1] - Tell user what file have failed patch rather than just how many hunks failed. Reported by: jmg via pfg [1] Tested by: pfg [1] Approved by: re (gjb) Notes: svn path=/head/; revision=255894
* Fix file selection logic for the RCS/SCCS case, as was done for the simpleStefan Eßer2013-09-051-1/+1
| | | | | | | | | | file case before. Bump version because of the changed behavior, which now matches the documentation. Reviewed by: pfg Notes: svn path=/head/; revision=255232
* Revert r250972 to fix build.Glen Barber2013-05-251-1/+1
| | | | Notes: svn path=/head/; revision=250975
* The error handling for writes to the target file could lead to the finalStefan Eßer2013-05-241-1/+1
| | | | | | | | | | | | | fclose() being skipped. Fix this by using boolean "&" and "|" instead of short-cut operators "&&" and "||". While here, increment the last part of the version string. The reason is the fixed output file selection logic in pch.c, which was committed as r250943, yesterday. Reviewed by: pfg Notes: svn path=/head/; revision=250972
* patch: Follow original versioning convention.Pedro F. Giffuni2013-02-081-1/+1
| | | | | | | | | | | | According to the README file [1] the 12u variant, unlike the 12g variant, contains no copyleft code. It is therefore convenient to keep using the original versioning scheme to prevent confusions. [1] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/patch/README Notes: svn path=/head/; revision=246560
* - Refresh code with latest OpenBSD revisions.Xin LI2013-01-291-6/+4
| | | | | | | | | | | | - Remove $DragonFly$ tags as they are using git nowadays and VCS tags will not help merging. - Other changes to Copyright headers to make them consistent with other source code, we intend to fork from this point. Reviewed by: pfg Notes: svn path=/head/; revision=246091
* - Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) fromGabor Kovesdan2013-01-291-0/+434
| | | | | | | | | | | DragonflyBSD and install it as bsdpatch. WITH_BSD_PATCH makes it default and installs GNU patch as gnupatch. Submitted by: pfg Obtained from: The DragonflyBSD Project Notes: svn path=/head/; revision=246074
* kill the undeadPeter Wemm1997-07-131-339/+0
| | | | Notes: svn path=/head/; revision=27369
* Finish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,Bruce Evans1997-07-061-0/+339
pascal and vmstat.sparc. All changed files on the vendor branch should already have been imported. Notes: svn path=/vendor/CSRG/dist/; revision=27241