]> Cypherpunks repositories - gostls13.git/commit
fmt: one bad index shouldn't spoil them all
authorRob Pike <r@golang.org>
Mon, 23 Sep 2013 06:03:57 +0000 (16:03 +1000)
committerRob Pike <r@golang.org>
Mon, 23 Sep 2013 06:03:57 +0000 (16:03 +1000)
commit3e3ed5d978b3449e0854584f6ec2b5bc4770d0f0
treeacf05cbc6472874b222159e229498a4f4f5e0108
parentd00fb0a1ea881f43ef320c65ef606c9900a9df86
fmt: one bad index shouldn't spoil them all

In an indexed verb such as %[3]d, if the index is out of range, don't
skip processing the rest of the verbs. The bug was that the bad
index set a bit for the whole format instead of just the verb.

Ok for 1.2 because this is a bug in a 1.2 feature.

Fixes #6434

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13632058
src/pkg/fmt/fmt_test.go
src/pkg/fmt/print.go