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

date_core.c: append strings

* ext/date/date_core.c (dt_lite_iso8601): strftimev() always
  returns a String, so append them directly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-03-24 03:43:28 +00:00
parent c85040d4d0
commit 8d23c8bf3b
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,7 @@
Thu Mar 24 12:43:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
Thu Mar 24 12:43:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/date/date_core.c (dt_lite_iso8601): strftimev() always
returns a String, so append them directly.
* ext/date/date_core.c (d_lite_jisx0301, iso8601_timediv),
(dt_lite_jisx0301): format by the format string in local buffer

View file

@ -8350,8 +8350,8 @@ dt_lite_iso8601(int argc, VALUE *argv, VALUE self)
if (argc >= 1)
n = NUM2LONG(argv[0]);
return f_add(strftimev("%Y-%m-%d", self, set_tmx),
iso8601_timediv(self, n));
return rb_str_append(strftimev("%Y-%m-%d", self, set_tmx),
iso8601_timediv(self, n));
}
/*