summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2003-07-03 00:19:21 +0000
committerAndreas Gruenbacher <agruen@suse.de>2009-03-19 01:43:38 +0100
commitbffe53a2a0f29c279a7c676c8895a3cde07314ca (patch)
tree98698152dac1fca665ef6aaa4aa311b05515f5a7
parentd24c6784f6a09c10f1f6f65a43bca9b91008d62d (diff)
downloadpatch-bffe53a2a0f29c279a7c676c8895a3cde07314ca.tar.gz
(intuit_diff_type): If a unified-diff header line contains trailing CR, strip CR from each body line. This corrects a bug introduced in the 2003-05-18 patch. Bug reported by Andreas Gruenbacher.
-rw-r--r--pch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pch.c b/pch.c
index d98af86..634c45d 100644
--- a/pch.c
+++ b/pch.c
@@ -1,6 +1,6 @@
/* reading patches */
-/* $Id: pch.c,v 1.44 2003/05/20 14:03:17 eggert Exp $ */
+/* $Id: pch.c,v 1.45 2003/07/02 22:19:21 eggert Exp $ */
/* Copyright (C) 1986, 1987, 1988 Larry Wall
@@ -366,10 +366,16 @@ intuit_diff_type (void)
if (!stars_last_line && strnEQ(s, "*** ", 4))
name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
else if (strnEQ(s, "+++ ", 4))
+ {
/* Swap with NEW below. */
name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
+ p_strip_trailing_cr = strip_trailing_cr;
+ }
else if (strnEQ(s, "Index:", 6))
+ {
name[INDEX] = fetchname (s+6, strippath, (time_t *) 0);
+ p_strip_trailing_cr = strip_trailing_cr;
+ }
else if (strnEQ(s, "Prereq:", 7)) {
for (t = s + 7; ISSPACE ((unsigned char) *t); t++)
continue;
@@ -409,6 +415,7 @@ intuit_diff_type (void)
p_timestamp[NEW] = timestamp;
p_rfc934_nesting = (t - s) >> 1;
}
+ p_strip_trailing_cr = strip_trailing_cr;
}
}
if ((diff_type == NO_DIFF || diff_type == ED_DIFF) &&