From 3c4fba8cf5fb6026e36720281fbd6c461dc21dfd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 4 Dec 2023 10:50:42 +0100 Subject: [PATCH] checksrc.pl: support #line instructions makes it identify the correct source file and line --- scripts/checksrc.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 34664585c5..76f4660816 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -403,6 +403,13 @@ sub scanfile { checksrc($cmd, $line, $file, $l) } + if($l =~ /^#line (\d+) \"([^\"]*)\"/) { + # a #line instruction + $file = $2; + $line = $1; + next; + } + # check for a copyright statement and save the years if($l =~ /\* +copyright .* (\d\d\d\d|)/i) { my $count = 0;