diff options
author | Glenn L McGrath | 2003-09-15 12:00:19 +0000 |
---|---|---|
committer | Glenn L McGrath | 2003-09-15 12:00:19 +0000 |
commit | 47e5ca1ecb2a86b29c8a52ee3ed276d8b27147cf (patch) | |
tree | 51a23e67ceb884f57d8c696e4b6131384b5aa2c2 /shell/ash.c | |
parent | e3e28d3bb64e1b6d2883ee46405d12179b5b8407 (diff) | |
download | busybox-47e5ca1ecb2a86b29c8a52ee3ed276d8b27147cf.zip busybox-47e5ca1ecb2a86b29c8a52ee3ed276d8b27147cf.tar.gz |
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"
"
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 59aa336..2146349 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -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; |