diff options
Diffstat (limited to 'std/archive/tar.ts')
-rw-r--r-- | std/archive/tar.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/std/archive/tar.ts b/std/archive/tar.ts index a169d5b4b..0685ad837 100644 --- a/std/archive/tar.ts +++ b/std/archive/tar.ts @@ -485,7 +485,10 @@ class TarEntry implements Reader { entryBytesLeft, ); - if (entryBytesLeft <= 0) return null; + if (entryBytesLeft <= 0) { + this.#consumed = true; + return null; + } const block = new Uint8Array(bufSize); const n = await readBlock(this.#reader, block); @@ -493,9 +496,7 @@ class TarEntry implements Reader { this.#read += n || 0; if (n === null || bytesLeft <= 0) { - // FIXME(bartlomieju): this condition makes no sense - // deno-lint-ignore no-constant-condition - if (null) this.#consumed = true; + if (n === null) this.#consumed = true; return null; } |