checksrc.pl: support #line instructions

makes it identify the correct source file and line
This commit is contained in:
Daniel Stenberg 2023-12-04 10:50:42 +01:00
parent 8dbcdc8c09
commit 3c4fba8cf5
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;