X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/c4d4cad3befbbd444d094cbeb0b6ebba3910a025..0b59b140071748b6bc0204ac2f367353a74c697e:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 6fd112960..6da281999 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2401,14 +2401,17 @@ package IkiWiki::PageSpec; sub derel ($$) { my $path=shift; my $from=shift; - if ($path eq '.') { - $path = $from; - } - 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;