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

* strftime.c (STRFTIME): should add padding for %[xXrR] etc.

[ruby-dev:37185] fix: #792

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-11-25 15:28:22 +00:00
parent 405b527276
commit 6099790621
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Nov 26 00:26:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* strftime.c (STRFTIME): should add padding for %[xXrR] etc.
[ruby-dev:37185] fix: #792
Tue Nov 25 16:26:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_times): taint (and untrust) status should be

View file

@ -295,7 +295,12 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
do { \
i = strftime(s, endp - s, fmt, tm); \
if (!i) return 0; \
s += i; \
if (precision > i) {\
memmove(s + precision - i, s, i);\
memset(s, padding ? padding : ' ', precision - i); \
s += precision; \
}\
else s += i; \
} while (0)
if (*format != '%') {