mirror of
https://github.com/curl/curl.git
synced 2026-01-18 17:21:26 +01:00
mdlinkcheck: handle links with a leading slash properly
Ref: #18372 Closes #18382
This commit is contained in:
@@ -99,8 +99,14 @@ sub storelink {
|
||||
my $dir = $f;
|
||||
$dir =~ s:([^/]*\z)::;
|
||||
|
||||
while($link =~ s:^\.\.\/::) {
|
||||
$dir =~ s:([^/]*)\/\z::;
|
||||
if($link =~ s/(^\/)//) {
|
||||
# link starts with a slash, now removed
|
||||
$dir = "";
|
||||
}
|
||||
else {
|
||||
while($link =~ s:^\.\.\/::) {
|
||||
$dir =~ s:([^/]*)\/\z::;
|
||||
}
|
||||
}
|
||||
|
||||
$flink{"./$dir$link"} .= "$f:$line ";
|
||||
|
||||
Reference in New Issue
Block a user