diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-04 02:23:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-04 02:23:52 +0000 |
commit | 80644b31d5fa315bfe2ef73456557a9c985f88bd (patch) | |
tree | a811d0814fac825c6388953028a5e79864af908d | |
parent | 08494c864328d3d4b5ba2b4dcf0887845e04381d (diff) |
* bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing
preceeding 0s. [ruby-core:13873]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bignum.c | 2 | ||||
-rw-r--r-- | test/ruby/test_integer.rb | 3 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 12 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Dec 4 11:23:50 2007 Nobuyoshi Nakada <[email protected]> + + * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing + preceeding 0s. [ruby-core:13873] + Mon Dec 3 11:51:53 2007 NAKAMURA Usaku <[email protected]> * ext/Win32API/*: removed or moved to ext/dl/win32. @@ -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); diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb index e6fd3e5521..81f8c65797 100644 --- a/test/ruby/test_integer.rb +++ b/test/ruby/test_integer.rb @@ -667,5 +667,8 @@ class TestInteger < Test::Unit::TestCase assert_raise(ArgumentError) { Integer("4611686018427387904 :") } assert_equal(0x4000000000000000, Integer("46_11_686_0184273_87904")) assert_raise(ArgumentError) { Integer("\0") } + assert_nothing_raised(ArgumentError, "[ruby-core:13873]") { + assert_equal(0, Integer("0 ")) + } end end @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-12-03" +#define RUBY_RELEASE_DATE "2007-12-04" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20071203 +#define RUBY_RELEASE_CODE 20071204 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 12 -#define RUBY_RELEASE_DAY 3 +#define RUBY_RELEASE_DAY 4 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |