aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm2
-rw-r--r--doc/plugins/write.mdwn6
-rw-r--r--po/ikiwiki.pot2
-rwxr-xr-xt/pagespec_match.t11
4 files changed, 11 insertions, 10 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index a547c57ef..32ca0449f 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -881,7 +881,7 @@ sub match_glob ($$$) { #{{{
if ($glob =~ m!^\./!) {
$from=~s!/?[^/]+$!!;
$glob=~s!^\./!!;
- $glob="$from/$glob";
+ $glob="$from/$glob" if length $from;
}
# turn glob into safe regexp
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index d822408c2..1aaaf1d1e 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -314,9 +314,9 @@ Makes the specified page depend on the specified [[PageSpec]].
#### `pagespec_match($$;$)`
-Passed a page name, a [[PageSpec]], and the location the glob should be
-matched against, returns true if the [[PageSpec]] matches the page. (If the
-third parameter is not passed, relative PageSpecs will match relative to
+Passed a page name, a [[PageSpec]], and the location the [[PageSpec]] should
+be matched against, returns true if the [[PageSpec]] matches the page. (If
+the third parameter is not passed, relative PageSpecs will match relative to
the top of the wiki.)
#### `bestlink($$)`
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index 7ec22a689..6fd3644e8 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-02-06 15:59-0500\n"
+"POT-Creation-Date: 2007-02-06 19:43-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/t/pagespec_match.t b/t/pagespec_match.t
index 1b8143577..bd517f58b 100755
--- a/t/pagespec_match.t
+++ b/t/pagespec_match.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 40;
+use Test::More tests => 41;
BEGIN { use_ok("IkiWiki"); }
@@ -18,10 +18,11 @@ ok(! pagespec_match("foo", "* and !foo", ""));
ok(! pagespec_match("foo", "foo and !foo", ""));
ok(! pagespec_match("foo.png", "* and !*.*", ""));
ok(pagespec_match("foo", "(bar or ((meep and foo) or (baz or foo) or beep))", ""));
-ok(! pagespec_match("foo/bar", "./*", "foo"), "relative fail");
-ok(! pagespec_match("a/foo", "./*", "a/b"), "relative");
-ok(! pagespec_match("a/b/foo", "./*", "a/b"), "relative fail");
-ok(! pagespec_match("foo", "./*", "a"), "relative toplevel");
+ok(! pagespec_match("a/foo", "foo", "a/b"), "nonrelative fail");
+ok(! pagespec_match("foo", "./*", "a/b"), "relative fail");
+ok(pagespec_match("a/foo", "./*", "a/b"), "relative");
+ok(pagespec_match("a/b/foo", "./*", "a/b"), "relative 2");
+ok(pagespec_match("foo", "./*", "a"), "relative toplevel");
ok(pagespec_match("foo/bar", "*", "baz"), "absolute");
$links{foo}=[qw{bar baz}];