From b0d7895cab3ef8b405c9cf271e5e82f8dcf9258e Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 16 Oct 2001 03:27:23 +0000 Subject: * string.c (rb_str_index): wrong increment for non alphanumeric string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 7a7ccd0ef..a4612221c 100644 --- a/string.c +++ b/string.c @@ -1011,8 +1011,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) { -- cgit