X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/9fca7f2f8b64f4caded4a0099cef1f4d152dabee..b2dea99417ebfee3d448ab6b49ca58cb2780258d:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 3802559a5..f5cf8ba96 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -282,14 +282,15 @@ sub htmlpage ($) { #{{{ return targetpage($page, $config{htmlext}); } #}}} -sub srcfile ($) { #{{{ +sub srcfile ($;$) { #{{{ my $file=shift; + my $nothrow=shift; return "$config{srcdir}/$file" if -e "$config{srcdir}/$file"; foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) { return "$dir/$file" if -e "$dir/$file"; } - error("internal error: $file cannot be found in $config{srcdir} or underlay"); + error("internal error: $file cannot be found in $config{srcdir} or underlay") unless $nothrow; return; } #}}}