# HG changeset patch # User Ben Schmidt # Date 1327302217 -39600 # Node ID ac0272a516f74c336c170fd6c21f4fadbb13644a # Parent 7bb2c09d3abb648c3fd83fd008657f13bf9d7a7f Don't count skipped text when reckoning line length for wrapping. diff -r 7bb2c09d3abb -r ac0272a516f7 src/prepstdreply.c --- a/src/prepstdreply.c Mon Jan 23 18:01:35 2012 +1100 +++ b/src/prepstdreply.c Mon Jan 23 18:03:37 2012 +1100 @@ -1049,12 +1049,17 @@ 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 @@ 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 @@ * later */ incision = pos - line; } + len = incision; } else { if (incision != -1) { /* Time to cut */ @@ -1111,6 +1116,7 @@ } incision = -1; } + len = pos - line; } /* handle_directive() sets up for the next * character to process, so continue straight @@ -1119,7 +1125,7 @@ } else if (peeking && txt->skip == NULL) { break; } - len++; + if (txt->skip == NULL) len++; pos++; }