diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | time.c | 4 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Sun Jun 15 22:16:21 2008 NAKAMURA Usaku <[email protected]> + + * time.c (rb_strftime): check errno to detect strftime(3)'s error. + this is workaround for recent version of MSVCRT. + [ruby-dev:34456] + Sun Jun 15 22:12:07 2008 Akinori MUSHA <[email protected]> * lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit; @@ -18,6 +18,7 @@ #include <unistd.h> #endif +#include <errno.h> #include <math.h> VALUE rb_cTime; @@ -1776,8 +1777,9 @@ rb_strftime(buf, format, time) if (flen == 0) { return 0; } + errno = 0; len = strftime(*buf, SMALLBUF, format, time); - if (len != 0 || **buf == '\0') return len; + if (len != 0 || (**buf == '\0' && errno != ERANGE)) return len; for (size=1024; ; size*=2) { *buf = xmalloc(size); (*buf)[0] = '\0'; @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-15" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20080615 -#define RUBY_PATCHLEVEL 196 +#define RUBY_PATCHLEVEL 197 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |