From 41ad151c26f230e99d1ec6df0dcc477e72a7e6f7 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Mon, 17 Apr 2017 23:41:55 +0200 Subject: [PATCH] Fix `anno -delete': preserve newline in folded header fields --- uip/anno.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) { -- 1.7.10.4