Fix `anno -delete': preserve newline in folded header fields
authormarkus schnalke <meillo@marmaro.de>
Mon, 17 Apr 2017 21:41:55 +0000 (23:41 +0200)
committermarkus schnalke <meillo@marmaro.de>
Mon, 17 Apr 2017 21:41:55 +0000 (23:41 +0200)
uip/anno.c

index 33d2b49..1708557 100644 (file)
@@ -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) {