aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Bean <gbean@codeaurora.org>2011-03-03 13:46:41 -0800
committerStephen Boyd <sboyd@codeaurora.org>2013-09-04 14:18:01 -0700
commitbe65d26fa9849e7b1a15ef3c860c2a900c80cad0 (patch)
tree39344564d868bca47811b583d284e8a418bc510c
parent70129777082bdbc5446a72da6df1a96905d60d70 (diff)
Don't complain about MIME headers.
When patches contain extended character sets, patches will contain MIME headers after the subject line, which should not be confused for a too-long summary line. Signed-off-by: Gregory Bean <gbean@codeaurora.org> Change-Id: If17d17cc7513eb644d75f486b9cdea3a09ba0dbe (cherry picked from commit 8e6b9d3790595198a34320f1c3f4504cd258fed1)
-rwxr-xr-xscripts/checkpatch.pl19
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9b2a68d3a84..f2c4b20068d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1603,13 +1603,20 @@ sub process {
" characters\n" . $herecurr);
}
} elsif ($shorttext == CHECK_NEXT_SHORTTEXT) {
- $shorttext = IN_SHORTTEXT;
+# The Subject line doesn't have to be the last header in the patch.
+# Avoid moving to the IN_SHORTTEXT state until clear of all headers.
+# Per RFC5322, continuation lines must be folded, so any left-justified
+# text which looks like a header is definitely a header.
+ if ($line!~/^[\x21-\x39\x3b-\x7e]+:/) {
+ $shorttext = IN_SHORTTEXT;
# Check for Subject line followed by a blank line.
- if (length($line) != 0) {
- WARN("non-blank line after summary " .
- "line\n" . $sublinenr . $here .
- "\n" . $subjectline . "\n" .
- $line . "\n");
+ if (length($line) != 0) {
+ WARN("non-blank line after " .
+ "summary line\n" .
+ $sublinenr . $here .
+ "\n" . $subjectline .
+ "\n" . $line . "\n");
+ }
}
} elsif ($line=~/^Subject: \[[^\]]*\] (.*)/) {
$shorttext = CHECK_NEXT_SHORTTEXT;