(child_setup) [MSDOS]: malloc pwd_var instead of
using alloca; free it after run_msdos_command returns
This commit is contained in:
parent
74c07fafcf
commit
16425c4a98
2 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,13 @@
|
|||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue