aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 4c23286c1..510a86cab 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8387,10 +8387,6 @@ static int builtinloc = -1; /* index in path of %builtin, or -1 */
8387static void 8387static void
8388tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, char **envp) 8388tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, char **envp)
8389{ 8389{
8390#if ENABLE_PLATFORM_MINGW32
8391 char *new_cmd;
8392#endif
8393
8394#if ENABLE_FEATURE_SH_STANDALONE 8390#if ENABLE_FEATURE_SH_STANDALONE
8395 if (applet_no >= 0) { 8391 if (applet_no >= 0) {
8396 if (APPLET_IS_NOEXEC(applet_no)) { 8392 if (APPLET_IS_NOEXEC(applet_no)) {
@@ -8408,13 +8404,11 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, c
8408#endif 8404#endif
8409 8405
8410#if ENABLE_PLATFORM_MINGW32 8406#if ENABLE_PLATFORM_MINGW32
8411 /* ensure we have a path to a real, executable file */ 8407 {
8412 if (!(new_cmd=add_win32_extension(cmd)) && !file_is_executable(cmd)) { 8408 char *new_cmd = add_win32_extension(cmd);
8413 errno = EACCES; 8409 execve(new_cmd ? new_cmd : cmd, argv, envp);
8414 return; 8410 free(new_cmd);
8415 } 8411 }
8416 execve(new_cmd ? new_cmd : cmd, argv, envp);
8417 free(new_cmd);
8418 /* skip POSIX-mandated retry on ENOEXEC */ 8412 /* skip POSIX-mandated retry on ENOEXEC */
8419#else 8413#else
8420 repeat: 8414 repeat: