New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strings: Replacer fails at beginning of string #6659
Labels
Comments
Broken starting at: changeset: 14462:0a0a751f0b74 user: Eric Roshan-Eisner <eric.d.eisner@gmail.com> date: Fri Sep 28 12:34:18 2012 +1000 summary: strings: implement a faster single-string Replacer Work-around fix: diff -r 7ebbddd21330 src/pkg/strings/replace.go --- a/src/pkg/strings/replace.go Thu Oct 24 10:13:23 2013 -0700 +++ b/src/pkg/strings/replace.go Thu Oct 24 15:06:56 2013 -0700 @@ -34,7 +34,7 @@ } if len(oldnew) == 2 && len(oldnew[0]) > 1 { - return &Replacer{r: makeSingleStringReplacer(oldnew[0], oldnew[1])} +// return &Replacer{r: makeSingleStringReplacer(oldnew[0], oldnew[1])} } Looking into it. |
Issue #6660 has been merged into this issue. |
Sent https://golang.org/cl/16880043 Status changed to Started. |
This issue was closed by revision 2d6a139. Status changed to Fixed. |
adg
added a commit
that referenced
this issue
May 11, 2015
««« 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
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: