Skip to contentSkip to conversation

checkpatch: allow space leading blank lines in email headers

PATCH New [email protected] 1 participant 1 message May 8, 2017 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 24/114 checkpatch: allow space leading blank lines in email headers

From: Joe Perches <[email protected]>
Subject: checkpatch: allow space leading blank lines in email headers

Allow a leading space and otherwise blank link in the email headers as it can be a line wrapped Spamassassin multiple line string or any other valid rfc 2822/5322 email header.

The line with space causes checkpatch to erroneously think that it's in the content body, as opposed to headers and thus flag a mail header as an unwrapped long comment line.

---

 scripts/checkpatch.pl |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-allow-space-leading-blank-lines-in-email-headers +2 -2
diff -puN scripts/checkpatch.pl~checkpatch-allow-space-leading-blank-lines-in-email-headers scripts/checkpatch.pl
@@ -2628,8 +2628,8 @@ sub process {
 # Check if it's the start of a commit log
 # (not a header line and we haven't seen the patch filename)
 		if ($in_header_lines && $realfile =~ /^$/ &&
-		    !($rawline =~ /^\s+\S/ ||
-		      $rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) {
+		    !($rawline =~ /^\s+(?:\S|$)/ ||
+		      $rawline =~ /^(?:commit\b|from\b|[\w-]+:)/i)) {
 			$in_header_lines = 0;
 			$in_commit_log = 1;
 			$has_commit_log = 1;

_