summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index 7718461bbf..d0130ec7d3 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1381,8 +1381,9 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
long i;
VALUE load_path = GET_VM()->load_path;
for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- RARRAY_ASET(load_path, i,
- rb_enc_associate(rb_str_dup(RARRAY_AREF(load_path, i)), lenc));
+ VALUE path = RARRAY_AREF(load_path, i);
+ path = rb_enc_associate(rb_str_dup(path), lenc);
+ RARRAY_ASET(load_path, i, path);
}
}
Init_ext(); /* load statically linked extensions before rubygems */