1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merges r20944 from trunk into ruby_1_9_1.

* strftime.c (rb_strftime): use locale insensitive functions for tr_TR
  locale.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2008-12-25 09:53:58 +00:00
parent 2562e1faef
commit ae4b0c25f0
3 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 23 18:44:21 2008 Tanaka Akira <akr@fsij.org>
* strftime.c (rb_strftime): use locale insensitive functions for tr_TR
locale.
Tue Dec 23 17:38:03 2008 Tanaka Akira <akr@fsij.org> Tue Dec 23 17:38:03 2008 Tanaka Akira <akr@fsij.org>
* lib/test/unit/assertions.rb (assert_equal): show small differences * lib/test/unit/assertions.rb (assert_equal): show small differences

View file

@ -627,8 +627,8 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
timeptr->tm_year + 1900L); timeptr->tm_year + 1900L);
if (w < 0) goto err; if (w < 0) goto err;
for (i = 3; i < 6; i++) for (i = 3; i < 6; i++)
if (islower(s[i])) if (ISLOWER(s[i]))
s[i] = toupper(s[i]); s[i] = TOUPPER(s[i]);
s += w; s += w;
continue; continue;
#endif #endif
@ -781,12 +781,12 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
switch (flags & (BIT_OF(UPPER)|BIT_OF(LOWER))) { switch (flags & (BIT_OF(UPPER)|BIT_OF(LOWER))) {
case BIT_OF(UPPER): case BIT_OF(UPPER):
do { do {
if (islower(*s)) *s = toupper(*s); if (ISLOWER(*s)) *s = TOUPPER(*s);
} while (s++, --i); } while (s++, --i);
break; break;
case BIT_OF(LOWER): case BIT_OF(LOWER):
do { do {
if (isupper(*s)) *s = tolower(*s); if (ISUPPER(*s)) *s = TOLOWER(*s);
} while (s++, --i); } while (s++, --i);
break; break;
default: default:

View file

@ -468,5 +468,6 @@ class TestTime < Test::Unit::TestCase
assert_equal("JAN", T2000.strftime("%#b")) assert_equal("JAN", T2000.strftime("%#b"))
assert_equal("JANUARY", T2000.strftime("%#B")) assert_equal("JANUARY", T2000.strftime("%#B"))
assert_equal("JAN", T2000.strftime("%#h")) assert_equal("JAN", T2000.strftime("%#h"))
assert_equal("FRIDAY", Time.local(2008,1,4).strftime("%#A"))
end end
end end