changeset 12239:ff7738cdbd99

(win32_spawnve): Accept program names without executable suffixes.
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Jun 1995 15:29:00 +0000
parents f442c22815b8
children 15c642f6c1a1
files src/w32proc.c
diffstat 1 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32proc.c	Thu Jun 15 15:28:34 1995 +0000
+++ b/src/w32proc.c	Thu Jun 15 15:29:00 1995 +0000
@@ -427,10 +427,30 @@
 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;