summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBusy.c2
-rw-r--r--generic/tkMain.c26
-rw-r--r--generic/tkMenu.c2
-rw-r--r--generic/tkWindow.c6
4 files changed, 16 insertions, 20 deletions
diff --git a/generic/tkBusy.c b/generic/tkBusy.c
index 7bd6262..7bd9a44 100644
--- a/generic/tkBusy.c
+++ b/generic/tkBusy.c
@@ -879,7 +879,7 @@ Tk_BusyObjCmd(
hPtr = Tcl_NextHashEntry(&cursor)) {
busyPtr = Tcl_GetHashValue(hPtr);
if (pattern == NULL ||
- Tcl_StringMatch(Tk_PathName(busyPtr->tkRef), pattern)) {
+ Tcl_StringCaseMatch(Tk_PathName(busyPtr->tkRef), pattern, 0)) {
Tcl_ListObjAppendElement(interp, objPtr,
TkNewWindowObj(busyPtr->tkRef));
}
diff --git a/generic/tkMain.c b/generic/tkMain.c
index b80ce4d..f0b7b3e 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -86,19 +86,15 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
static inline Tcl_Obj *
NewNativeObj(
- TCHAR *string,
- int length)
+ TCHAR *string)
{
Tcl_Obj *obj;
Tcl_DString ds;
#ifdef UNICODE
- if (length > 0) {
- length *= sizeof(WCHAR);
- }
- Tcl_WinTCharToUtf(string, length, &ds);
+ Tcl_WinTCharToUtf(string, -1, &ds);
#else
- Tcl_ExternalToUtfDString(NULL, (char *) string, length, &ds);
+ Tcl_ExternalToUtfDString(NULL, (char *) string, -1, &ds);
#endif
obj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
Tcl_DStringFree(&ds);
@@ -244,7 +240,7 @@ Tk_MainEx(
is.gotPartial = 0;
Tcl_Preserve(interp);
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32)
#if !defined(STATIC_BUILD)
/* If compiled for Win32 but running on Cygwin, don't use console */
if (!tclStubsPtr->reserved9)
@@ -278,19 +274,19 @@ Tk_MainEx(
if ((argc > 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1]))
&& (TEXT('-') != argv[3][0])) {
- Tcl_Obj *value = NewNativeObj(argv[2], -1);
- Tcl_SetStartupScript(NewNativeObj(argv[3], -1), Tcl_GetString(value));
+ Tcl_Obj *value = NewNativeObj(argv[2]);
+ Tcl_SetStartupScript(NewNativeObj(argv[3]), Tcl_GetString(value));
Tcl_DecrRefCount(value);
argc -= 3;
argv += 3;
} else if ((argc > 1) && (TEXT('-') != argv[1][0])) {
- Tcl_SetStartupScript(NewNativeObj(argv[1], -1), NULL);
+ Tcl_SetStartupScript(NewNativeObj(argv[1]), NULL);
argc--;
argv++;
} else if ((argc > 2) && (length = _tcslen(argv[1]))
&& (length > 1) && (0 == _tcsncmp(TEXT("-file"), argv[1], length))
&& (TEXT('-') != argv[2][0])) {
- Tcl_SetStartupScript(NewNativeObj(argv[2], -1), NULL);
+ Tcl_SetStartupScript(NewNativeObj(argv[2]), NULL);
argc -= 2;
argv += 2;
}
@@ -298,7 +294,7 @@ Tk_MainEx(
path = Tcl_GetStartupScript(&encodingName);
if (path == NULL) {
- appName = NewNativeObj(argv[0], -1);
+ appName = NewNativeObj(argv[0]);
} else {
appName = path;
}
@@ -310,7 +306,7 @@ Tk_MainEx(
argvPtr = Tcl_NewListObj(0, NULL);
while (argc--) {
- Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(*argv++, -1));
+ Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(*argv++));
}
Tcl_SetVar2Ex(interp, "argv", NULL, argvPtr, TCL_GLOBAL_ONLY);
@@ -440,7 +436,7 @@ StdinProc(
count = Tcl_Gets(chan, &isPtr->line);
- if (count < 0 && !isPtr->gotPartial) {
+ if (count == -1 && !isPtr->gotPartial) {
if (isPtr->tty) {
Tcl_Exit(0);
} else {
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 5fd8b80..af77009 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -2164,7 +2164,7 @@ TkGetMenuIndex(
Tcl_Obj *labelPtr = menuPtr->entries[i]->labelPtr;
const char *label = (labelPtr == NULL) ? NULL : Tcl_GetString(labelPtr);
- if ((label != NULL) && (Tcl_StringMatch(label, string))) {
+ if ((label != NULL) && (Tcl_StringCaseMatch(label, string, 0))) {
*indexPtr = i;
goto success;
}
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 51cbaf3..0cae5c0 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -2855,10 +2855,10 @@ TkCygwinMainEx(
/* construct "<path>/libtk8.?.dll", from "<path>/tk8?.dll" */
len = GetModuleFileNameW(Tk_GetHINSTANCE(), name, MAX_PATH);
- name[len-2] = TEXT('.');
+ name[len-2] = '.';
name[len-1] = name[len-5];
- _tcscpy(name+len, TEXT(".dll"));
- memcpy(name+len-8, TEXT("libtk8"), 6 * sizeof(TCHAR));
+ wcscpy(name+len, L".dll");
+ memcpy(name+len-8, L"libtk8", 6 * sizeof(TCHAR));
tkcygwindll = LoadLibrary(name);
if (!tkcygwindll) {