Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* bignum.c (rb_cstr_to_inum): should accept underscores of

	  sequence of two or more when unchecked mode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 2630ad09bd6f959b0379adfba84a6c7b4e4958ff 1 parent 1f225be
tadf authored
Showing with 8 additions and 2 deletions.
  1. +5 −0 ChangeLog
  2. +2 −1  bignum.c
  3. +1 −1  test/ruby/test_string.rb
View
5 ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov 18 20:46:08 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * bignum.c (rb_cstr_to_inum): should accept underscores of
+ sequence of two or more when unchecked mode.
+
Sun Nov 18 16:33:00 2012 Naohisa Goto <ngotogenome@gmail.com>
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
View
3  bignum.c
@@ -733,7 +733,8 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
if (badcheck) goto bad;
break;
}
- nondigit = (char) c;
+ if (badcheck)
+ nondigit = (char) c;
continue;
}
else if ((c = conv_digit(c)) < 0) {
View
2  test/ruby/test_string.rb
@@ -1513,7 +1513,7 @@ def test_to_i
assert_equal(12, "1_2".to_i(10))
assert_equal(0x40000000, "1073741824".to_i(10))
assert_equal(0x4000000000000000, "4611686018427387904".to_i(10))
- assert_equal(1, "1__2".to_i(10))
+ assert_equal(12, "1__2".to_i(10))
assert_equal(1, "1_z".to_i(10))
bug6192 = '[ruby-core:43566]'
Please sign in to comment.
Something went wrong with that request. Please try again.