diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-27 09:53:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-27 09:53:54 +0000 |
commit | 5dc0c522cbf4e4dec223c4e656d82a98ce36d9a8 (patch) | |
tree | 784911cf931d531dd56686988d3c8238eb33913c /bignum.c | |
parent | fb397e335b960cacfa3f5ac84d0eccccc9c222a3 (diff) |
* bignum.c (rb_cstr2inum): deny "0_".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -241,18 +241,9 @@ rb_cstr2inum(str, base) } len = 4; } - if (*str == '0') { - do str++; while (*str == '0'); - if (!*str) return INT2FIX(0); - while (*str == '_') str++; - if (!*str) str--; - if (ISSPACE(*str)) { - if (badcheck) { - while (ISSPACE(*str)) str++; - if (*str) goto bad; - } - return INT2FIX(0); - } + if (*str == '0') { /* squeeze preceeding 0s */ + while (*++str == '0'); + --str; } len *= strlen(str)*sizeof(char); |