diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-22 06:46:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-22 06:46:09 +0000 |
commit | 40bb53ceb1c8eed2a5cd76c497e8208746a8db96 (patch) | |
tree | 63ec7460227b34e079e1a6404127bb4480f9153e /string.c | |
parent | 37b6805c7a863e00be9ff0742261aca8b1e09819 (diff) |
* string.c (rb_str_index): wrong increment for non alphanumeric
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -824,8 +824,8 @@ rb_str_succ(orig) sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1; c = '\001'; while (sbeg <= s) { - *s += 1; - if (*s-- != 0) break; + if ((*s += 1) != 0) break; + s--; } } if (s < sbeg) { |