* time.c (time_asctime): workaround for MSVCRT's bug.

based on a patch from wanabe <s.wanabe AT gmail.com> at
	  [ruby-dev:35831] and a suggestion by KIMURA Koichi
	  <kbk AT kt.rim.or.jp> at [ruby-dev:35832]
	  fixed [ruby-dev:35555]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-08-26 13:47:17 +00:00
Родитель 19ab08653e
Коммит 8039100c0a
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Tue Aug 26 22:44:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* time.c (time_asctime): workaround for MSVCRT's bug.
based on a patch from wanabe <s.wanabe AT gmail.com> at
[ruby-dev:35831] and a suggestion by KIMURA Koichi
<kbk AT kt.rim.or.jp> at [ruby-dev:35832]
fixed [ruby-dev:35555]
Tue Aug 26 21:53:56 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (rb_econv_open): disable newline conversion for ASCII

4
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);
}