summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-time/src
diff options
context:
space:
mode:
authorHiroshi Mimaki <[email protected]>2020-06-05 12:42:56 +0900
committerHiroshi Mimaki <[email protected]>2020-06-05 12:42:56 +0900
commit81d340e0421daf39a8208a0181d6a54e726db134 (patch)
tree18cefdd763a716dbd27c23bfdf98ffa2135f7624 /mrbgems/mruby-time/src
parentf9d113f7647121f8578742a2a9ac256ece365e3f (diff)
parent4e40169ed6d200918e542aa8d8e64634794e1864 (diff)
downloadmruby-81d340e0421daf39a8208a0181d6a54e726db134.tar.gz
mruby-81d340e0421daf39a8208a0181d6a54e726db134.zip
Merge master.
Diffstat (limited to 'mrbgems/mruby-time/src')
-rw-r--r--mrbgems/mruby-time/src/time.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c
index 5cd4abe6d..e76e11649 100644
--- a/mrbgems/mruby-time/src/time.c
+++ b/mrbgems/mruby-time/src/time.c
@@ -13,6 +13,7 @@
#include <mruby/data.h>
#include <mruby/numeric.h>
#include <mruby/time.h>
+#include <mruby/string.h>
#ifdef MRB_DISABLE_STDIO
#include <string.h>
@@ -954,7 +955,9 @@ mrb_time_to_s(mrb_state *mrb, mrb_value self)
struct mrb_time *tm = time_get_ptr(mrb, self);
mrb_bool utc = tm->timezone == MRB_TIMEZONE_UTC;
size_t len = (utc ? time_to_s_utc : time_to_s_local)(mrb, tm, buf, sizeof(buf));
- return mrb_str_new(mrb, buf, len);
+ mrb_value str = mrb_str_new(mrb, buf, len);
+ RSTR_SET_ASCII_FLAG(mrb_str_ptr(str));
+ return str;
}
void