summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-19 05:36:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-19 05:36:43 +0000
commit2188bbced38b801bac2c7a342f50975a591bd512 (patch)
tree134e5f87be2fa1e6b876c268f1d04801f703c86d /bignum.c
parent555eb7ded4e1fb54c434dcdd3c8348881a2a6765 (diff)
* bignum.c (rb_cstr_to_inum): treat successive underscores as
nondigit. [ruby-dev:34089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bignum.c b/bignum.c
index d06bf6a6c0..72bb917cf7 100644
--- a/bignum.c
+++ b/bignum.c
@@ -532,10 +532,11 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
for (i=len;i--;) zds[i]=0;
while ((c = *str++) != 0) {
if (c == '_') {
- if (badcheck) {
- if (nondigit) goto bad;
- nondigit = c;
+ if (nondigit) {
+ if (badcheck) goto bad;
+ break;
}
+ nondigit = c;
continue;
}
else if ((c = conv_digit(c)) < 0) {