Skip to content

Commit

Permalink
Complement operator is maybe too clever
Browse files Browse the repository at this point in the history
  • Loading branch information
5saviahv committed Jun 23, 2024
1 parent 023486f commit 0a357a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zipFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
}
}

if (!~endOffset) throw new Error(Utils.Errors.INVALID_FORMAT);
if (endOffset == -1) throw new Error(Utils.Errors.INVALID_FORMAT);

mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart));
if (mainHeader.commentLength) {
Expand Down Expand Up @@ -225,7 +225,7 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
const len = name.length;

entryList.forEach(function (zipEntry) {
if (zipEntry.entryName.substr(0, len) === name) {
if (zipEntry.entryName.startsWith(name)) {
list.push(zipEntry);
}
});
Expand Down

0 comments on commit 0a357a9

Please sign in to comment.