diff --git a/ChangeLog b/ChangeLog index df348e3934..969c47fa89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Aug 26 22:44:12 2008 NAKAMURA Usaku + + * time.c (time_asctime): workaround for MSVCRT's bug. + based on a patch from wanabe at + [ruby-dev:35831] and a suggestion by KIMURA Koichi + at [ruby-dev:35832] + fixed [ruby-dev:35555] + Tue Aug 26 21:53:56 2008 Tanaka Akira * transcode.c (rb_econv_open): disable newline conversion for ASCII diff --git a/time.c b/time.c index a6d9df73b9..b111bca647 100644 --- a/time.c +++ b/time.c @@ -1367,6 +1367,10 @@ time_asctime(VALUE time) } s = ASCTIME(&tobj->tm, buf); if (s[24] == '\n') s[24] = '\0'; +#if (defined(_MSC_VER) && defined(_DLL)) || defined(__MSVCRT__) + /* workaround for MSVCRT's bug */ + if (s[8] == '0') s[8] = ' '; +#endif return rb_str_new2(s); }