diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-23 06:25:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-23 06:25:06 +0000 |
commit | 9430d7d8031fd7405420614ce1364fae80cc549f (patch) | |
tree | 695f09a4b95c757850016283d4c91e5e77d5932d | |
parent | e94ece76d8d73b5e8a61531fe68f5e08ee78f8dc (diff) | |
download | ruby-9430d7d8031fd7405420614ce1364fae80cc549f.tar.gz |
* time.c (time_strftime): copy encoding from format. [ruby-dev:33303]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | time.c | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Wed Jan 23 15:25:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * time.c (time_strftime): copy encoding from format. [ruby-dev:33303] + Wed Jan 23 15:04:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * string.c (str_make_independent): should set length. @@ -2065,6 +2065,7 @@ rb_strftime(char **buf, const char *format, struct tm *time) static VALUE time_strftime(VALUE time, VALUE format) { + void rb_enc_copy(VALUE, VALUE); struct time_object *tobj; char buffer[SMALLBUF], *buf = buffer; const char *fmt; @@ -2105,6 +2106,7 @@ time_strftime(VALUE time, VALUE format) } str = rb_str_new(buf, len); if (buf != buffer) free(buf); + rb_enc_copy(str, format); return str; } |