From 4af4d26582f0c2b915d7102fb4a604b176385748 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Sat, 30 Jan 2010 10:25:10 +0100 Subject: [PATCH] Make srcfile() return undef, if the file isn't there. This has the advantage that it's now possible to check for the existence of a sourcefile with that function. --- IkiWiki.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index b8e599928..cb1c46a68 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -743,7 +743,10 @@ sub srcfile_stat { } sub srcfile ($;$) { - return (srcfile_stat(@_))[0]; + if (my @stat=srcfile_stat(@_)) { + return $stat[0]; + } + return undef } sub add_underlay ($) { -- 2.44.0