aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-17 22:50:40 -0700
committerPaul Eggert2011-03-17 22:50:40 -0700
commit5e41f65daf496cc39cd8bef55a28525b78f97d3d (patch)
tree8ae7905142d429ce8ce718e33df8d92cdac6a14b /src
parent7e9123a200047d0caaaa02e866aae6b7c4cebeb6 (diff)
downloademacs-5e41f65daf496cc39cd8bef55a28525b78f97d3d.tar.gz
emacs-5e41f65daf496cc39cd8bef55a28525b78f97d3d.zip
Better fix for volatile issue.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 889ff6d83eb..14db0fd26d0 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -488,10 +488,7 @@ sys_subshell (void)
488 int pid; 488 int pid;
489 struct save_signal saved_handlers[5]; 489 struct save_signal saved_handlers[5];
490 Lisp_Object dir; 490 Lisp_Object dir;
491 491 unsigned char *volatile str_volatile = 0;
492 /* Volatile because otherwise vfork might clobber it on some hosts. */
493 unsigned char *volatile dirstr = 0;
494
495 unsigned char *str; 492 unsigned char *str;
496 int len; 493 int len;
497 494
@@ -516,7 +513,7 @@ sys_subshell (void)
516 goto xyzzy; 513 goto xyzzy;
517 514
518 dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); 515 dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil);
519 str = dirstr = (unsigned char *) alloca (SCHARS (dir) + 2); 516 str_volatile = str = (unsigned char *) alloca (SCHARS (dir) + 2);
520 len = SCHARS (dir); 517 len = SCHARS (dir);
521 memcpy (str, SDATA (dir), len); 518 memcpy (str, SDATA (dir), len);
522 if (str[len - 1] != '/') str[len++] = '/'; 519 if (str[len - 1] != '/') str[len++] = '/';
@@ -548,7 +545,7 @@ sys_subshell (void)
548 sh = "sh"; 545 sh = "sh";
549 546
550 /* Use our buffer's default directory for the subshell. */ 547 /* Use our buffer's default directory for the subshell. */
551 str = dirstr; 548 str = str_volatile;
552 if (str && chdir ((char *) str) != 0) 549 if (str && chdir ((char *) str) != 0)
553 { 550 {
554#ifndef DOS_NT 551#ifndef DOS_NT