From: Paul Eggert Subject: Re: patch2.5.9 fails on some dos generated patches Date: Thu, 05 May 2005 17:46:30 -0700 User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) This should fix your problem: 2003-07-02 Paul Eggert * pch.c (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. --- pch.c +++ pch.c @@ -366,10 +366,16 @@ 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 @@ 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) &&