summaryrefslogtreecommitdiff
path: root/src/pkg/time/zoneinfo_read.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /src/pkg/time/zoneinfo_read.go
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-04b08da9af0c450d645ab7389d1467308cfc2db8.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'src/pkg/time/zoneinfo_read.go')
-rw-r--r--src/pkg/time/zoneinfo_read.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/pkg/time/zoneinfo_read.go b/src/pkg/time/zoneinfo_read.go
index ebb4205a9..4519c9962 100644
--- a/src/pkg/time/zoneinfo_read.go
+++ b/src/pkg/time/zoneinfo_read.go
@@ -141,7 +141,7 @@ func loadZoneData(bytes []byte) (l *Location, err error) {
if n, ok = zonedata.big4(); !ok {
return nil, badData
}
- zone[i].offset = int(n)
+ zone[i].offset = int(int32(n))
var b byte
if b, ok = zonedata.byte(); !ok {
return nil, badData
@@ -174,7 +174,13 @@ func loadZoneData(bytes []byte) (l *Location, err error) {
}
}
- // Commited to succeed.
+ if len(tx) == 0 {
+ // Build fake transition to cover all time.
+ // This happens in fixed locations like "Etc/GMT0".
+ tx = append(tx, zoneTrans{when: -1 << 63, index: 0})
+ }
+
+ // Committed to succeed.
l = &Location{zone: zone, tx: tx}
// Fill in the cache with information about right now,
@@ -284,7 +290,7 @@ func loadZoneZip(zipfile, name string) (l *Location, err error) {
// 42 off[4]
// 46 name[namelen]
// 46+namelen+xlen+fclen - next header
- //
+ //
if get4(buf) != zcheader {
break
}