mirror of
https://github.com/golang/go
synced 2024-11-20 09:54:45 -07:00
Regenerate v7.tar with a real V7 tar.
Fix octal parsing that it unearthed. R=rsc APPROVED=rsc DELTA=11 (5 added, 0 deleted, 6 changed) OCL=32924 CL=32945
This commit is contained in:
parent
266a2c47e0
commit
ffed3ade19
@ -75,7 +75,12 @@ func cString(b []byte) string {
|
||||
}
|
||||
|
||||
func (tr *Reader) octal(b []byte) int64 {
|
||||
if len(b) > 0 && b[len(b)-1] == ' ' {
|
||||
// Removing leading spaces.
|
||||
for len(b) > 0 && b[0] == ' ' {
|
||||
b = b[1:len(b)];
|
||||
}
|
||||
// Removing trailing NULs and spaces.
|
||||
for len(b) > 0 && (b[len(b)-1] == ' ' || b[len(b)-1] == '\x00') {
|
||||
b = b[0:len(b)-1];
|
||||
}
|
||||
x, err := strconv.Btoui64(cString(b), 8);
|
||||
|
@ -84,20 +84,20 @@ var untarTests = []*untarTest{
|
||||
headers: []*Header{
|
||||
&Header{
|
||||
Name: "small.txt",
|
||||
Mode: 0640,
|
||||
Mode: 0444,
|
||||
Uid: 73025,
|
||||
Gid: 5000,
|
||||
Size: 5,
|
||||
Mtime: 1246508266,
|
||||
Mtime: 1244593104,
|
||||
Typeflag: '\x00',
|
||||
},
|
||||
&Header{
|
||||
Name: "small2.txt",
|
||||
Mode: 0640,
|
||||
Mode: 0444,
|
||||
Uid: 73025,
|
||||
Gid: 5000,
|
||||
Size: 11,
|
||||
Mtime: 1245217492,
|
||||
Mtime: 1244593104,
|
||||
Typeflag: '\x00',
|
||||
},
|
||||
},
|
||||
|
BIN
src/pkg/archive/tar/testdata/v7.tar
vendored
BIN
src/pkg/archive/tar/testdata/v7.tar
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user