History

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

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

Joe Perches committed 11 years ago

Commit 7d3a9f61 parent 100425d1 file · +5 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+5−1
@@ -2166,7 +2166,11 @@ sub process { · 2165 unmodified lines
2166 if ($showfile) {2166 if ($showfile) {
2167 $prefix = "$realfile:$realline: "2167 $prefix = "$realfile:$realline: "
2168 } elsif ($emacs) {2168 } elsif ($emacs) {
2169 $prefix = "$filename:$linenr: ";2169 if ($file) {
2170 $prefix = "$filename:$realline: ";
2171 } else {
2172 $prefix = "$filename:$linenr: ";
2173 }
2170 }2174 }
2171 2175
2172 if ($found_file) {2176 if ($found_file) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t