diff --git a/exec.c b/exec.c index 56a42f6..a206e2a 100644 --- a/exec.c +++ b/exec.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.199 2017/08/07 21:16:31 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.200 2017/10/11 21:04:59 tg Exp $"); #ifndef MKSH_DEFAULT_EXECSHELL #define MKSH_DEFAULT_EXECSHELL MKSH_UNIXROOT "/bin/sh" @@ -953,8 +953,12 @@ scriptexec(struct op *tp, const char **ap) } #ifdef __OS2__ /* - * Search shell/interpreter name without directory in PATH - * if specified path does not exist + * On OS/2, the directory structure differs from normal + * Unix, which can make many scripts whose shebang + * hardcodes the path to an interpreter fail (and there + * might be no /usr/bin/env); for user convenience, if + * the specified interpreter is not usable, do a PATH + * search to find it. */ if (mksh_vdirsep(sh) && !search_path(sh, path, X_OK, NULL)) { cp = search_path(_getname(sh), path, X_OK, NULL);