diff options
author | Roland Hieber <rhi@pengutronix.de> | 2019-06-06 18:26:14 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-06-12 13:38:05 +0200 |
commit | bd48e882b5df33d8c62e0048923e60c13ee33957 (patch) | |
tree | bef736c92884fcf9fa90f1c3fc5127a8561d1739 /scripts/lib/ptxd_lib_dgen.awk | |
parent | f6a20a8bddcc3975b76db5a1a6cc0179d85be853 (diff) | |
download | ptxdist-bd48e882b5df33d8c62e0048923e60c13ee33957.tar.gz ptxdist-bd48e882b5df33d8c62e0048923e60c13ee33957.tar.xz |
ptxd_lib_dgen: add line counter
We cannot simply use NR for line counting because RS is changed in
function dump_file. Add an extra variable to count lines, and reset it
on each new file.
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_lib_dgen.awk')
-rw-r--r-- | scripts/lib/ptxd_lib_dgen.awk | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index 72a3ea857..f658a64d7 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -45,12 +45,15 @@ FNR == 1 { # remember the current opened file old_filename = FILENAME; + lineno = 0; # will be set later, if makefile belongs to a pkg is_pkg = ""; } - +/^/ { + lineno += 1; +} # # skip comments and empty lines |