summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-09 13:11:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-09 13:11:39 +0000
commit3cc0976f7ab0025943f64e554819a902236bb830 (patch)
tree4093755661898895c490cc0d869112118844a78b /string.c
parent8e34a3d9c097fbd9ab4ccf79d7a4532cc0d9cde5 (diff)
* string.c (rb_str_succ): reverted previous changes. [ruby-dev:35389]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/string.c b/string.c
index 28cb5a8eed..615af97e67 100644
--- a/string.c
+++ b/string.c
@@ -1401,7 +1401,7 @@ rb_str_succ(orig)
VALUE orig;
{
VALUE str;
- char *sbeg, *s, *last_alnum = 0;
+ char *sbeg, *s;
int c = -1;
long n = 0;
@@ -1413,15 +1413,6 @@ rb_str_succ(orig)
while (sbeg <= s) {
if (ISALNUM(*s)) {
- if (last_alnum && last_alnum > s + 1) {
- if (ISALPHA(*last_alnum) ? ISDIGIT(*s) :
- ISDIGIT(*last_alnum) ? ISALPHA(*s) : 0) {
- s = last_alnum;
- n = s - sbeg;
- break;
- }
- }
- last_alnum = s;
if ((c = succ_char(s)) == 0) break;
n = s - sbeg;
}
@@ -1434,9 +1425,8 @@ rb_str_succ(orig)
if ((*s += 1) != 0) break;
s--;
}
- c = 0;
}
- if (s < sbeg || c > 0) {
+ if (s < sbeg) {
RESIZE_CAPA(str, RSTRING(str)->len + 1);
s = RSTRING(str)->ptr + n;
memmove(s+1, s, RSTRING(str)->len - n);