aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 5e6e0ae626..f1910af782 100644
--- a/string.c
+++ b/string.c
@@ -1457,6 +1457,7 @@ rb_str_index(VALUE str, VALUE sub, long offset)
s = RSTRING_PTR(str);
if (offset) {
offset = str_offset(s, RSTRING_END(str), offset, enc, IS_7BIT(str));
+ s += offset;
}
if (slen == 0) return offset;
/* need proceed one character at a time */