From: Ben Schmidt Date: Mon, 23 Jan 2012 07:03:37 +0000 (+1100) Subject: Don't count skipped text when reckoning line length for wrapping. X-Git-Tag: RELEASE_1_2_18a1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f9f5da7be6ce168e87e719ad3f4e70b3b4499ce;p=thirdparty%2Fmlmmj.git Don't count skipped text when reckoning line length for wrapping. --- diff --git a/src/prepstdreply.c b/src/prepstdreply.c index 7ba57f43..cc07aa7f 100644 --- a/src/prepstdreply.c +++ b/src/prepstdreply.c @@ -1049,12 +1049,17 @@ char *get_processed_text_line(text *txt, int headers, pos = line; } - incision = txt->skip != NULL ? pos - line : -1; + if (txt->skip != NULL) { + incision = pos - line; + len = incision; + } else { + incision = -1; + } spc = NULL; directive = 0; while (*pos != '\0') { if (txt->wrapwidth != 0 && len > txt->wrapwidth && - txt->skip == NULL && !peeking) break; + !peeking) break; if (*pos == '\r') { *pos = '\0'; pos++; @@ -1089,7 +1094,6 @@ char *get_processed_text_line(text *txt, int headers, directive = 1; swallow = handle_directive(txt, &line, &pos, peeking, listdir); - len = pos - line; spc = NULL; if (swallow == 1) peeking = 0; if (swallow == -1) break; @@ -1099,6 +1103,7 @@ char *get_processed_text_line(text *txt, int headers, * later */ incision = pos - line; } + len = incision; } else { if (incision != -1) { /* Time to cut */ @@ -1111,6 +1116,7 @@ char *get_processed_text_line(text *txt, int headers, } incision = -1; } + len = pos - line; } /* handle_directive() sets up for the next * character to process, so continue straight @@ -1119,7 +1125,7 @@ char *get_processed_text_line(text *txt, int headers, } else if (peeking && txt->skip == NULL) { break; } - len++; + if (txt->skip == NULL) len++; pos++; }