Re: [PATCH v4 4/6] send-email: create email parser subroutine
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 8, 2016, 20:17 UTC
- Message-ID
- <xmqqy46fjuzm.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAPig+cQ5OKFTA8pEge=0e2RMT3ghmat-szw73aO_3WVW1=eAFQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 6 quoted lines
> An embedded CR probably shouldn't happen, but I'm not convinced that > folding it out is a good idea. I would think that you'd want to > preserve the header's value verbatim. If anything, I'd expect to see > the regex tightened to: > > s/\r?\n$//;
Yes, that would be more sensible than silently removing \r in the middle which _is_ a sign of something funny going on.
> Alternately, consider using 'chop' or 'chomp'.
Even if you use chomp(), you'd still need to worry about possible \r at the end, no?