From: Russ Cox Date: Tue, 31 Jan 2012 23:38:33 +0000 (-0500) Subject: fmt: fix caching bug in Scan X-Git-Tag: weekly.2012-02-07~163 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d7c04517a031547ec0e66d3b4e619cbd26d77fcf;p=gostls13.git fmt: fix caching bug in Scan Black box test is too time-consuming, as the bug does not appear until Scan has processed 2 GB of input in total across multiple calls, so no test. Thanks to Frederick Mayle for the diagnosis and fix. Fixes #2809. R=golang-dev, r CC=golang-dev https://golang.org/cl/5611043 --- diff --git a/src/pkg/fmt/scan.go b/src/pkg/fmt/scan.go index 281525112e..36c6aebad0 100644 --- a/src/pkg/fmt/scan.go +++ b/src/pkg/fmt/scan.go @@ -366,6 +366,7 @@ func newScanState(r io.Reader, nlIsSpace, nlIsEnd bool) (s *ss, old ssave) { s.fieldLimit = hugeWid s.maxWid = hugeWid s.validSave = true + s.count = 0 return }