diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-21 04:57:00 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-21 04:57:00 +0000 |
commit | c2ace60b081c587532ba01ffebd6f4c1fe84e643 (patch) | |
tree | 7b147db2c14f411bb2c658af18349cd814453454 /time.c | |
parent | 1684c86c33688517b7e2b2eabf932c3868730bac (diff) |
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -13,6 +13,7 @@ #include "ruby.h" #include <sys/types.h> #include <time.h> +#include <errno.h> #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -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'; |