mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3483 from ksss/string-index
String#index shouldn't return nil when "".index ""
This commit is contained in:
+1
-1
@@ -1608,7 +1608,7 @@ mrb_str_index(mrb_state *mrb, mrb_value str)
|
||||
return mrb_nil_value();
|
||||
}
|
||||
}
|
||||
if (pos >= clen) return mrb_nil_value();
|
||||
if (pos > clen) return mrb_nil_value();
|
||||
pos = chars2bytes(str, 0, pos);
|
||||
|
||||
switch (mrb_type(sub)) {
|
||||
|
||||
Reference in New Issue
Block a user