* 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
parent 15b183c218
commit a689e57283
2 changed files with 6 additions and 1 deletions

View File

@ -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".

View File

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