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.
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);
}