diff options
author | David Riebenbauer <davrieb@liegesta.at> | 2010-01-30 10:25:10 +0100 |
---|---|---|
committer | David Riebenbauer <davrieb@liegesta.at> | 2010-02-02 14:04:28 +0100 |
commit | 4af4d26582f0c2b915d7102fb4a604b176385748 (patch) | |
tree | 00e64edc367f50338976c3daacb60c5d2be8f99a | |
parent | deb0bc8bd57bc74709ecb12de36a9cb96c684a93 (diff) |
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.
-rw-r--r-- | IkiWiki.pm | 5 |
1 files changed, 4 insertions, 1 deletions
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 ($) { |