summaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-04 02:23:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-04 02:23:52 +0000
commita21dcc1632ce97f447eef0e3dd95484976b79889 (patch)
treea811d0814fac825c6388953028a5e79864af908d /bignum.c
parentd1f8489c1049899152e04dd339566de93ab6dbae (diff)
downloadruby-a21dcc1632ce97f447eef0e3dd95484976b79889.tar.gz
ruby-a21dcc1632ce97f447eef0e3dd95484976b79889.tar.xz
ruby-a21dcc1632ce97f447eef0e3dd95484976b79889.zip
* bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing
preceeding 0s. [ruby-core:13873] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index dd6d7b134..624a4e596 100644
--- a/bignum.c
+++ b/bignum.c
@@ -472,7 +472,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
if (*str == '0') { /* squeeze preceeding 0s */
while (*++str == '0');
- if (!*str) --str;
+ if (!(c = *str) || ISSPACE(c)) --str;
}
c = *str;
c = conv_digit(c);