summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/bignum.c b/bignum.c
index 3b62b28442..38513c2373 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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);