summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/patch
diff options
context:
space:
mode:
authorkbyanc <kbyanc@FreeBSD.org>2000-08-02 06:54:21 +0000
committerkbyanc <kbyanc@FreeBSD.org>2000-08-02 06:54:21 +0000
commit76931d16a9fd1409f3fa0425d39bbc3387a45c2a (patch)
tree122f8e9d8e56fe2d9044e52f604d5f9c6e24dbe2 /gnu/usr.bin/patch
parenta493e558f76a40e47fcaa027e90284ee058cae15 (diff)
downloadFreeBSD-src-76931d16a9fd1409f3fa0425d39bbc3387a45c2a.zip
FreeBSD-src-76931d16a9fd1409f3fa0425d39bbc3387a45c2a.tar.gz
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
Diffstat (limited to 'gnu/usr.bin/patch')
-rw-r--r--gnu/usr.bin/patch/patch.c1
-rw-r--r--gnu/usr.bin/patch/pch.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/gnu/usr.bin/patch/patch.c b/gnu/usr.bin/patch/patch.c
index 0e37ddb..0a32fa7 100644
--- a/gnu/usr.bin/patch/patch.c
+++ b/gnu/usr.bin/patch/patch.c
@@ -313,7 +313,6 @@ char **argv;
newwhere = pch_newfirst() + last_offset;
if (skip_rest_of_patch) {
abort_hunk();
- failed++;
if (verbose)
say3("Hunk #%d ignored at %ld.\n", hunk, newwhere);
}
diff --git a/gnu/usr.bin/patch/pch.c b/gnu/usr.bin/patch/pch.c
index 6acf595..71bbd25 100644
--- a/gnu/usr.bin/patch/pch.c
+++ b/gnu/usr.bin/patch/pch.c
@@ -174,7 +174,7 @@ there_is_another_patch()
say3("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s");
skip_to(p_start,p_sline);
while (filearg[0] == Nullch) {
- if (force || batch) {
+ if (force || batch || skip_rest_of_patch) {
say1("No file to patch. Skipping...\n");
filearg[0] = savestr(bestguess);
skip_rest_of_patch = TRUE;
OpenPOWER on IntegriCloud