From 8501e324596fbad9040718d568d12a460e7cf798 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 7 Feb 2019 11:22:22 +0000 Subject: 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. --- win32/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') 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) return 1; } - if (is_suffixed_with_case(cmd, ".sh")) { + if (n >= 0 && is_suffixed_with_case(cmd, ".sh")) { interp->path = (char *)DEFAULT_SHELL; interp->name = (char *)DEFAULT_SHELL_SHORT_NAME; interp->opts = NULL; -- cgit v1.2.3-55-g6feb