Skip to content

Commit 922ecdc

Browse files
authored
genhtml: Fix apply_prefix regex on Windows (#442)
Ensure that `$lcovutil::dirseparator`, which can be a backslash, is properly escaped in the regex. Fixes an error of the form: ``` genhtml: ERROR: Unmatched ) in regex; marked by <-- HERE in m/^C\:\\b\\absmfft5\\execroot\\_main\\_tmp\\841d8b670c55601362e55b1ef828d048\\workspace\(.*) <-- HERE $/ ``` Signed-off-by: Fabian Meumertzheim <[email protected]>
1 parent b0a5aa5 commit 922ecdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/genhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13806,7 +13806,7 @@ sub apply_prefix($@)
1380613806
return 'root';
1380713807
}
1380813808
if ($prefix ne "" &&
13809-
$filename =~ /^\Q$prefix\E$lcovutil::dirseparator(.*)$/) {
13809+
$filename =~ /^\Q$prefix$lcovutil::dirseparator\E(.*)$/) {
1381013810
return substr($filename, length($prefix) + 1);
1381113811
}
1381213812
}

0 commit comments

Comments
 (0)