Mercurial > emacs
comparison src/sysdep.c @ 43708:8d176857311d
(sys_subshell): Fix last change.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Mon, 04 Mar 2002 20:15:56 +0000 |
parents | 009de2eaf047 |
children | f92c4d87863a |
comparison
equal
deleted
inserted
replaced
43707:8958bd4ddd09 | 43708:8d176857311d |
---|---|
849 } | 849 } |
850 #endif | 850 #endif |
851 | 851 |
852 #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ | 852 #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ |
853 { | 853 { |
854 char *old_pwd = getenv ("PWD"); | 854 char *epwd = getenv ("PWD"); |
855 char old_pwd[MAXPATHLEN+1+4]; | |
855 | 856 |
856 /* If PWD is set, pass it with corrected value. */ | 857 /* If PWD is set, pass it with corrected value. */ |
857 if (old_pwd) | 858 if (epwd) |
858 { | 859 { |
859 old_pwd = xstrdup (old_pwd); | 860 strcpy (old_pwd, epwd); |
860 if (str[len - 1] == '/') | 861 if (str[len - 1] == '/') |
861 str[len - 1] = '\0'; | 862 str[len - 1] = '\0'; |
862 setenv ("PWD", str, 1); | 863 setenv ("PWD", str, 1); |
863 } | 864 } |
864 st = system (sh); | 865 st = system (sh); |
865 chdir (oldwd); | 866 chdir (oldwd); |
866 if (old_pwd) | 867 if (epwd) |
867 putenv (old_pwd); /* restore previous value */ | 868 putenv (old_pwd); /* restore previous value */ |
868 } | 869 } |
869 #if 0 /* This is also reported if last command executed in subshell failed, KFS */ | 870 #if 0 /* This is also reported if last command executed in subshell failed, KFS */ |
870 if (st) | 871 if (st) |
871 report_file_error ("Can't execute subshell", Fcons (build_string (sh), Qnil)); | 872 report_file_error ("Can't execute subshell", Fcons (build_string (sh), Qnil)); |