summaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index bbc857214..40622a5be 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -292,7 +292,9 @@ sub writefile ($$$;$$) { #{{{
$writer->(\*OUT, $cleanup);
}
else {
- print OUT $content || error("failed writing to $newfile: $!", $cleanup);
+ if (length $content) {
+ print OUT $content || error("failed writing to $newfile: $!", $cleanup);
+ }
}
close OUT || error("failed saving $newfile: $!", $cleanup);
rename($newfile, "$destdir/$file") ||