From d7c04517a031547ec0e66d3b4e619cbd26d77fcf Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 31 Jan 2012 18:38:33 -0500 Subject: [PATCH] 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 --- src/pkg/fmt/scan.go | 1 + 1 file changed, 1 insertion(+) 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 } -- 2.48.1