[Linux-kernel-mentees] Linux kernel checkpatch.pl mentorship

Dwaipayan Ray dwaipayanray1 at gmail.com
Thu Sep 17 13:41:44 UTC 2020

> So you see in all these cases non ascii characters are present. I looked
> into checkpatch.pl .
> line 2662:
>         if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
>            $author = $1;
>             $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
>             $author =~ s/"//g;
>             $author = reformat_email($author);
>         }
> When i looked into $line, it gave below:
> From: =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0=20=28Zhou=20Yanjie
> =29?=
> <zhouyanjie at wanyeetech.com>
> And at the end of this block, $author was equal to ''.
> There seems to be a parsing problem there.

Also I looked into this output more, and I looked into the git
history. For the FROM:
parsing part, the author wrote this:

"Non-ASCII quoted printable encoding in From: headers and (lack of) double
quotes are handled.  Split From: headers are not fully handled: only the
the first part is compared."

So the problem instead seems to be the Split From: headers. In all the
cases that I
mentioned, due to formatting issues or something, the email address was
pushed off into the next line, due to which parsing fails.

A solution would be to write logic for handling these Split From:
headers, which the
author left off.


More information about the Linux-kernel-mentees mailing list