aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorDavid Riebenbauer <davrieb@liegesta.at>2010-01-30 10:25:10 +0100
committerDavid Riebenbauer <davrieb@liegesta.at>2010-02-02 14:04:28 +0100
commit4af4d26582f0c2b915d7102fb4a604b176385748 (patch)
tree00e64edc367f50338976c3daacb60c5d2be8f99a /IkiWiki.pm
parentdeb0bc8bd57bc74709ecb12de36a9cb96c684a93 (diff)
downloadikiwiki-4af4d26582f0c2b915d7102fb4a604b176385748.tar
ikiwiki-4af4d26582f0c2b915d7102fb4a604b176385748.tar.gz
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.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm5
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 ($) {