* strftime.c (rb_strftime): "%^P" should convert to upper case.

[ruby-dev:37180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-11-25 04:42:11 +00:00
Родитель 15b183c218
Коммит a689e57283
2 изменённых файлов: 6 добавлений и 1 удалений

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

@ -1,3 +1,8 @@
Tue Nov 25 10:35:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* strftime.c (rb_strftime): "%^P" should convert to upper case.
[ruby-dev:37180]
Tue Nov 25 07:51:18 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".

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

@ -404,7 +404,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
case 'p': /* AM or PM based on 12-hour clock */
case 'P': /* am or pm based on 12-hour clock */
if ((*format == 'p' && (flags & BIT_OF(CHCASE))) ||
(*format == 'P' && !(flags & BIT_OF(CHCASE)))) {
(*format == 'P' && !(flags & (BIT_OF(CHCASE)|BIT_OF(UPPER))))) {
flags &= ~(BIT_OF(UPPER)|BIT_OF(CHCASE));
flags |= BIT_OF(LOWER);
}