aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-17 18:56:32 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-17 18:56:32 -0500
commit9f141841efc80dbe7a3ef8cc8fbae102c9cd190b (patch)
tree2287620d276bf66b8c0685771a3741f8d801e341 /IkiWiki.pm
parent140c0bacbadc35de93cc685313123e9e51b45704 (diff)
downloadikiwiki-9f141841efc80dbe7a3ef8cc8fbae102c9cd190b.tar
ikiwiki-9f141841efc80dbe7a3ef8cc8fbae102c9cd190b.tar.gz
don't rely on $@
A malformed pagespec will cause $@ to be set when translated, but if it is used a second time, the memoization will defeat that check. Better to check for the result not being defined.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index d93ff7374..2a3a84d9a 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1797,7 +1797,8 @@ sub pagespec_match ($$;@) {
}
my $sub=pagespec_translate($spec);
- return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
+ return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"")
+ if $@ || ! defined $sub;
return $sub->($page, @params);
}