+2006-12-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * win/tclWin32Dll.c (TclWinInit): Set native cwd to Cygwin's cwd.
+ * win/tclWinFile.c (TclpObjChdir): Keep native and Cygwin's cwd
+ synched.
+
2006-11-30 Christopher Faylor <cgf@timesys.com>
* cygwin/configure.in (LIB_AC_PROG_CC): Upgrade macro to accommodate
*/
#include "tclWinInt.h"
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#endif
/*
* The following data structures are used when loading the thunking
panic("Win32s is not a supported platform");
}
+#ifdef __CYGWIN__
+ {
+ char cwd_posix[MAX_PATH], cwd_win32[MAX_PATH];
+ cygwin_conv_to_full_win32_path (getcwd (cwd_posix, MAX_PATH), cwd_win32);
+ SetCurrentDirectory (cwd_win32);
+ }
+#endif
+
tclWinProcs = &asciiProcs;
}
\f
nativePath = (CONST TCHAR *) Tcl_FSGetNativePath(pathPtr);
+ result = (*tclWinProcs->setCurrentDirectoryProc)(nativePath);
#ifdef __CYGWIN__
/* Cygwin chdir only groks POSIX path. */
- path = Tcl_WinTCharToUtf(nativePath, -1, &ds);
- cygwin_conv_to_posix_path(path, posixPath);
- result = (chdir(posixPath) == 0 ? 1 : 0);
- Tcl_DStringFree(&ds);
-#else /* __CYGWIN__ */
- result = (*tclWinProcs->setCurrentDirectoryProc)(nativePath);
+ if (result)
+ {
+ path = Tcl_WinTCharToUtf(nativePath, -1, &ds);
+ cygwin_conv_to_posix_path(path, posixPath);
+ result = (chdir(posixPath) == 0 ? 1 : 0);
+ Tcl_DStringFree(&ds);
+ }
#endif /* __CYGWIN__ */
if (result == 0) {