]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc.pl: support #line instructions
authorDaniel Stenberg <daniel@haxx.se>
Mon, 4 Dec 2023 09:50:42 +0000 (10:50 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 4 Dec 2023 09:50:42 +0000 (10:50 +0100)
makes it identify the correct source file and line

scripts/checksrc.pl

index 34664585c545eddc86746d9d73c24775a3c43c14..76f4660816d749e714751ab344d272a459a19268 100755 (executable)
@@ -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;