aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/strings/strings.go
diff options
context:
space:
mode:
authorRoger Peppe <rogpeppe@gmail.com>2010-09-21 22:58:09 -0400
committerRuss Cox <rsc@golang.org>2010-09-21 22:58:09 -0400
commit8ee986570adeb4216ad340f3fc5ff30311345efe (patch)
tree5717aa115f86ae5b7030b6fb71eec33e96f96c93 /src/pkg/strings/strings.go
parentb11740fb6d2aa61b50a49144a0854ba84483c1f6 (diff)
downloadgo-8ee986570adeb4216ad340f3fc5ff30311345efe.tar.xz
strings: fix minor bug in LastIndexFunc
R=r, rsc CC=golang-dev https://golang.org/cl/2250042
Diffstat (limited to 'src/pkg/strings/strings.go')
-rw-r--r--src/pkg/strings/strings.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/strings/strings.go b/src/pkg/strings/strings.go
index 89da9dc224..e3989c7582 100644
--- a/src/pkg/strings/strings.go
+++ b/src/pkg/strings/strings.go
@@ -463,7 +463,7 @@ func lastIndexFunc(s string, f func(r int) bool, truth bool) int {
}
}
if start < 0 {
- return -1
+ start = 0
}
var wid int
rune, wid = utf8.DecodeRuneInString(s[start:end])