scriptexec: try to use shell/interpreter name as well on OS/2
If specified path does not exist, try to use shell/interpreter name without directory. On OS/2, directory structures of distribution is quite different. And Some scripts have hard coded shell/interpreter. To overcome this, allow to use shell/interpreter name if specified path does not exist.
This commit is contained in:
parent
25bb7dcec4
commit
b27e10a32e
8
exec.c
8
exec.c
@ -957,6 +957,14 @@ scriptexec(struct op *tp, const char **ap)
|
||||
if (*cp)
|
||||
*tp->args-- = (char *)cp;
|
||||
}
|
||||
#ifdef __OS2__
|
||||
/*
|
||||
* Use shell/interpreter name without directory if specified
|
||||
* path does not exist
|
||||
*/
|
||||
if (ksh_vstrchr_dirsep(sh) && !search_path(sh, path, X_OK, NULL))
|
||||
sh = _getname(sh);
|
||||
#endif
|
||||
goto nomagic;
|
||||
noshebang:
|
||||
m = buf[0] << 8 | buf[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user