Skip to content

Commit

Permalink
Fix: cases where file size is known (i.e. compressedSize > 0) but the…
Browse files Browse the repository at this point in the history
… fileSizeKnown flag is false
  • Loading branch information
ZJONSSON committed Sep 3, 2019
1 parent 5e57320 commit 4aa2cb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Open/unzip.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = function unzip(source,offset,_password, directoryVars) {
});

entry.vars.then(function(vars) {
var fileSizeKnown = !(vars.flags & 0x08),
var fileSizeKnown = !(vars.flags & 0x08) || vars.compressedSize > 0,
eof;

var inflater = vars.compressionMethod ? zlib.createInflateRaw() : Stream.PassThrough();
Expand Down
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Parse.prototype._readFile = function () {
extra: extra
});

var fileSizeKnown = !(vars.flags & 0x08),
var fileSizeKnown = !(vars.flags & 0x08) || vars.compressedSize > 0,
eof;

entry.__autodraining = __autodraining; // expose __autodraining for test purposes
Expand Down

0 comments on commit 4aa2cb1

Please sign in to comment.