This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[RFA] Cygwin/Windows compatibility patches for tcl
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA] Cygwin/Windows compatibility patches for tcl
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Mon, 5 Jun 2000 18:56:07 -0400
- Cc: spolk at cygnus dot com
- Reply-To: gdb-patches at sourceware dot cygnus dot com
I'm not sure if this is the best location for tcl patches but since they
relate to problems with insight, I guess it sort of make sense. I've
also Cc'ed Syd Polk, who approves the tcl/tk/itcl/tix changes in
sourceware.
This patch corrects several problems that Cygwin users are seeing with
Insight for Windows. I'm a little puzzled as to why the slash to backslash
conversion code is in tcl at all but its removal solves the cygwin insight
problems.
Ok to check in?
cgf
Mon Jun 5 18:48:32 2000 Christopher Faylor <cgf@cygnus.com>
* generic/tclFileName.c (Tcl_TranslateFileName): Cygwin paths (and
Windows in general, actually) do not need to have '/'s translated into
'\'s.
(TclDoGlob): Ditto.
* win/tclWinFile.c (TclMatchFiles): Ditto.
* generic/tclInitScript.h: Look in "../bin/usr/share" as well as
"../bin/share".
Index: generic/tclFileName.c
===================================================================
RCS file: /cvs/src/src/tcl/generic/tclFileName.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 tclFileName.c
--- tclFileName.c 1999/11/09 01:28:43 1.1.1.1
+++ tclFileName.c 2000/06/05 22:51:59
@@ -963,6 +963,8 @@ Tcl_TranslateFileName(interp, name, buff
* some system interfaces don't accept forward slashes.
*/
+#ifndef __CYGWIN__
+ cygwin_conv_to_win32_path (Tcl_DStringValue(bufferPtr)
if (tclPlatform == TCL_PLATFORM_WINDOWS) {
for (p = Tcl_DStringValue(bufferPtr); *p != '\0'; p++) {
if (*p == '/') {
@@ -970,6 +972,7 @@ Tcl_TranslateFileName(interp, name, buff
}
}
}
+#endif
return Tcl_DStringValue(bufferPtr);
}
@@ -1568,6 +1571,7 @@ TclDoGlob(interp, separators, headPtr, t
break;
case TCL_PLATFORM_WINDOWS: {
int exists;
+#ifndef __CYGWIN__
/*
* We need to convert slashes to backslashes before checking
* for the existence of the file. Once we are done, we need
@@ -1588,6 +1592,7 @@ TclDoGlob(interp, separators, headPtr, t
}
}
}
+#endif
name = Tcl_DStringValue(headPtr);
exists = (TclAccess(name, F_OK) == 0);
for (p = name; *p != '\0'; p++) {
Index: generic/tclInitScript.h
===================================================================
RCS file: /cvs/src/src/tcl/generic/tclInitScript.h,v
retrieving revision 1.2
diff -u -p -r1.2 tclInitScript.h
--- tclInitScript.h 2000/04/03 19:34:38 1.2
+++ tclInitScript.h 2000/06/05 22:51:59
@@ -92,6 +92,7 @@ static char initScript[] = "if {[info pr
}\n\
set parentDir [file dirname [file dirname $execName]]\n\
lappend dirs [file join $parentDir share tcl$tcl_version]\n\
+ lappend dirs [file join $parentDir \"usr\" share tcl$tcl_version]\n\
lappend dirs [file join [file dirname $parentDir] share tcl$tcl_version]\n\
# NOW, let's try to find it in the build tree...\n\
# Rather than play all the games Scriptics does, if we are in the build\n\
Index: win/tclWinFile.c
===================================================================
RCS file: /cvs/src/src/tcl/win/tclWinFile.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 tclWinFile.c
--- tclWinFile.c 1999/11/09 01:28:44 1.1.1.1
+++ tclWinFile.c 2000/06/05 22:51:59
@@ -130,11 +130,13 @@ TclMatchFiles(interp, separators, dirPtr
Tcl_DStringAppend(&buffer, Tcl_DStringValue(dirPtr),
Tcl_DStringLength(dirPtr));
}
+#ifndef __CYGWIN__
for (p = Tcl_DStringValue(&buffer); *p != '\0'; p++) {
if (*p == '/') {
*p = '\\';
}
}
+#endif
p--;
if (*p != '\\' && *p != ':') {
Tcl_DStringAppend(&buffer, "\\", 1);