From: Joey Hess Date: Wed, 17 Dec 2008 23:56:32 +0000 (-0500) Subject: don't rely on $@ X-Git-Tag: 2.71~71 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9f141841efc80dbe7a3ef8cc8fbae102c9cd190b;p=ikiwiki.git 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. --- 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); }