Commit 16425c4a authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(child_setup) [MSDOS]: malloc pwd_var instead of

using alloca; free it after run_msdos_command returns
parent 74c07faf
2000-07-31 Eli Zaretskii <eliz@is.elta.co.il>
* msdos.c (run_msdos_command): Save and restore the master
environment, for the case that child_setup signals an error.
When mirroring slashes in DOS shell commands, don't fail when
argv[2] has embedded blanks.
* callproc.c (child_setup) [MSDOS]: malloc pwd_var instead of
using alloca; free it after run_msdos_command returns.
2000-07-27 Dave Love <fx@gnu.org>
 
* s/irix6-5.h (IRIX_FORCE_32_BITS, LD_SWITCH_SYSTEM): Don't
......
......@@ -1072,7 +1072,14 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
register int i;
i = STRING_BYTES (XSTRING (current_dir));
#ifdef MSDOS
/* MSDOS must have all environment variables malloc'ed, because
low-level libc functions that launch subsidiary processes rely
on that. */
pwd_var = (char *) xmalloc (i + 6);
#else
pwd_var = (char *) alloca (i + 6);
#endif
temp = pwd_var + 4;
bcopy ("PWD=", pwd_var, 4);
bcopy (XSTRING (current_dir)->data, temp, i);
......@@ -1212,6 +1219,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
#ifdef MSDOS
pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
free (pwd_var);
if (pid == -1)
/* An error occurred while trying to run the subprocess. */
report_file_error ("Spawning child process", Qnil);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment