X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/a7b8069b9dd1921275ef24752a65005c15d0868e..bafb2d7b8199977556eed9a630f2a898b6400dfe:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 98145a585..88407584f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -282,18 +282,22 @@ sub htmlpage ($) { #{{{ return targetpage($page, $config{htmlext}); } #}}} -sub srcfile ($;$) { #{{{ +sub srcfile_stat { #{{{ my $file=shift; my $nothrow=shift; - return "$config{srcdir}/$file" if -e "$config{srcdir}/$file"; + return "$config{srcdir}/$file", stat(_) if -e "$config{srcdir}/$file"; foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) { - return "$dir/$file" if -e "$dir/$file"; + return "$dir/$file", stat(_) if -e "$dir/$file"; } error("internal error: $file cannot be found in $config{srcdir} or underlay") unless $nothrow; return; } #}}} +sub srcfile ($;$) { #{{{ + return (srcfile_stat(@_))[0]; +} #}}} + sub add_underlay ($) { #{{{ my $dir=shift;