summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-07-17 00:16:03 (GMT)
committerhobbs <hobbs>2003-07-17 00:16:03 (GMT)
commitfd3cca0fed42222f341474fe7ecb9843dc8fb15b (patch)
tree3df9d68233c4378f6a835b853ec41a9d581fdf69 /win/tclWinFile.c
parent3389435994d42db2b637d34fbae876f1e36e4520 (diff)
downloadtcl-fd3cca0fed42222f341474fe7ecb9843dc8fb15b.zip
tcl-fd3cca0fed42222f341474fe7ecb9843dc8fb15b.tar.gz
tcl-fd3cca0fed42222f341474fe7ecb9843dc8fb15b.tar.bz2
2003-07-16 Mumit Khan <khan@nanotech.wisc.edu>
* generic/tclIOUtil.c (SetFsPathFromAny): Add Cygwin specific code to convert POSIX filename to native format. * generic/tclFileName.c (Tcl_TranslateFileName): And remove from here. (TclDoGlob): Adjust for cygwin and append / for dirs instead of \ * win/tclWinFile.c (TclpObjChdir): Use chdir on Cygwin.
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 96ebbb2..f1f1ffa 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.4 2003/05/16 01:43:01 hobbs Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.5 2003/07/17 00:16:04 hobbs Exp $
*/
//#define _WIN32_WINNT 0x0500
@@ -1395,9 +1395,24 @@ TclpObjChdir(pathPtr)
{
int result;
CONST TCHAR *nativePath;
+#ifdef __CYGWIN__
+ extern int cygwin_conv_to_posix_path
+ _ANSI_ARGS_((CONST char *, char *));
+ char posixPath[MAX_PATH+1];
+ CONST char *path;
+ Tcl_DString ds;
+#endif /* __CYGWIN__ */
nativePath = (CONST TCHAR *) Tcl_FSGetNativePath(pathPtr);
+#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);
+#endif /* __CYGWIN__ */
if (result == 0) {
TclWinConvertError(GetLastError());