From 0a4de642e4db66aa01ea94790c5c9ce78eb75906 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 15 Jun 1995 15:29:00 +0000 Subject: [PATCH] (win32_spawnve): Accept program names without executable suffixes. --- src/w32proc.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/w32proc.c b/src/w32proc.c index 981876e6b16..e7834d6a452 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -427,10 +427,30 @@ char ppid_env_var_buffer[64]; int win32_spawnve (int mode, char *cmdname, char **argv, char **envp) { + Lisp_Object program, full; char *cmdline, *env, *parg, **targ; int arglen; PROCESS_INFORMATION pi; - + + /* Handle executable names without an executable suffix. */ + program = make_string (cmdname, strlen (cmdname)); + if (NILP (Ffile_executable_p (program))) + { + struct gcpro gcpro1; + + full = Qnil; + GCPRO1 (program); + openp (Vexec_path, program, EXEC_SUFFIXES, &full, 1); + UNGCPRO; + if (NILP (full)) + { + errno = EINVAL; + return -1; + } + cmdname = XSTRING (full)->data; + argv[0] = cmdname; + } + if (child_proc_count == MAX_CHILDREN) { errno = EAGAIN; -- 2.39.2