changeset: 6918:ab2f8882633b
user:      Kevin McCarthy <[email protected]>
date:      Sun Jan 29 11:02:50 2017 -0800
link:      http://dev.mutt.org/hg/mutt/rev/ab2f8882633b

Fix the x-label update code check location.

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.

diffs (21 lines):

diff -r d0909785d945 -r ab2f8882633b copy.c
--- a/copy.c    Sat Jan 28 18:48:08 2017 -0800
+++ b/copy.c    Sun Jan 29 11:02:50 2017 -0800
@@ -108,13 +108,13 @@
        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);
     }

Reply via email to