diff options
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 10 |
1 files changed, 7 insertions, 3 deletions
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; |