1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

adjustment

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2008-01-30 11:20:03 +00:00
parent 9ac5a0ca4d
commit 8429f2be9f

View file

@ -470,16 +470,15 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
break;
}
if (*str == '0') { /* squeeze preceding 0s */
int nn = 0;
while ((c = *++str) == '0' || c == '_') {
if (c == '_') {
nn++;
if (nn >= 2)
break;
} else
nn = 0;
}
if (!(c = *str) || ISSPACE(c)) --str;
int us = 0;
while ((c = *++str) == '0' || c == '_') {
if (c == '_') {
if (++us >= 2)
break;
} else
us = 0;
}
if (!(c = *str) || ISSPACE(c)) --str;
}
c = *str;
c = conv_digit(c);