[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/callproc.c,v
From: |
Andreas Schwab |
Subject: |
[Emacs-diffs] Changes to emacs/src/callproc.c,v |
Date: |
Sun, 07 Sep 2008 20:35:18 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Andreas Schwab <schwab> 08/09/07 20:35:17
Index: callproc.c
===================================================================
RCS file: /sources/emacs/emacs/src/callproc.c,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -b -r1.241 -r1.242
--- callproc.c 7 Sep 2008 19:10:28 -0000 1.241
+++ callproc.c 7 Sep 2008 20:35:17 -0000 1.242
@@ -226,8 +226,7 @@
int bufsize = CALLPROC_BUFFER_SIZE_MIN;
int count = SPECPDL_INDEX ();
- register const unsigned char **new_argv
- = (const unsigned char **) alloca ((max (2, nargs - 2)) * sizeof (char *));
+ register const unsigned char **new_argv;
struct buffer *old = current_buffer;
/* File to use for stderr in the child.
t means use same as standard output. */
@@ -414,7 +413,8 @@
&& SREF (path, 1) == ':')
path = Fsubstring (path, make_number (2), Qnil);
- new_argv[0] = SDATA (path);
+ new_argv = (const unsigned char **)
+ alloca (max (2, nargs - 2) * sizeof (char *));
if (nargs > 4)
{
register int i;
@@ -428,13 +428,15 @@
if (CODING_REQUIRE_ENCODING (&argument_coding))
/* We must encode this argument. */
args[i] = encode_coding_string (&argument_coding, args[i], 1);
- new_argv[i - 3] = SDATA (args[i]);
}
UNGCPRO;
- new_argv[nargs - 3] = 0;
+ for (i = 4; i < nargs; i++)
+ new_argv[i - 3] = SDATA (args[i]);
+ new_argv[i - 3] = 0;
}
else
new_argv[1] = 0;
+ new_argv[0] = SDATA (path);
#ifdef MSDOS /* MW, July 1993 */
if ((outf = egetenv ("TMPDIR")))