summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/patch
diff options
context:
space:
mode:
authorkbyanc <kbyanc@FreeBSD.org>2000-08-02 22:31:34 +0000
committerkbyanc <kbyanc@FreeBSD.org>2000-08-02 22:31:34 +0000
commit9e62d03623e38eb0bc7c6dc76edace76b0adee57 (patch)
tree97c67321491964bd8bddffd8659ffa66ce9aa2d0 /gnu/usr.bin/patch
parentf3e89422d959b21ce9c3205b96cbe2ab21a27bcb (diff)
downloadFreeBSD-src-9e62d03623e38eb0bc7c6dc76edace76b0adee57.zip
FreeBSD-src-9e62d03623e38eb0bc7c6dc76edace76b0adee57.tar.gz
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
Diffstat (limited to 'gnu/usr.bin/patch')
-rw-r--r--gnu/usr.bin/patch/patch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gnu/usr.bin/patch/patch.c b/gnu/usr.bin/patch/patch.c
index 0a32fa7..0b49410 100644
--- a/gnu/usr.bin/patch/patch.c
+++ b/gnu/usr.bin/patch/patch.c
@@ -130,6 +130,9 @@ int check_patch = FALSE;
/* or PATCH_INDEX_FIRST env. variable is set */
int index_first;
+/* TRUE if -S was specified on command line. */
+int skip_flag_specified = FALSE;
+
/* Apply a set of diffs as appropriate. */
int
@@ -313,6 +316,8 @@ char **argv;
newwhere = pch_newfirst() + last_offset;
if (skip_rest_of_patch) {
abort_hunk();
+ if (! skip_flag_specified)
+ failed++;
if (verbose)
say3("Hunk #%d ignored at %ld.\n", hunk, newwhere);
}
@@ -437,6 +442,7 @@ reinitialize_almost_everything()
reverse = reverse_flag_specified;
skip_rest_of_patch = FALSE;
+ skip_flag_specified = FALSE;
get_some_switches();
@@ -567,6 +573,7 @@ get_some_switches()
break;
case 'S':
skip_rest_of_patch = TRUE;
+ skip_flag_specified = TRUE;
break;
case 't':
batch = TRUE;
OpenPOWER on IntegriCloud