From aa68a8f8f6f91b6e0226fb2c921f74909f59b6e2 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 28 Feb 2018 09:33:40 +1000 Subject: [PATCH] messing with wordwrap --- src/www_msgs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/www_msgs.c b/src/www_msgs.c index 0ffd34e..7829efc 100644 --- a/src/www_msgs.c +++ b/src/www_msgs.c @@ -726,15 +726,21 @@ static char *www_wordwrap(char *content, int cutoff) { } if (content[i] == '\r' && content[i+1] != '\r') { - if (content[i+1] == ' ' || quote_line != 1) { + if (content[i+1] == ' ' && quote_line != 1) { content[at++] = '\r'; line_count = 0; quote_line = 0; } else { if (at > 0 && content[at-1] != '\r' && content[at-1] != ' ') { - content[at++] = ' '; - line_count++; - } + if (quote_line != 1) { + content[at++] = ' '; + line_count++; + } else { + content[at++] = '\r'; + line_count = 0; + quote_line = 0; + } + } } } else if (content[i] == '\r' && content[i+1] == '\r') { content[at++] = '\r';