summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-30 09:24:34 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-30 09:24:34 +0000
commitc0888f3aa069317a7d1e95a03d56aa72990f2063 (patch)
tree81214231bda5cf274f8c1c343325b3c5362ad2f4
parent7c2170a53f2de57e461fb7a0cbbe5a4961261669 (diff)
downloadruby-c0888f3aa069317a7d1e95a03d56aa72990f2063.tar.gz
ruby-c0888f3aa069317a7d1e95a03d56aa72990f2063.tar.xz
ruby-c0888f3aa069317a7d1e95a03d56aa72990f2063.zip
merges r20367 from trunk into ruby_1_9_1.
* strftime.c (STRFTIME): use rb_strftime() recursively, instead of platform's strftime(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--strftime.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 150438962..fdb85a4e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Nov 26 23:15:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * strftime.c (STRFTIME): use rb_strftime() recursively, instead of
+ platform's strftime().
+
Wed Nov 26 22:46:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zero
diff --git a/strftime.c b/strftime.c
index e2c8d5fab..79c5fe4fa 100644
--- a/strftime.c
+++ b/strftime.c
@@ -291,9 +291,9 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
if (l < 0) goto err; \
s += l; \
} while (0)
-#define STRFTIME(fmt, tm) \
+#define STRFTIME(fmt) \
do { \
- i = strftime(s, endp - s, fmt, tm); \
+ i = rb_strftime(s, endp - s, fmt, timeptr, ts, gmt); \
if (!i) return 0; \
if (precision > i) {\
memmove(s + precision - i, s, i);\
@@ -370,7 +370,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
break;
case 'c': /* appropriate date and time representation */
- STRFTIME("%a %b %e %H:%M:%S %Y", timeptr);
+ STRFTIME("%a %b %e %H:%M:%S %Y");
continue;
case 'd': /* day of the month, 01 - 31 */
@@ -444,11 +444,11 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
continue;
case 'x': /* appropriate date representation */
- STRFTIME("%m/%d/%y", timeptr);
+ STRFTIME("%m/%d/%y");
continue;
case 'X': /* appropriate time representation */
- STRFTIME("%H:%M:%S", timeptr);
+ STRFTIME("%H:%M:%S");
continue;
case 'y': /* year without a century, 00 - 99 */
@@ -581,7 +581,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
continue;
case 'D': /* date as %m/%d/%y */
- STRFTIME("%m/%d/%y", timeptr);
+ STRFTIME("%m/%d/%y");
continue;
case 'e': /* day of month, blank padded */
@@ -589,15 +589,15 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
continue;
case 'r': /* time as %I:%M:%S %p */
- STRFTIME("%I:%M:%S %p", timeptr);
+ STRFTIME("%I:%M:%S %p");
continue;
case 'R': /* time as %H:%M */
- STRFTIME("%H:%M", timeptr);
+ STRFTIME("%H:%M");
continue;
case 'T': /* time as %H:%M:%S */
- STRFTIME("%H:%M:%S", timeptr);
+ STRFTIME("%H:%M:%S");
continue;
#endif