diff options
author | hobbs <hobbs@noemail.net> | 2003-07-17 00:16:03 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2003-07-17 00:16:03 (GMT) |
commit | 4cefe3adca29041d0f2376cebcc18beebaec77c6 (patch) | |
tree | 3df9d68233c4378f6a835b853ec41a9d581fdf69 /generic/tclIOUtil.c | |
parent | bf91ef9feeb2e675627f15e2cfaaf9fa0b8cd78c (diff) | |
download | tcl-4cefe3adca29041d0f2376cebcc18beebaec77c6.zip tcl-4cefe3adca29041d0f2376cebcc18beebaec77c6.tar.gz tcl-4cefe3adca29041d0f2376cebcc18beebaec77c6.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.
FossilOrigin-Name: fe62167ad060b925ca85bff89b218fa2b38213d5
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index ca250f6..0fe38e2 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.5 2003/07/16 15:28:29 dgp Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.6 2003/07/17 00:16:04 hobbs Exp $ */ #include "tclInt.h" @@ -5697,6 +5697,26 @@ SetFsPathFromAny(interp, objPtr) transPtr = Tcl_FSJoinToPath(objPtr,0,NULL); } +#if defined(__CYGWIN__) && defined(__WIN32__) + { + extern int cygwin_conv_to_win32_path + _ANSI_ARGS_((CONST char *, char *)); + char winbuf[MAX_PATH+1]; + + /* + * In the Cygwin world, call conv_to_win32_path in order to use the + * mount table to translate the file name into something Windows will + * understand. Take care when converting empty strings! + */ + name = Tcl_GetStringFromObj(transPtr, &len); + if (len > 0) { + cygwin_conv_to_win32_path(name, winbuf); + TclWinNoBackslash(winbuf); + Tcl_SetStringObj(transPtr, winbuf, -1); + } + } +#endif /* __CYGWIN__ && __WIN32__ */ + /* * Now we have a translated filename in 'transPtr'. This will have * forward slashes on Windows, and will not contain any ~user |