diff options
author | hobbs <hobbs> | 2003-07-17 00:20:41 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-07-17 00:20:41 (GMT) |
commit | a626e7cb3acdd464d7121fc8a401eda7cbae9e92 (patch) | |
tree | b2daa3910127e8c7bde6c38b6b76099bcf20ab8a /generic/tclPathObj.c | |
parent | 7babac4bf486dcf01e87c9283ef4adf85b7e2cef (diff) | |
download | tcl-a626e7cb3acdd464d7121fc8a401eda7cbae9e92.zip tcl-a626e7cb3acdd464d7121fc8a401eda7cbae9e92.tar.gz tcl-a626e7cb3acdd464d7121fc8a401eda7cbae9e92.tar.bz2 |
2003-07-16 Mumit Khan <khan@nanotech.wisc.edu>
* generic/tclPathObj.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.
[Patch 679315]
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r-- | generic/tclPathObj.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 6a6b147..cf9af4f 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPathObj.c,v 1.4 2003/07/16 15:29:09 dgp Exp $ + * RCS: @(#) $Id: tclPathObj.c,v 1.5 2003/07/17 00:20:41 hobbs Exp $ */ #include "tclInt.h" @@ -1590,6 +1590,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 |