]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.2] strings: fix Replacer bug with prefix matches
authorAndrew Gerrand <adg@golang.org>
Fri, 1 Nov 2013 00:18:49 +0000 (11:18 +1100)
committerAndrew Gerrand <adg@golang.org>
Fri, 1 Nov 2013 00:18:49 +0000 (11:18 +1100)
commitefb3af3d5c33dbdbad0fc52e95680843bb77ee72
tree7bea6509151a4cd32294f6c1deeaeb6c1821f478
parent7191e085990417cb17e51a61470debdea6297b5a
[release-branch.go1.2] strings: fix Replacer bug with prefix matches

««« CL 16880043 / 0eb6508d3e88
strings: fix Replacer bug with prefix matches

singleStringReplacer had a bug where if a string was replaced
at the beginning and no output had yet been produced into the
temp buffer before matching ended, an invalid nil check (used
as a proxy for having matched anything) meant it always
returned its input.

Fixes #6659

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/16880043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20570044
src/pkg/strings/replace.go
src/pkg/strings/replace_test.go