changeset 43708:8d176857311d

(sys_subshell): Fix last change.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 04 Mar 2002 20:15:56 +0000
parents 8958bd4ddd09
children 1576fb3105fe
files src/sysdep.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/sysdep.c	Mon Mar 04 20:08:37 2002 +0000
+++ b/src/sysdep.c	Mon Mar 04 20:15:56 2002 +0000
@@ -851,19 +851,20 @@
 
 #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 */