From b01a2274c3f96541b8b48f9ebb883ee8b7451fa3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 13:25:32 -0400 Subject: [PATCH] fix undef warning when page() tests a deleted file --- IkiWiki.pm | 3 ++- doc/bugs/deletion_warnings.mdwn | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 11cfcdfd2..d76b5edb4 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2348,7 +2348,8 @@ sub match_internal ($$;@) { sub match_page ($$;@) { my $page=shift; my $match=match_glob($page, shift, @_); - if ($match && ! defined IkiWiki::pagetype($IkiWiki::pagesources{$page})) { + if ($match && ! (exists $IkiWiki::pagesources{$page} + && defined IkiWiki::pagetype($IkiWiki::pagesources{$page}))) { return IkiWiki::FailReason->new("$page is not a page"); } else { diff --git a/doc/bugs/deletion_warnings.mdwn b/doc/bugs/deletion_warnings.mdwn index c8879379b..668626b49 100644 --- a/doc/bugs/deletion_warnings.mdwn +++ b/doc/bugs/deletion_warnings.mdwn @@ -2,6 +2,9 @@ Seen while deleting a blog's calendar pages: --[[Joey]] +[[done]] -- the new `page()` pagespec needed to check if there was a source +file for the page, and was leaking undef. +
    427250f..ff6c054  master     -> origin/master
 Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688.