# HG changeset patch # User Ben Schmidt # Date 1326770061 -39600 # Node ID 9caf15c6ae31994725e74496186e0718633f70ca # Parent ed446ead03bdb4b961761c10bb6d91cf4921a98d Skip lines with directives which end up being whitespace-only. diff -r ed446ead03bd -r 9caf15c6ae31 ChangeLog --- a/ChangeLog Tue Jan 17 14:14:16 2012 +1100 +++ b/ChangeLog Tue Jan 17 14:14:21 2012 +1100 @@ -1,3 +1,4 @@ + o Automatically skip lines with only whitespace and directives in list texts o Add support for conditionals in list texts o Add %wrap% and %wrap W% formatting directives o Add %digestthreads%, %gatekeepers%, %listsubs%, %digestsubs%, %nomailsubs%, diff -r ed446ead03bd -r 9caf15c6ae31 src/prepstdreply.c --- a/src/prepstdreply.c Tue Jan 17 14:14:16 2012 +1100 +++ b/src/prepstdreply.c Tue Jan 17 14:14:21 2012 +1100 @@ -950,6 +950,7 @@ char *prev = NULL; int incision; size_t len, i; + int directive; for (;;) { while (txt->src != NULL) { @@ -1032,6 +1033,7 @@ incision = txt->skip != NULL ? pos - line : -1; spc = NULL; + directive = 0; while (*pos != '\0') { if (txt->wrapwidth != 0 && len > txt->wrapwidth && txt->skip == NULL) break; @@ -1062,6 +1064,7 @@ * to process, so continue straight away. */ continue; } else if (*pos == '%') { + directive = 1; handle_directive(txt, &line, &pos, listdir); len = pos - line; spc = NULL; @@ -1155,6 +1158,14 @@ tmp = mystrdup(line); myfree(line); line = tmp; + } else if (directive) { + pos = line; + while (*pos == ' ' || *pos == '\t') pos++; + if (*pos == '\0') { + /* Omit whitespace-only line with directives */ + myfree(line); + continue; + } } if (txt->src->suffix != NULL) {