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 <r...@pengutronix.de> --- Changes in v2 -> v3: this patch is new in v3 --- scripts/lib/ptxd_lib_dgen.awk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index f6a51c2c4daa..c577f905b8fb 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 -- 2.20.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de