Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(34)

Issue 16880043: code review 16880043: strings: fix Replacer bug with prefix matches (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by bradfitz
Modified:
10 years, 5 months ago
Reviewers:
r
CC:
golang-dev, r
Visibility:
Public.

Description

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 issue 6659

Patch Set 1 #

Patch Set 2 : diff -r 7ebbddd21330 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 7ebbddd21330 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 7ebbddd21330 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -2 lines) Patch
M src/pkg/strings/replace.go View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/pkg/strings/replace_test.go View 1 2 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 3
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 5 months ago (2013-10-24 22:42:44 UTC) #1
r
LGTM
10 years, 5 months ago (2013-10-24 22:48:35 UTC) #2
bradfitz
10 years, 5 months ago (2013-10-24 22:51:23 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=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 issue 6659

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/16880043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b