summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-16 08:20:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-16 08:20:15 (GMT)
commitda495f0b97edc339cdaa287f42ab8abf49be8c43 (patch)
tree0d30e33365d6fa5117270effb71c75daed480f19 /generic
parentc582be3c0f71b3545bb5ad4c4e7509fddd547586 (diff)
parent9b2958c5803abffb4174f28adac63058409ded8e (diff)
downloadtk-da495f0b97edc339cdaa287f42ab8abf49be8c43.zip
tk-da495f0b97edc339cdaa287f42ab8abf49be8c43.tar.gz
tk-da495f0b97edc339cdaa287f42ab8abf49be8c43.tar.bz2
Merge trunk
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBind.c2
-rw-r--r--generic/tkBusy.c2
-rw-r--r--generic/tkMain.c24
-rw-r--r--generic/tkMenu.c2
4 files changed, 13 insertions, 17 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 8d04987..ba078b0 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -2096,7 +2096,7 @@ IsBetterMatch(
if (!sndMatchPtr) { return 0; }
if (!fstMatchPtr) { return 1; }
-
+
diff = CountSpecialized(fstMatchPtr, sndMatchPtr);
if (diff > 0) { return 1; }
if (diff < 0) { return 0; }
diff --git a/generic/tkBusy.c b/generic/tkBusy.c
index 1846a94..fa526a3 100644
--- a/generic/tkBusy.c
+++ b/generic/tkBusy.c
@@ -896,7 +896,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 9127a7e..17031dc 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -78,20 +78,16 @@ 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 = wcslen(string);
- }
Tcl_DStringInit(&ds);
- Tcl_WCharToUtfDString(string, length, &ds);
+ Tcl_WCharToUtfDString(string, wcslen(string), &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);
@@ -271,19 +267,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;
}
@@ -291,7 +287,7 @@ Tk_MainEx(
path = Tcl_GetStartupScript(&encodingName);
if (path == NULL) {
- appName = NewNativeObj(argv[0], -1);
+ appName = NewNativeObj(argv[0]);
} else {
appName = path;
}
@@ -303,7 +299,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);
@@ -432,7 +428,7 @@ StdinProc(
Tcl_Channel chan = isPtr->input;
Tcl_Interp *interp = isPtr->interp;
- count = Tcl_Gets(chan, &isPtr->line);
+ count = (size_t)Tcl_Gets(chan, &isPtr->line);
if (count == (size_t)-1 && !isPtr->gotPartial) {
if (isPtr->tty) {
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 4d81978..1b38444 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -2169,7 +2169,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;
}