summaryrefslogtreecommitdiff
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
commit6b7054a0061268f5d3c06f6dc730357fb2a44530 (patch)
tree6b02c3943715b154ff61e34e341e39cc7cca5a37
parent2652fd79553be6df7c82286a4f6e646b2143a8e4 (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/branches/ruby_1_8@15799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e164eb74e1c..035bf06313c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 19 14:36:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_cstr_to_inum): treat successive underscores as
+ nondigit. [ruby-dev:34089]
+
Wed Mar 19 00:01:23 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/erb.rb (ERB::Compiler): Make some minor code optimization.
diff --git a/bignum.c b/bignum.c
index 6d1b5547a5c..8fdcf726532 100644
--- a/bignum.c
+++ b/bignum.c
@@ -512,10 +512,11 @@ rb_cstr_to_inum(str, base, 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) {