From b446727285d7f27998f08b409f7074921257f56a Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 2 Apr 2017 15:02:40 +0000 Subject: [PATCH] do not use getenv() to allow users to change OS2_SHELL during the session --- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 817168b..89726a9 100644 --- a/exec.c +++ b/exec.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.193 2017/04/02 15:00:42 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.194 2017/04/02 15:02:40 tg Exp $"); #ifndef MKSH_DEFAULT_EXECSHELL #define MKSH_DEFAULT_EXECSHELL MKSH_UNIXROOT "/bin/sh" @@ -982,7 +982,7 @@ scriptexec(struct op *tp, const char **ap) cp = _getext(tp->str); if (cp && (!stricmp(cp, ".cmd") || !stricmp(cp, ".bat"))) { /* execute .cmd and .bat with OS2_SHELL, usually CMD.EXE */ - sh = getenv("OS2_SHELL"); + sh = str_val(global("OS2_SHELL")); *tp->args-- = "/c"; /* convert slahes to backslashes */ for (cp = tp->str; *cp; cp++) {