Permalink
Browse files

Allow empty files to be added as files

By checking data.length, empty files (length === 0) are treated
as directories and added to the zip file incorrectly.
  • Loading branch information...
townxelliot committed May 19, 2014
1 parent fa5828f commit cbc6af14dc2318bbcfcfa82ebaf183c525346ae2
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ZipWriter.js
@@ -284,7 +284,7 @@ function ZipWriter() {
entry.mtime = new Date();
}

if (data.length > 0) {
if (entry.isFile !== false) {
entry.crc32 = calculateCrc32(data);
entry.isFile = true;
entry.size = data.length;

0 comments on commit cbc6af1

Please sign in to comment.