]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
typo
[git.ikiwiki.info.git] / IkiWiki.pm
index 6fd11296013eef2004dee6dd939c70230eaaf70c..6da281999f0b4c035805626f11d6e244c105d69f 100644 (file)
@@ -2401,14 +2401,17 @@ package IkiWiki::PageSpec;
 sub derel ($$) {
        my $path=shift;
        my $from=shift;
 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;
        }
 
        return $path;