Patch by Jean Wolter to fix a bug where a script wouldnt be executed

unless it had #!/bin/sh in the first line

"It correctly locates the script, tries to execute it via execve which
fails. After that it tries to hand it over to /bin/sh which fails too,
since ash

    - neither provides the absolute pathname to /bin/sh
    - nor tries to lookup the script via PATH if called as "sh script"
"
This commit is contained in:
Glenn L McGrath 2003-09-15 12:00:19 +00:00
parent e3e28d3bb6
commit 47e5ca1ecb

View File

@ -3729,7 +3729,10 @@ repeat:
for (ap = argv; *ap; ap++)
;
ap = new = ckmalloc((ap - argv + 2) * sizeof(char *));
*ap++ = cmd = (char *)DEFAULT_SHELL;
ap[1] = cmd;
*ap = cmd = (char *)DEFAULT_SHELL;
ap += 2;
argv++;
while ((*ap++ = *argv++))
;
argv = new;