From 5a89f6d95959df9476f2409c38a2e1030937de4a Mon Sep 17 00:00:00 2001 From: tg Date: Wed, 11 Oct 2017 21:04:59 +0000 Subject: [PATCH] update comment to unpuzzle a future me (I just had to use git annotate and look at the two commits from komh to figure out that the condition in the if is correct here and what this is supposed to do) --- exec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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);