diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 15:54:44 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 15:54:44 +0000 |
commit | 77d7a80f9778d415165fff1c7ce0bf99b96b9ef3 (patch) | |
tree | 40678a446786335bcdc9df96f99b7f1406254671 /strftime.c | |
parent | 9f3170663638393b60e39828b1b39e06201e8a7b (diff) | |
download | ruby-77d7a80f9778d415165fff1c7ce0bf99b96b9ef3.tar.gz |
* strftime.c (rb_strftime): fixed a bug of padding.
* test/ruby/test_time.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r-- | strftime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/strftime.c b/strftime.c index 2b8033cf28..fa0e6e6a69 100644 --- a/strftime.c +++ b/strftime.c @@ -277,7 +277,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept if (precision <= 0) precision = (def_prec); \ if (flags & BIT_OF(LEFT)) precision = 1; \ l = snprintf(s, endp - s, \ - ((!padding || padding == (def_pad)) ? "%.*"fmt : "%*"fmt), \ + ((padding == '0' || (!padding && def_pad == '0')) ? "%.*"fmt : "%*"fmt), \ precision, val); \ if (l < 0) goto err; \ s += l; \ |