]> Cypherpunks repositories - gostls13.git/commit
archive/zip: preserve old FileHeader.ModTime behavior
authorJoe Tsai <joetsai@digital-static.net>
Wed, 15 Nov 2017 20:38:26 +0000 (12:38 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 29 Nov 2017 16:28:13 +0000 (16:28 +0000)
commitd85a3535fe9b8c85f8876fab7f8ea0c984ec38e9
tree11d8679837f73a110d1cf6c5ab287bbbd96478f5
parentbe67e269b4a4161f4276e2619c5019a26e94541c
archive/zip: preserve old FileHeader.ModTime behavior

In order to avoid a regression where the date of the ModTime method
changed behavior, simply preserve the old behavior of determining
the date based on the legacy fields.

This ensures that anyone relying on ModTime before Go1.10 will have
the exact same behavior as before.
New users should use FileHeader.Modified instead.

We keep the UTC coersion logic in SetModTime since some users
manually compute timezone offsets in order to have precise control
over the MS-DOS time field.

Fixes #22738

Change-Id: Ib18b6ebd863bcf645748e083357dce9bc788cdba
Reviewed-on: https://go-review.googlesource.com/78031
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/archive/zip/struct.go
src/archive/zip/writer.go