From 15e59f1d671ffbe4ae7c74dafcbec93ea2584e34 Mon Sep 17 00:00:00 2001 From: Brian Kurek Date: Sat, 27 Apr 2019 17:16:52 -0400 Subject: [PATCH] Only track previously seen hardlinks --- lib/parse.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/parse.js b/lib/parse.js index fdcdd7d4..e66c75da 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -38,7 +38,7 @@ function Parse () { me._stream = new BlockStream(512) me.position = 0 me._ended = false - me._entries = [] + me._hardLinks = [] me._stream.on("error", function (e) { me.emit("error", e) @@ -252,15 +252,19 @@ Parse.prototype._startEntry = function (c) { if (onend) entry.on("end", onend) if (entry.type === "File") { - this._entries.forEach(function(prevEntry) { - if (prevEntry.type === "Link" && prevEntry.path === entry.path) { + this._hardLinks.forEach(function(link) { + if (link.path === entry.path) { ev = "ignoredEntry" } }) } this._entry = entry - this._entries.push(entry) + + if (entry.type === "Link") { + this._hardLinks.push(entry) + } + var me = this entry.on("pause", function () {