aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-16 03:27:23 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-16 03:27:23 +0000
commit5f877e84316496556b05287e298f3d3924fc4f00 (patch)
tree8b0c88d8205e604a152b6a50da54843f4e0ed9f4 /string.c
parent9be798477425579cd73e5d0884435fce1f38502b (diff)
downloadruby-5f877e84316496556b05287e298f3d3924fc4f00.tar.gz
* string.c (rb_str_index): wrong increment for non alphanumeric
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 7a7ccd0ef0..a4612221c5 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) {