X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f398ad035b973608d380c9939ea845d8e2a0cdc2..ad5f4f14f52233148a9ecae2b3e7e0964c6c02ba:/IkiWiki.pm?ds=inline diff --git a/IkiWiki.pm b/IkiWiki.pm index df8abe2c2..6da281999 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2402,10 +2402,16 @@ sub derel ($$) { my $path=shift; my $from=shift; - if ($path =~ m!^\./!) { - $from=~s#/?[^/]+$## if defined $from; - $path=~s#^\./##; - $path="$from/$path" if defined $from && length $from; + if ($path =~ m!^\.(/|$)!) { + if ($1) { + $from=~s#/?[^/]+$## if defined $from; + $path=~s#^\./##; + $path="$from/$path" if defined $from && length $from; + } + else { + $path = $from; + $path = "" unless defined $path; + } } return $path;