Skip to content

Commit

Permalink
kernel-doc: track line numbers for each file separately
Browse files Browse the repository at this point in the history
The problem is that $. keeps track of the current record number (which
is line number by default). But if you pass it multiple files, it does
not wrap at the end of file, and therefore contains the *total* number
of processed lines.
I suppose we can fix line numbering by introducing a simple assignment
$. = 1
before processing every new file.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ilya Dryomov authored and Linus Torvalds committed Feb 27, 2010
1 parent 06a79b8 commit a9e7314
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/kernel-doc
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,8 @@ sub process_file($) {
return;
}

$. = 1;

$section_counter = 0;
while (<IN>) {
if ($state == 0) {
Expand Down

0 comments on commit a9e7314

Please sign in to comment.