From 8f86f5d691be7419eed21ec45b2e23d20c53c259 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 3 Jun 2016 09:06:19 +0000 Subject: * ruby.c (process_options): need to duplicate path before passing it to rb_str_conv_enc() because the function might call rb_enc_associate() internally. this fixes test failures on Windows introduced at r55260. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ruby.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6e7d299f0b..a2631aae85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jun 3 18:04:37 2016 NAKAMURA Usaku + + * ruby.c (process_options): need to duplicate path before passing it to + rb_str_conv_enc() because the function might call rb_enc_associate() + internally. this fixes test failures on Windows introduced at r55260. + Fri Jun 3 17:44:25 2016 Reiner Herrmann * lib/mkmf.rb (create_makefile): sort lists of source and object diff --git a/ruby.c b/ruby.c index cc71bd5e8b..37a0029a11 100644 --- a/ruby.c +++ b/ruby.c @@ -1568,7 +1568,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt) VALUE path = RARRAY_AREF(load_path, i); int mark = rb_attr_get(path, id_initial_load_path_mark) == path; #if UTF8_PATH - path = rb_str_conv_enc(path, uenc, lenc); + path = rb_str_conv_enc(rb_str_dup(path), uenc, lenc); #else path = rb_enc_associate(rb_str_dup(path), lenc); #endif -- cgit v1.2.3