summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-13 00:12:05 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-13 00:12:05 +0000
commit0acaab201a821bc6591598775ffc6b6c4980ba9d (patch)
tree0dc788e458e1c53f0d91bdf1dae7022c66dcd948
parentb5f05971f5349753966067e9af2555801a32c1ac (diff)
* ext/date/date_core.c (date_strftime_alloc): followed the change
of r32885. * doc/NEWS-1.9.3: followed the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--doc/NEWS-1.9.36
-rw-r--r--ext/date/date_core.c6
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index afca33f16f9..d8f31d1ec8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Aug 13 09:05:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (date_strftime_alloc): followed the change
+ of r32885.
+ * doc/NEWS-1.9.3: followed the above change.
+
Sat Aug 13 08:55:38 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
diff --git a/doc/NEWS-1.9.3 b/doc/NEWS-1.9.3
index 1920f197b7f..b2b0e8f65c3 100644
--- a/doc/NEWS-1.9.3
+++ b/doc/NEWS-1.9.3
@@ -145,10 +145,10 @@ with all sufficient information, see the ChangeLog file.
* 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).
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 64740740284..c78eda47a96 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -6721,8 +6721,12 @@ date_strftime_alloc(char **buf, const char *format,
* 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;
}