diff options
| author | hobbs <hobbs> | 2003-07-17 00:16:03 (GMT) |
|---|---|---|
| committer | hobbs <hobbs> | 2003-07-17 00:16:03 (GMT) |
| commit | 0d4b32cb2005d9b53c97c9570bcf0a5d0e20a86e (patch) | |
| tree | 3df9d68233c4378f6a835b853ec41a9d581fdf69 /win/tclWinFile.c | |
| parent | 18936a82e21ffc0c684e920a9709a0f4bd7073f9 (diff) | |
| download | tcl-0d4b32cb2005d9b53c97c9570bcf0a5d0e20a86e.zip tcl-0d4b32cb2005d9b53c97c9570bcf0a5d0e20a86e.tar.gz tcl-0d4b32cb2005d9b53c97c9570bcf0a5d0e20a86e.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.c | 17 |
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()); |
