Index: openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl,v diff -u -r1.5.2.3 -r1.5.2.4 --- openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl 3 Nov 2015 14:34:36 -0000 1.5.2.3 +++ openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl 10 Oct 2016 08:44:50 -0000 1.5.2.4 @@ -27,10 +27,22 @@ set handle [ns_proxy get ExecPool] with_finally -code { if {[info exists cd]} { + # + # We were requested to switch to a different + # directory. Remember the old directory before + # switching to the new one. + # + set pwd [ns_proxy eval $handle pwd] ns_proxy eval $handle [list cd $cd] } set return_string [ns_proxy eval $handle [list ::exec {*}$call]] } -finally { + if {[info exists pwd]} { + # + # Switch back to the previous directory. + # + ns_proxy eval $handle [list cd $pwd] + } ns_proxy release $handle } return $return_string