[前][次][番号順一覧][スレッド一覧]

ruby-changes:29666

From: akr <ko1@a...>
Date: Mon, 1 Jul 2013 12:04:22 +0900 (JST)
Subject: [ruby-changes:29666] akr:r41718 (trunk): * bignum.c (rb_cstr_to_inum): Skip leading zeros.

akr	2013-07-01 12:04:07 +0900 (Mon, 01 Jul 2013)

  New Revision: 41718

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41718

  Log:
    * bignum.c (rb_cstr_to_inum): Skip leading zeros.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41717)
+++ ChangeLog	(revision 41718)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul  1 12:02:39 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (rb_cstr_to_inum): Skip leading zeros.
+
 Mon Jul  1 00:59:23 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (nlz16): New function.
Index: bignum.c
===================================================================
--- bignum.c	(revision 41717)
+++ bignum.c	(revision 41718)
@@ -2028,6 +2028,9 @@ rb_cstr_to_inum(const char *str, int bas https://github.com/ruby/ruby/blob/trunk/bignum.c#L2028
 	}
     }
 
+    while (buf < p && *buf == 0)
+        buf++;
+
     if (POW2_P(base)) {
         int flags = INTEGER_PACK_BIG_ENDIAN;
         if (!sign)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]