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

ruby-changes:20910

From: tadf <ko1@a...>
Date: Sat, 13 Aug 2011 09:16:00 +0900 (JST)
Subject: [ruby-changes:20910] tadf:r32959 (ruby_1_9_3): * ext/date/date_core.c (date_strftime_alloc): followed the change

tadf	2011-08-13 09:15:50 +0900 (Sat, 13 Aug 2011)

  New Revision: 32959

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

  Log:
    * ext/date/date_core.c (date_strftime_alloc): followed the change
      of r32885.
    * NEWS: followed the above change.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/NEWS
    branches/ruby_1_9_3/ext/date/date_core.c

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32958)
+++ ruby_1_9_3/ChangeLog	(revision 32959)
@@ -1,3 +1,9 @@
+Sat Aug 13 09:15:16 2011  Tadayoshi Funaba  <tadf@d...>
+
+	* ext/date/date_core.c (date_strftime_alloc): followed the change
+	  of r32885.
+	* NEWS: followed the above change.
+
 Sat Aug 13 08:49:05 2011  Tadayoshi Funaba  <tadf@d...>
 
 	* ext/date/date_core.c: [ruby-core:38855].
Index: ruby_1_9_3/ext/date/date_core.c
===================================================================
--- ruby_1_9_3/ext/date/date_core.c	(revision 32958)
+++ ruby_1_9_3/ext/date/date_core.c	(revision 32959)
@@ -6721,8 +6721,12 @@
 	 * if the buffer is 1024 times bigger than the length of the
 	 * format string, it's not failing for lack of room.
 	 */
-	if (len > 0 || size >= 1024 * flen) break;
+	if (len > 0) break;
 	xfree(*buf);
+	if (size >= 1024 * flen) {
+	    rb_sys_fail(format);
+	    break;
+	}
     }
     return len;
 }
Index: ruby_1_9_3/NEWS
===================================================================
--- ruby_1_9_3/NEWS	(revision 32958)
+++ ruby_1_9_3/NEWS	(revision 32959)
@@ -163,10 +163,10 @@
 
   * A method strftime cannot produce huge output (same as Time's one).
 
-    * Even though Date/DateTime can handle far dates, the following gives
-      an empty string:
+    * Even though Date/DateTime can handle far dates, the following causes
+      an exception.
 
-      DateTime.new(1<<10000).strftime('%Y')  #=> ""
+      DateTime.new(1<<10000).strftime('%Y')  # Errno::ERANGE
 
   * Changed the format of inspect.
   * Changed the format of marshal (but, can load old dumps).

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

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