summaryrefslogtreecommitdiff
path: root/usr.bin/patch/pch.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/patch/pch.c')
-rw-r--r--usr.bin/patch/pch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
index 55c6e725a47..bfdb1763010 100644
--- a/usr.bin/patch/pch.c
+++ b/usr.bin/patch/pch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pch.c,v 1.33 2004/01/28 08:31:07 otto Exp $ */
+/* $OpenBSD: pch.c,v 1.34 2004/07/09 19:13:46 otto Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -27,7 +27,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: pch.c,v 1.33 2004/01/28 08:31:07 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pch.c,v 1.34 2004/07/09 19:13:46 otto Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -967,6 +967,12 @@ hunk_done:
p_end = fillsrc - 1;
return false;
}
+ if (fillsrc > p_ptrn_lines) {
+ if (remove_special_line()) {
+ p_len[fillsrc - 1] -= 1;
+ s[p_len[fillsrc - 1]] = 0;
+ }
+ }
/* FALL THROUGH */
case '+':
if (filldst > p_end) {