diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-07 11:22:22 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-07 11:22:22 +0000 |
commit | 8501e324596fbad9040718d568d12a460e7cf798 (patch) | |
tree | 55626404a9afa7df1c51cd63ab81bf529fd3c305 /win32 | |
parent | c9b1e40ba52bd1f167189f52563a47c85df9881f (diff) | |
download | busybox-w32-8501e324596fbad9040718d568d12a460e7cf798.tar.gz busybox-w32-8501e324596fbad9040718d568d12a460e7cf798.tar.bz2 busybox-w32-8501e324596fbad9040718d568d12a460e7cf798.zip |
win32: don't try to run non-existent script
In parse_interpreter return an error when the file doesn't exist.
The current code tries to run non-existent scripts with a .sh suffix,
thus breaking the test ash-misc/exec.tests.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c index 7210934fe..46efdc160 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -66,7 +66,7 @@ parse_interpreter(const char *cmd, interp_t *interp) | |||
66 | return 1; | 66 | return 1; |
67 | } | 67 | } |
68 | 68 | ||
69 | if (is_suffixed_with_case(cmd, ".sh")) { | 69 | if (n >= 0 && is_suffixed_with_case(cmd, ".sh")) { |
70 | interp->path = (char *)DEFAULT_SHELL; | 70 | interp->path = (char *)DEFAULT_SHELL; |
71 | interp->name = (char *)DEFAULT_SHELL_SHORT_NAME; | 71 | interp->name = (char *)DEFAULT_SHELL_SHORT_NAME; |
72 | interp->opts = NULL; | 72 | interp->opts = NULL; |