summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/process.c b/process.c
index 0df7607fd7..e196639b87 100644
--- a/process.c
+++ b/process.c
@@ -1713,6 +1713,7 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
rb_raise(rb_eArgError, "chdir option specified twice");
}
FilePathValue(val);
+ val = rb_str_encode_ospath(val);
eargp->chdir_given = 1;
eargp->chdir_dir = hide_obj(EXPORT_DUP(val));
}
@@ -2313,6 +2314,7 @@ rb_execarg_parent_start1(VALUE execarg_obj)
if (NIL_P(fd2v)) {
struct open_struct open_data;
FilePathValue(vpath);
+ vpath = rb_str_encode_ospath(vpath);
again:
open_data.fname = vpath;
open_data.oflags = flags;
@@ -2967,6 +2969,11 @@ save_env(struct rb_execarg *sargp)
}
#endif
+#ifdef _WIN32
+#undef chdir
+#define chdir(p) rb_w32_uchdir(p)
+#endif
+
/* This function should be async-signal-safe when sargp is NULL. Hopefully it is. */
int
rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)