]> granicus.if.org Git - mutt/commitdiff
Fix the x-label update code check location.
authorKevin McCarthy <kevin@8t8.us>
Sun, 29 Jan 2017 19:02:50 +0000 (11:02 -0800)
committerKevin McCarthy <kevin@8t8.us>
Sun, 29 Jan 2017 19:02:50 +0000 (11:02 -0800)
The x-label comparison was outside the "beginning of header" block.

This meant that it could theoretically match a continuation line.
Additionally, the continuation lines of x-labels would not be
stripped, because the comparison was after the ignore variable was
reset.

Move the comparison inside the block and before the ignore reset.

copy.c

diff --git a/copy.c b/copy.c
index f4dbba3e42e3f8c03b9aa0968806dc0022759fbb..af6e2691452492d71bb9dd4ddeab8e5999ae9bda 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -108,13 +108,13 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags,
        if ((flags & CH_UPDATE_IRT) &&
            ascii_strncasecmp ("In-Reply-To:", buf, 12) == 0)
          continue;
+        if (flags & CH_UPDATE_LABEL &&
+            ascii_strncasecmp ("X-Label:", buf, 8) == 0)
+          continue;
+
        ignore = 0;
       }
 
-      if (flags & CH_UPDATE_LABEL &&
-         ascii_strncasecmp ("X-Label:", buf, 8) == 0)
-       continue;
-
       if (!ignore && fputs (buf, out) == EOF)
        return (-1);
     }