From bd48e882b5df33d8c62e0048923e60c13ee33957 Mon Sep 17 00:00:00 2001 From: Roland Hieber Date: Thu, 6 Jun 2019 18:26:14 +0200 Subject: 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 Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_lib_dgen.awk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/lib/ptxd_lib_dgen.awk') 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 -- cgit v1.2.3