summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-18 05:53:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-18 05:53:53 +0000
commit34aea71ca7671712b9a7ea9ecfa82e61e1053b82 (patch)
treeb723afca8ad8b0fa3f28a5192db84ff762efee52
parent48a484c26eb60f411501248890665c71be3fadc6 (diff)
downloadruby-34aea71ca7671712b9a7ea9ecfa82e61e1053b82.tar.gz
ruby-34aea71ca7671712b9a7ea9ecfa82e61e1053b82.tar.xz
ruby-34aea71ca7671712b9a7ea9ecfa82e61e1053b82.zip
* bignum.c (rb_cstr_to_inum): should not erase all 0s, but
squeeze into one. [ruby-dev:19377] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index cd1193a5c..f45382cea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jan 18 14:53:49 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * bignum.c (rb_cstr_to_inum): should not erase all 0s, but
+ squeeze into one. [ruby-dev:19377]
+
Fri Jan 17 03:33:42 2003 Akinori MUSHA <knu@iDaemons.org>
* sprintf.c (rb_f_sprintf): Fix a bug caused by an uninitialized
diff --git a/bignum.c b/bignum.c
index c010bf704..16cb8e160 100644
--- a/bignum.c
+++ b/bignum.c
@@ -392,8 +392,10 @@ rb_cstr_to_inum(str, base, badcheck)
}
break;
}
- while (*str == '0') str++; /* squeeze preceeding 0s */
-
+ if (*str == '0') { /* squeeze preceeding 0s */
+ while (*++str == '0');
+ --str;
+ }
len *= strlen(str)*sizeof(char);
if (len <= (sizeof(VALUE)*CHAR_BIT)) {