summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c53
1 files changed, 13 insertions, 40 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 79acfd2..ea7ee05 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.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: tclFileName.c,v 1.40.2.2 2003/07/16 15:28:29 dgp Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.40.2.3 2003/07/17 00:16:04 hobbs Exp $
*/
#include "tclInt.h"
@@ -1398,31 +1398,12 @@ Tcl_TranslateFileName(interp, name, bufferPtr)
*/
if (tclPlatform == TCL_PLATFORM_WINDOWS) {
-#if defined(__CYGWIN__) && defined(__WIN32__)
-
- extern int cygwin_conv_to_win32_path
- _ANSI_ARGS_((CONST char *, char *));
- char winbuf[MAX_PATH];
-
- /*
- * 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!
- */
- if (Tcl_DStringLength(bufferPtr)) {
- cygwin_conv_to_win32_path(Tcl_DStringValue(bufferPtr), winbuf);
- Tcl_DStringFree(bufferPtr);
- Tcl_DStringAppend(bufferPtr, winbuf, -1);
- }
-#else /* __CYGWIN__ && __WIN32__ */
-
register char *p;
for (p = Tcl_DStringValue(bufferPtr); *p != '\0'; p++) {
if (*p == '/') {
*p = '\\';
}
}
-#endif /* __CYGWIN__ && __WIN32__ */
}
return Tcl_DStringValue(bufferPtr);
}
@@ -2388,25 +2369,6 @@ TclDoGlob(interp, separators, headPtr, tail, types)
* element. Add an extra slash if this is a UNC path.
*/
-#if defined(__CYGWIN__) && defined(__WIN32__)
- {
-
- extern int cygwin_conv_to_win32_path
- _ANSI_ARGS_((CONST char *, char *));
- char winbuf[MAX_PATH];
-
- /*
- * 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.
- */
- cygwin_conv_to_win32_path(Tcl_DStringValue(headPtr), winbuf);
- Tcl_DStringFree(headPtr);
- Tcl_DStringAppend(headPtr, winbuf, -1);
-
- }
-#endif /* __CYGWIN__ && __WIN32__ */
-
if (*name == ':') {
Tcl_DStringAppend(headPtr, ":", 1);
if (count > 1) {
@@ -2619,11 +2581,22 @@ TclDoGlob(interp, separators, headPtr, tail, types)
if (Tcl_DStringLength(headPtr) == 0) {
if (((*name == '\\') && (name[1] == '/' || name[1] == '\\'))
|| (*name == '/')) {
- Tcl_DStringAppend(headPtr, "\\", 1);
+ Tcl_DStringAppend(headPtr, "/", 1);
} else {
Tcl_DStringAppend(headPtr, ".", 1);
}
}
+#if defined(__CYGWIN__) && defined(__WIN32__)
+ {
+ extern int cygwin_conv_to_win32_path
+ _ANSI_ARGS_((CONST char *, char *));
+ char winbuf[MAX_PATH+1];
+
+ cygwin_conv_to_win32_path(Tcl_DStringValue(headPtr), winbuf);
+ Tcl_DStringFree(headPtr);
+ Tcl_DStringAppend(headPtr, winbuf, -1);
+ }
+#endif /* __CYGWIN__ && __WIN32__ */
/*
* Convert to forward slashes. This is required to pass
* some Tcl tests. We should probably remove the conversions