зеркало из https://github.com/github/ruby.git
* strftime.c (STRFTIME): use rb_strftime() recursively, instead of
platform's strftime(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0434b0f098
Коммит
b0f3bd5d25
|
@ -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>
|
Wed Nov 26 22:46:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zero
|
* ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zero
|
||||||
|
|
18
strftime.c
18
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; \
|
if (l < 0) goto err; \
|
||||||
s += l; \
|
s += l; \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define STRFTIME(fmt, tm) \
|
#define STRFTIME(fmt) \
|
||||||
do { \
|
do { \
|
||||||
i = strftime(s, endp - s, fmt, tm); \
|
i = rb_strftime(s, endp - s, fmt, timeptr, ts, gmt); \
|
||||||
if (!i) return 0; \
|
if (!i) return 0; \
|
||||||
if (precision > i) {\
|
if (precision > i) {\
|
||||||
memmove(s + precision - i, s, 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;
|
break;
|
||||||
|
|
||||||
case 'c': /* appropriate date and time representation */
|
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;
|
continue;
|
||||||
|
|
||||||
case 'd': /* day of the month, 01 - 31 */
|
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;
|
continue;
|
||||||
|
|
||||||
case 'x': /* appropriate date representation */
|
case 'x': /* appropriate date representation */
|
||||||
STRFTIME("%m/%d/%y", timeptr);
|
STRFTIME("%m/%d/%y");
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'X': /* appropriate time representation */
|
case 'X': /* appropriate time representation */
|
||||||
STRFTIME("%H:%M:%S", timeptr);
|
STRFTIME("%H:%M:%S");
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'y': /* year without a century, 00 - 99 */
|
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;
|
continue;
|
||||||
|
|
||||||
case 'D': /* date as %m/%d/%y */
|
case 'D': /* date as %m/%d/%y */
|
||||||
STRFTIME("%m/%d/%y", timeptr);
|
STRFTIME("%m/%d/%y");
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'e': /* day of month, blank padded */
|
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;
|
continue;
|
||||||
|
|
||||||
case 'r': /* time as %I:%M:%S %p */
|
case 'r': /* time as %I:%M:%S %p */
|
||||||
STRFTIME("%I:%M:%S %p", timeptr);
|
STRFTIME("%I:%M:%S %p");
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'R': /* time as %H:%M */
|
case 'R': /* time as %H:%M */
|
||||||
STRFTIME("%H:%M", timeptr);
|
STRFTIME("%H:%M");
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'T': /* time as %H:%M:%S */
|
case 'T': /* time as %H:%M:%S */
|
||||||
STRFTIME("%H:%M:%S", timeptr);
|
STRFTIME("%H:%M:%S");
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче