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:
parent
9ac5a0ca4d
commit
8429f2be9f
1 changed files with 9 additions and 10 deletions
19
bignum.c
19
bignum.c
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue