Thread (24 messages) flat view 24 messages, 8 authors, 2016-06-15

Re: [PATCH] Let mailsplit and mailinfo handle mails with CRLF line-endings

From: Alex Riesen <hidden>
Date: 2016-06-15 22:47:09

On Tue, Aug 4, 2009 at 19:34, Sverre Rabbelier[off-list ref] wrote:
On Tue, Aug 4, 2009 at 10:26, Alex Riesen[off-list ref] wrote:
quoted
       }
+       if (len > 1 && buf[len - 2] == '\r')
+               buf[--len - 1] = '\n';
       buf[len] = '\0';
How about something like:

+       if (len > 1 && buf[len - 2] == '\r' && (buf[len - 1] == '\n'
|| buf[len - 1] == '\0'))
+               buf[--len - 1] = '\n';

To make sure that we're not erasing a \r somewhere in the middle of the content?
I think this should be enough:

	if (c == '\n' && len > 1 && buf[len - 2] == '\r')
		buf[--len - 1] = '\n';

I'll resend.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help