Commit 7d3a9f67 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: report the right line # when using --emacs and --file

commit 34d8815f ("checkpatch: add --showfile to allow input via pipe
to show filenames") broke the --emacs with --file option.

Fix it.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 100425de
......@@ -2166,7 +2166,11 @@ sub process {
if ($showfile) {
$prefix = "$realfile:$realline: "
} elsif ($emacs) {
$prefix = "$filename:$linenr: ";
if ($file) {
$prefix = "$filename:$realline: ";
} else {
$prefix = "$filename:$linenr: ";
}
}
if ($found_file) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment