changeset 6390:9f8ce71435de

(Fstart_process): GCPRO some things.
author Karl Heuer <kwzh@gnu.org>
date Fri, 18 Mar 1994 00:12:41 +0000
parents 9b45e828c2a7
children d4fe8a853557
files src/process.c
diffstat 1 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Thu Mar 17 23:29:16 1994 +0000
+++ b/src/process.c	Fri Mar 18 00:12:41 1994 +0000
@@ -1024,6 +1024,22 @@
 #else /* not VMS */
   new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *));
 
+  /* If program file name is not absolute, search our path for it */
+  if (XSTRING (program)->data[0] != '/')
+    {
+      struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+
+      tem = Qnil;
+      GCPRO4 (name, program, buffer, current_dir);
+      openp (Vexec_path, program, EXEC_SUFFIXES, &tem, 1);
+      UNGCPRO;
+      if (NILP (tem))
+	report_file_error ("Searching for program", Fcons (program, Qnil));
+      new_argv[0] = XSTRING (tem)->data;
+    }
+  else
+    new_argv[0] = XSTRING (program)->data;
+
   for (i = 3; i < nargs; i++)
     {
       tem = args[i];
@@ -1031,17 +1047,6 @@
       new_argv[i - 2] = XSTRING (tem)->data;
     }
   new_argv[i - 2] = 0;
-  new_argv[0] = XSTRING (program)->data;
-
-  /* If program file name is not absolute, search our path for it */
-  if (new_argv[0][0] != '/')
-    {
-      tem = Qnil;
-      openp (Vexec_path, program, EXEC_SUFFIXES, &tem, 1);
-      if (NILP (tem))
-	report_file_error ("Searching for program", Fcons (program, Qnil));
-      new_argv[0] = XSTRING (tem)->data;
-    }
 #endif /* not VMS */
 
   proc = make_process (name);