提交 721c1cb6 编写于 作者: A Andy Whitcroft 提交者: Linus Torvalds

checkpatch: comment detection may miss an implied comment on the last hunk

When detecting implied comments from leading stars we may incorrectly
think we have detected an edge one way or the other when we have not if we
drop off the end of the last hunk.  Fix this up.
Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 691d77b6
......@@ -1097,8 +1097,8 @@ sub process {
$rawlines[$ln - 1] =~ /^-/);
$cnt--;
#print "RAW<$rawlines[$ln - 1]>\n";
($edge) = (defined $rawlines[$ln - 1] &&
$rawlines[$ln - 1] =~ m@(/\*|\*/)@);
last if (!defined $rawlines[$ln - 1]);
($edge) = ($rawlines[$ln - 1] =~ m@(/\*|\*/)@);
last if (defined $edge);
}
if (defined $edge && $edge eq '*/') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册