X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/474b6524e0fe4b4bb3402bf6551bf97be7f3ee1f..8c8856601f76c16b2be51b16c095a276f9c9a9b5:/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;