]> Cypherpunks repositories - gostls13.git/commit
archive/tar: convert Reader.Next to be loop based
authorJoe Tsai <joetsai@digital-static.net>
Wed, 16 Sep 2015 07:58:56 +0000 (00:58 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 2 Dec 2015 02:27:27 +0000 (02:27 +0000)
commitb8a12928a65a15ecce5c9332da9feef0cb221389
treea831d1479e1e678d5d7c6e3b9271b13ce8cee383
parent9bad99574ad90f877ee4d8aa36ca503f4167fab6
archive/tar: convert Reader.Next to be loop based

Motivation for change:
* Recursive logic is hard to follow, since it tends to apply
things in reverse. On the other hand, the tar formats tend to
describe meta headers as affecting the next entry.
* Recursion also applies changes in the wrong order. Two test
files are attached that use multiple headers. The previous Go
behavior differs from what GNU and BSD tar do.

Change-Id: Ic1557256fc1363c5cb26570e5d0b9f65a9e57341
Reviewed-on: https://go-review.googlesource.com/14624
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/archive/tar/reader.go
src/archive/tar/reader_test.go
src/archive/tar/testdata/gnu-multi-hdrs.tar [new file with mode: 0644]
src/archive/tar/testdata/pax-multi-hdrs.tar [new file with mode: 0644]