summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/process.c b/process.c
index 61a0d01aa9..164a5230a5 100644
--- a/process.c
+++ b/process.c
@@ -2713,7 +2713,8 @@ save_env(struct rb_execarg *sargp)
(VALUE)ary);
sargp->env_modification = ary;
}
- rb_ary_store(soptions, EXEC_OPTION_UNSETENV_OTHERS, Qtrue);
+ sargp->unsetenv_others_given = 1;
+ sargp->unsetenv_others_do = 1;
}
}
#endif
@@ -2751,8 +2752,7 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
#endif
#if !defined(HAVE_FORK)
- obj = rb_ary_entry(options, EXEC_OPTION_UNSETENV_OTHERS);
- if (RTEST(obj)) {
+ if (eargp->unsetenv_others_given && eargp->unsetenv_others_do) {
save_env(sargp);
rb_env_clear();
}