summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c2
1 files changed, 1 insertions, 1 deletions
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