aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2002-03-04 20:08:37 +0000
committerEli Zaretskii2002-03-04 20:08:37 +0000
commitc0917202cfe848f747188f0b2cebfe04fcce6aa3 (patch)
tree8442c262bd73101853ed66b1d909b18e8c464908 /src
parent54679108362b1247d63c1bb193d8e4d759daf134 (diff)
downloademacs-c0917202cfe848f747188f0b2cebfe04fcce6aa3.tar.gz
emacs-c0917202cfe848f747188f0b2cebfe04fcce6aa3.zip
(sys_subshell) [MSDOS]: If PWD is set in the
environment, pass it down with corrected value.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/sysdep.c18
2 files changed, 21 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fb15705c697..fe39168e5b0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12002-03-04 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * sysdep.c (sys_subshell) [MSDOS]: If PWD is set in the
4 environment, pass it down with corrected value.
5
12002-03-04 Pavel Jan,Bm(Bk <Pavel@Janik.cz> 62002-03-04 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2 7
3 * lread.c (read_filtered_event): Do not call start_hourglass 8 * lread.c (read_filtered_event): Do not call start_hourglass
diff --git a/src/sysdep.c b/src/sysdep.c
index f560e9d7cf2..ef5000eeb09 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -850,8 +850,22 @@ sys_subshell ()
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 st = system (sh); 853 {
854 chdir (oldwd); 854 char *old_pwd = getenv ("PWD");
855
856 /* If PWD is set, pass it with corrected value. */
857 if (old_pwd)
858 {
859 old_pwd = xstrdup (old_pwd);
860 if (str[len - 1] == '/')
861 str[len - 1] = '\0';
862 setenv ("PWD", str, 1);
863 }
864 st = system (sh);
865 chdir (oldwd);
866 if (old_pwd)
867 putenv (old_pwd); /* restore previous value */
868 }
855#if 0 /* This is also reported if last command executed in subshell failed, KFS */ 869#if 0 /* This is also reported if last command executed in subshell failed, KFS */
856 if (st) 870 if (st)
857 report_file_error ("Can't execute subshell", Fcons (build_string (sh), Qnil)); 871 report_file_error ("Can't execute subshell", Fcons (build_string (sh), Qnil));