summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2012-05-15 19:32:03 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2012-05-15 19:32:03 +0000
commitdf848c80b8e357e7d9e2801a198bb90553d2f53d (patch)
tree554a03880008ee60411068941ec1a2bd5278b3b5 /usr.bin
parenta3f417b2862beee74dcf374bf06c4cd7ea262212 (diff)
Fix confusing patch(1) output on failure when using -C. From
dragonflybsd via Loganaden Velvindron. OK mikeb@ and deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/patch/patch.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 19e41c42295..687ccc8b0f1 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.49 2010/07/24 01:10:12 ray Exp $ */
+/* $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -383,13 +383,12 @@ main(int argc, char *argv[])
sizeof(rejname)) >= sizeof(rejname))
fatal("filename %s is too long\n", outname);
}
- if (skip_rest_of_patch) {
- say("%d out of %d hunks ignored--saving rejects to %s\n",
- failed, hunk, rejname);
- } else {
- say("%d out of %d hunks failed--saving rejects to %s\n",
- failed, hunk, rejname);
- }
+ if (!check_only)
+ say("%d out of %d hunks %s--saving rejects to %s\n",
+ failed, hunk, skip_rest_of_patch ? "ignored" : "failed", rejname);
+ else
+ say("%d out of %d hunks %s\n",
+ failed, hunk, skip_rest_of_patch ? "ignored" : "failed");
if (!check_only && move_file(TMPREJNAME, rejname) < 0)
trejkeep = true;
}