From: markus schnalke Date: Mon, 17 Apr 2017 21:41:55 +0000 (+0200) Subject: Fix `anno -delete': preserve newline in folded header fields X-Git-Tag: mmh-0.4~40 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=41ad151c26f230e99d1ec6df0dcc477e72a7e6f7;p=mmh Fix `anno -delete': preserve newline in folded header fields --- diff --git a/uip/anno.c b/uip/anno.c index 33d2b49..1708557 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -480,11 +480,13 @@ dodel(int fd, unsigned char *comp, char *text, FILE *tmp, int number) ** a long path name. */ for (n=0, cp=field; (c=getc(fp)) != EOF; *cp++ = c) { - if (c == '\n' && (c = getc(fp)) != ' ' && - c != '\t') { - ungetc(c, fp); + if (c == '\n') { + ungetc((c = getc(fp)), fp); + if (c != ' ' && c != '\t') { + c = '\n'; + break; + } c = '\n'; - break; } if (++n >= field_size - 1) {