XEmacs 21.2.24 "Hecate".
[chise/xemacs-chise.git.1] / src / callproc.c
index 5bdcb78..2b45793 100644 (file)
@@ -81,6 +81,7 @@ int synch_process_retcode;
 /* Nonzero if this is termination due to exit.  */
 static int call_process_exited;
 
+Lisp_Object Vlisp_EXEC_SUFFIXES;
 
 static Lisp_Object
 call_process_kill (Lisp_Object fdpid)
@@ -193,7 +194,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you
 
   /* Do this before building new_argv because GC in Lisp code
    *  called by various filename-hacking routines might relocate strings */
-  locate_file (Vexec_path, args[0], EXEC_SUFFIXES, &path, X_OK);
+  locate_file (Vexec_path, args[0], Vlisp_EXEC_SUFFIXES, &path, X_OK);
 
   /* Make sure that the child will be able to chdir to the current
      buffer's current directory, or its unhandled equivalent.  We
@@ -286,8 +287,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you
        CHECK_STRING (args[i]);
        new_argv[i - 3] = (char *) XSTRING_DATA (args[i]);
       }
-    new_argv[nargs - 3] = 0;
   }
+  new_argv[max(nargs - 3,1)] = 0;
 
   if (NILP (path))
     report_file_error ("Searching for program", Fcons (args[0], Qnil));
@@ -449,7 +450,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you
        nread = 0;
        while (nread < bufsize - 1024)
          {
-           int this_read
+           ssize_t this_read
              = Lstream_read (XLSTREAM (instream), bufptr + nread,
                              bufsize - nread);
 
@@ -722,7 +723,8 @@ child_setup (int in, int out, int err, char **new_argv,
 
 #ifdef WINDOWSNT
   /* Spawn the child.  (See ntproc.c:Spawnve).  */
-  cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
+  cpid = spawnve (_P_NOWAIT, new_argv[0], (CONST char* CONST*)new_argv,
+                 (CONST char* CONST*)env);
   if (cpid == -1)
     /* An error occurred while trying to spawn the process.  */
     report_file_error ("Spawning child process", Qnil);
@@ -897,4 +899,7 @@ Each element should be a string of the form ENVVARNAME=VALUE.
 The environment which Emacs inherits is placed in this variable
 when Emacs starts.
 */ );
+
+  Vlisp_EXEC_SUFFIXES = build_string (EXEC_SUFFIXES);
+  staticpro (&Vlisp_EXEC_SUFFIXES);
 }