diff src/process-unix.c @ 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents 558f606b08ae
children 70ad99077275
line wrap: on
line diff
--- a/src/process-unix.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/process-unix.c	Mon Aug 13 10:35:54 2007 +0200
@@ -715,7 +715,8 @@
 
 static int
 unix_create_process (struct Lisp_Process *p,
-		     char **new_argv, CONST char *current_dir)
+		     Lisp_Object *argv, int nargv,
+		     Lisp_Object program, Lisp_Object cur_dir)
 {
   /* This function rewritten by wing@666.com. */
 
@@ -724,11 +725,26 @@
   volatile int forkin, forkout;
   volatile int pty_flag = 0;
   char **env;
+  char **new_argv;
+  char *current_dir;
+  int i;
 
   env = environ;
 
   inchannel = outchannel = forkin = forkout = -1;
 
+  /* Nothing below here GCs so our string pointers shouldn't move. */
+  new_argv = alloca_array (char *, nargv + 2);
+  new_argv[0] = (char *) XSTRING_DATA (program);
+  for (i = 0; i < nargv; i++)
+    {
+      Lisp_Object tem = argv[i];
+      CHECK_STRING (tem);
+      new_argv[i + 1] = (char *) XSTRING_DATA (tem);
+    }
+  new_argv[i + 1] = 0;
+  current_dir = (char *) XSTRING_DATA (cur_dir);
+
 #ifdef HAVE_PTYS
   if (!NILP (Vprocess_connection_type))
     {