X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/5d88146861ac237ac89cbed2e90a985b9c3bfdc2..852cc25f3b5d0f7b026e37a6231334edc92d367f:/IkiWiki.pm 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;