diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 08:29:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 08:29:09 +0000 |
commit | bc5ff99474cc1ca67c14471b8c95244542740ef8 (patch) | |
tree | 84917adb6e715184675c69737df07cdbdaeb0814 /string.c | |
parent | e9bdbbdb755ee451302c3d834ad20f77d80754f0 (diff) |
2000-02-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -580,6 +580,10 @@ rb_str_index_method(argc, argv, str) else { pos = 0; } + if (pos < 0) { + pos += RSTRING(str)->len; + if (pos < 0) return Qnil; + } switch (TYPE(sub)) { case T_REGEXP: |