mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
e94ece76d8
commit
9430d7d803
2 changed files with 6 additions and 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.
|
||||
|
|
2
time.c
2
time.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue