From 9f141841efc80dbe7a3ef8cc8fbae102c9cd190b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Dec 2008 18:56:32 -0500 Subject: [PATCH] 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. --- IkiWiki.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.26.2