mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-20 11:33:09 -08:00
Better fix for volatile issue.
This commit is contained in:
parent
7e9123a200
commit
5e41f65daf
1 changed files with 3 additions and 6 deletions
|
|
@ -488,10 +488,7 @@ sys_subshell (void)
|
|||
int pid;
|
||||
struct save_signal saved_handlers[5];
|
||||
Lisp_Object dir;
|
||||
|
||||
/* Volatile because otherwise vfork might clobber it on some hosts. */
|
||||
unsigned char *volatile dirstr = 0;
|
||||
|
||||
unsigned char *volatile str_volatile = 0;
|
||||
unsigned char *str;
|
||||
int len;
|
||||
|
||||
|
|
@ -516,7 +513,7 @@ sys_subshell (void)
|
|||
goto xyzzy;
|
||||
|
||||
dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil);
|
||||
str = dirstr = (unsigned char *) alloca (SCHARS (dir) + 2);
|
||||
str_volatile = str = (unsigned char *) alloca (SCHARS (dir) + 2);
|
||||
len = SCHARS (dir);
|
||||
memcpy (str, SDATA (dir), len);
|
||||
if (str[len - 1] != '/') str[len++] = '/';
|
||||
|
|
@ -548,7 +545,7 @@ sys_subshell (void)
|
|||
sh = "sh";
|
||||
|
||||
/* Use our buffer's default directory for the subshell. */
|
||||
str = dirstr;
|
||||
str = str_volatile;
|
||||
if (str && chdir ((char *) str) != 0)
|
||||
{
|
||||
#ifndef DOS_NT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue