go/src/strings
Martin Möhrmann 3c023f75a6 strings: fix handling of invalid UTF-8 sequences in Map
The new Map implementation introduced in golang.org/cl/33201
did not differentiate if an invalid UTF-8 sequence was decoded
or the RuneError rune. It would therefore always advance by
3 bytes (which is the length of the RuneError rune) instead
of 1 for an invalid sequences. This cl adds a check to correctly
determine the length of bytes needed to advance to the next rune.

Fixes #19330.

Change-Id: I1e7f9333f3ef6068ffc64015bb0a9f32b0b7111d
Reviewed-on: https://go-review.googlesource.com/37597
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-28 22:50:53 +00:00
..
compare.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
compare_test.go all: single space after period. 2016-03-02 00:13:47 +00:00
example_test.go strings: Add examples for HasPrefix and HasSuffix 2015-10-23 01:57:15 +00:00
export_test.go
reader.go all: use SeekStart, SeekCurrent, SeekEnd 2016-05-06 00:10:41 +00:00
reader_test.go strings, bytes: fix Reader 0 byte read at EOF 2016-05-03 21:01:13 +00:00
replace.go
replace_test.go strings: speed up Map 2017-02-24 22:53:05 +00:00
search.go
search_test.go
strings.go strings: fix handling of invalid UTF-8 sequences in Map 2017-02-28 22:50:53 +00:00
strings.s
strings_amd64.go strings: make parameters names less confusing 2017-02-11 19:55:21 +00:00
strings_decl.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
strings_generic.go strings: make parameters names less confusing 2017-02-11 19:55:21 +00:00
strings_s390x.go strings: make parameters names less confusing 2017-02-11 19:55:21 +00:00
strings_test.go strings: fix handling of invalid UTF-8 sequences in Map 2017-02-28 22:50:53 +00:00