From: Alex Riesen Date: Wed, 05 Aug 2009 05:49:10 GMT Subject: Re: [PATCH 4/4] Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings Message-ID: <81b0412b0908042249g23f7487eo5bf1b9c9027024c@mail.gmail.com> In-Reply-To: On Wed, Aug 5, 2009 at 05:31, Brandon Casey wrote: > @@ -69,6 +70,12 @@ static int split_one(FILE *mbox, const char *name, int allow_bare) >         * "From " and having something that looks like a date format. >         */ >        for (;;) { > +               if (!keep_cr && buf.len > 1 && buf.buf[buf.len-1] == '\n' && > +                       buf.buf[buf.len-2] == '\r') { > +                       strbuf_setlen(&buf, buf.len-2); > +                       strbuf_addch(&buf, '\n'); > +               } > + That's much better then any on-the-fly corrections :)