Merge branch 'master' of github.com:mafintosh/tar-stream
Conflicts: headers.js
This commit is contained in:
commit
484c71ca0c
6 changed files with 30 additions and 25 deletions
|
@ -199,7 +199,7 @@ Extract.prototype._parse = function(size, onparse) {
|
||||||
this._onparse = onparse
|
this._onparse = onparse
|
||||||
}
|
}
|
||||||
|
|
||||||
Extract.prototype._continue = function(err) {
|
Extract.prototype._continue = function () {
|
||||||
if (this._destroyed) return
|
if (this._destroyed) return
|
||||||
var cb = this._cb
|
var cb = this._cb
|
||||||
this._cb = noop
|
this._cb = noop
|
||||||
|
|
|
@ -190,13 +190,15 @@ exports.encode = function(opts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.decode = function(buf) {
|
exports.decode = function(buf) {
|
||||||
|
var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET
|
||||||
|
|
||||||
var name = decodeStr(buf, 0, 100)
|
var name = decodeStr(buf, 0, 100)
|
||||||
var mode = decodeOct(buf, 100)
|
var mode = decodeOct(buf, 100)
|
||||||
var uid = decodeOct(buf, 108)
|
var uid = decodeOct(buf, 108)
|
||||||
var gid = decodeOct(buf, 116)
|
var gid = decodeOct(buf, 116)
|
||||||
var size = decodeOct(buf, 124)
|
var size = decodeOct(buf, 124)
|
||||||
var mtime = decodeOct(buf, 136)
|
var mtime = decodeOct(buf, 136)
|
||||||
var type = toType(buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET)
|
var type = toType(typeflag)
|
||||||
var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100)
|
var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100)
|
||||||
var uname = decodeStr(buf, 265, 32)
|
var uname = decodeStr(buf, 265, 32)
|
||||||
var gname = decodeStr(buf, 297, 32)
|
var gname = decodeStr(buf, 297, 32)
|
||||||
|
@ -205,6 +207,9 @@ exports.decode = function(buf) {
|
||||||
|
|
||||||
if (buf[345]) name = decodeStr(buf, 345, 155)+'/'+name
|
if (buf[345]) name = decodeStr(buf, 345, 155)+'/'+name
|
||||||
|
|
||||||
|
// to support old tar versions that use trailing / to indicate dirs
|
||||||
|
if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5
|
||||||
|
|
||||||
var c = cksum(buf)
|
var c = cksum(buf)
|
||||||
|
|
||||||
//checksum is still initial value if header was null.
|
//checksum is still initial value if header was null.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tar-stream",
|
"name": "tar-stream",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"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.",
|
"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.",
|
||||||
"author": "Mathias Buus <mathiasbuus@gmail.com>",
|
"author": "Mathias Buus <mathiasbuus@gmail.com>",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
Loading…
Reference in a new issue