tar-stream
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -56,2 +56,4 @@ var util = require('util') | ||
this._paxGlobal = null | ||
this._gnuLongPath = null | ||
this._gnuLongLinkPath = null | ||
@@ -100,2 +102,16 @@ var self = this | ||
var ongnulongpath = function() { | ||
var size = self._header.size | ||
this._gnuLongPath = headers.decodeLongPath(b.slice(0, size)) | ||
b.consume(size) | ||
onstreamend() | ||
} | ||
var ongnulonglinkpath = function() { | ||
var size = self._header.size | ||
this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size)) | ||
b.consume(size) | ||
onstreamend() | ||
} | ||
var onheader = function() { | ||
@@ -116,2 +132,12 @@ var offset = self._offset | ||
} | ||
if (header.type === 'gnu-long-path') { | ||
self._parse(header.size, ongnulongpath) | ||
oncontinue() | ||
return | ||
} | ||
if (header.type === 'gnu-long-link-path') { | ||
self._parse(header.size, ongnulonglinkpath) | ||
oncontinue() | ||
return | ||
} | ||
if (header.type === 'pax-global-header') { | ||
@@ -128,2 +154,12 @@ self._parse(header.size, onpaxglobalheader) | ||
if (self._gnuLongPath) { | ||
header.name = self._gnuLongPath | ||
self._gnuLongPath = null | ||
} | ||
if (self._gnuLongLinkPath) { | ||
header.linkname = self._gnuLongLinkPath | ||
self._gnuLongLinkPath = null | ||
} | ||
if (self._pax) { | ||
@@ -130,0 +166,0 @@ self._header = header = mixinPax(header, self._pax) |
@@ -37,2 +37,7 @@ var ZEROS = '0000000000000000000' | ||
return 'pax-global-header' | ||
case 27: | ||
return 'gnu-long-link-path' | ||
case 28: | ||
case 30: | ||
return 'gnu-long-path' | ||
} | ||
@@ -96,4 +101,6 @@ | ||
while (offset < val.length && val[offset] === 32) offset++ | ||
return parseInt(val.slice(offset, clamp(indexOf(val, 32, offset, val.length), val.length, val.length)).toString(), 8) | ||
var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) | ||
while (offset < end && val[offset] === 0) offset++ | ||
if (end === offset) return 0 | ||
return parseInt(val.slice(offset, end).toString(), 8) | ||
} | ||
@@ -113,2 +120,6 @@ | ||
exports.decodeLongPath = function(buf) { | ||
return decodeStr(buf, 0, buf.length) | ||
} | ||
exports.encodePax = function(opts) { // TODO: encode more stuff in pax | ||
@@ -115,0 +126,0 @@ var result = '' |
{ | ||
"name": "tar-stream", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21828
550