mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 13:27:36 +00:00
(sys_subshell): Fix last change.
This commit is contained in:
parent
c0917202cf
commit
48178f9aaf
1 changed files with 5 additions and 4 deletions
|
|
@ -851,19 +851,20 @@ sys_subshell ()
|
|||
|
||||
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
|
||||
{
|
||||
char *old_pwd = getenv ("PWD");
|
||||
char *epwd = getenv ("PWD");
|
||||
char old_pwd[MAXPATHLEN+1+4];
|
||||
|
||||
/* If PWD is set, pass it with corrected value. */
|
||||
if (old_pwd)
|
||||
if (epwd)
|
||||
{
|
||||
old_pwd = xstrdup (old_pwd);
|
||||
strcpy (old_pwd, epwd);
|
||||
if (str[len - 1] == '/')
|
||||
str[len - 1] = '\0';
|
||||
setenv ("PWD", str, 1);
|
||||
}
|
||||
st = system (sh);
|
||||
chdir (oldwd);
|
||||
if (old_pwd)
|
||||
if (epwd)
|
||||
putenv (old_pwd); /* restore previous value */
|
||||
}
|
||||
#if 0 /* This is also reported if last command executed in subshell failed, KFS */
|
||||
|
|
|
|||
Loading…
Reference in a new issue