trim null bytes from octal nums
This commit is contained in:
parent
05d3af9d1b
commit
7c57165ad2
1 changed files with 4 additions and 2 deletions
|
@ -92,8 +92,10 @@ var encodeOct = function(val, n) {
|
||||||
var decodeOct = function(val, offset) {
|
var decodeOct = function(val, offset) {
|
||||||
// Older versions of tar can prefix with spaces
|
// Older versions of tar can prefix with spaces
|
||||||
while (offset < val.length && val[offset] === 32) offset++
|
while (offset < val.length && val[offset] === 32) offset++
|
||||||
|
var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)
|
||||||
return parseInt(val.slice(offset, clamp(indexOf(val, 32, offset, val.length), val.length, val.length)).toString(), 8)
|
while (offset < end && val[offset] === 0) offset++
|
||||||
|
if (end === offset) return 0
|
||||||
|
return parseInt(val.slice(offset, end).toString(), 8)
|
||||||
}
|
}
|
||||||
|
|
||||||
var decodeStr = function(val, offset, length) {
|
var decodeStr = function(val, offset, length) {
|
||||||
|
|
Loading…
Reference in a new issue