diff options
author | Michael Gran <spk121@yahoo.com> | 2021-01-22 20:49:04 -0800 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2021-03-10 02:00:15 -0800 |
commit | 1b697d339b3616f4a868585b4f9ccb754b5bea57 (patch) | |
tree | e017d995d7903cf35238c357e5eb72635bc713da | |
parent | 653cc0bf953a11432f77ade9c007848e947cc430 (diff) | |
download | guile-1b697d339b3616f4a868585b4f9ccb754b5bea57.tar.gz |
remove 2nd attempt at invoking ComSpec when spawning child
The start_child procedure is used to spawn a child process. If it fails
to launch the given argv[0] as if it were a command, it has logic to
retry using the ComSpec as a command interpreter, treating argv[0] as
a batch file name. Usually, this fails because batch files would have
been handled in the first pass if they were valid. Also, this has
the unfortunate side effect of spawning a shell awaiting user input.
It is safer to remove this attempt.
* libguile/posix-w32.c (start_child): remove fallback processing
-rw-r--r-- | libguile/posix-w32.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/libguile/posix-w32.c b/libguile/posix-w32.c index e4a03eb6a..6302eecbe 100644 --- a/libguile/posix-w32.c +++ b/libguile/posix-w32.c @@ -1,4 +1,4 @@ -/* Copyright 2001,2006,2008,2016,2018 +/* Copyright 2001,2006,2008,2016,2018,2021 Free Software Foundation, Inc. This file is part of Guile. @@ -740,22 +740,6 @@ start_child (const char *exec_file, char **argv, CloseHandle (herr); CloseHandle (pi.hThread); - /* Posix requires to call the shell if execvp fails to invoke EXEC_FILE. */ - if (errno_save == ENOEXEC || errno_save == ENOENT) - { - const char *shell = getenv ("ComSpec"); - - if (!shell) - shell = "cmd.exe"; - - if (c_strcasecmp (exec_file, shell) != 0) - { - argv[0] = (char *)exec_file; - return start_child (shell, argv, reading, c2p, writing, p2c, - infd, outfd, errfd); - } - } - errno = errno_save; return pid; } |