summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-31 14:54:52 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-31 14:54:52 +0900
commit0d8adaaaa16859342a37e3bf6832a8717c54f27c (patch)
tree42e72791697e65acf4736492c721e0b11a8e750e /src/string.c
parent708c455833a543c8140f0759f16317a347b7660e (diff)
downloadmruby-0d8adaaaa16859342a37e3bf6832a8717c54f27c.tar.gz
mruby-0d8adaaaa16859342a37e3bf6832a8717c54f27c.zip
wrong String#index behavior on udef INCLUDE_ENCODING
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index a5de9f557..22e3dad60 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1411,7 +1411,7 @@ mrb_str_index(mrb_state *mrb, mrb_value str, mrb_value sub, mrb_int offset)
s = t;
}
#else
- pos = mrb_memsearch(sptr, slen, s+offset, len-offset);
+ pos = mrb_memsearch(sptr, slen, s, len);
if (pos < 0) return pos;
#endif //INCLUDE_ENCODING
return pos + offset;