Subject: | CHOMP_ONE doesn't handle CRLF properly |
Short version: If lines end in \r\n, chomping ends up with lines that
look like \r\r\n.
Long version:
We have PRE_CHOMP set. Normally our templates have just \n for newlines,
but sometimes (say, when people download them via CVS on Windows or save
them in a silly Windows editor) they have \r\n for newlines.
We have a template for generating emails. One part of it (in the
headers) looks like this (imagine all these lines end in \r\n):
X-Bugzilla-Watch-Reason: [% reasonswatchheader %]
[%~ IF Param('useclassification') %]
X-Bugzilla-Classification: [% classification %]
[% END %]
X-Bugzilla-Product: [% product %]
If that "IF" is false, then the resuling lines look like this in vim:
X-Bugzilla-Watch-Reason: None^M^M
X-Bugzilla-Product: WorldControl^M
We only noticed this because Email::MIME, when processing this template,
thinks that everything up to X-Bugzilla-Watch-Reason is *one header*
now. Anyhow, I think it's a bug in chomping--lines should definitely
never end up with \r\r\n.