diff options
Diffstat (limited to 'mac')
-rw-r--r-- | mac/tkMacInit.c | 10 | ||||
-rw-r--r-- | mac/tkMacKeyboard.c | 5 | ||||
-rw-r--r-- | mac/tkMacMenus.c | 4 |
3 files changed, 11 insertions, 8 deletions
diff --git a/mac/tkMacInit.c b/mac/tkMacInit.c index e461073..277bbc6 100644 --- a/mac/tkMacInit.c +++ b/mac/tkMacInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacInit.c,v 1.6 2002/01/25 21:09:37 dgp Exp $ + * RCS: @(#) $Id: tkMacInit.c,v 1.7 2002/01/27 11:10:53 das Exp $ */ #include <Resources.h> @@ -170,6 +170,7 @@ TkpGetAppName( { int argc; CONST char **argv = NULL, *name, *p; + int nameLength = -1; Handle h = NULL; h = GetNamedResource('STR ', "\pTk App Name"); @@ -188,16 +189,17 @@ TkpGetAppName( name = argv[argc-1]; p = strrchr(name, '.'); if (p != NULL) { - *p = '\0'; + nameLength = p - name; } } else { name = NULL; } } - if ((name == NULL) || (*name == 0)) { + if ((name == NULL) || (*name == 0) || (nameLength == 0)) { name = "tk"; + nameLength = -1; } - Tcl_DStringAppend(namePtr, name, -1); + Tcl_DStringAppend(namePtr, name, nameLength); if (argv != NULL) { ckfree((char *)argv); } diff --git a/mac/tkMacKeyboard.c b/mac/tkMacKeyboard.c index 9039625..def5b19 100644 --- a/mac/tkMacKeyboard.c +++ b/mac/tkMacKeyboard.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacKeyboard.c,v 1.6 2000/04/17 02:16:58 jingham Exp $ + * RCS: @(#) $Id: tkMacKeyboard.c,v 1.7 2002/01/27 11:10:57 das Exp $ */ #include "tkInt.h" @@ -247,7 +247,8 @@ TkpGetString( len = 0; } } - return Tcl_ExternalToUtfDString(NULL, string, len, dsPtr); + Tcl_ExternalToUtfDString(NULL, string, len, dsPtr); + return Tcl_DStringValue(dsPtr); } /* diff --git a/mac/tkMacMenus.c b/mac/tkMacMenus.c index ca17f1d..8114daf 100644 --- a/mac/tkMacMenus.c +++ b/mac/tkMacMenus.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacMenus.c,v 1.7 2001/11/23 02:06:11 das Exp $ + * RCS: @(#) $Id: tkMacMenus.c,v 1.8 2002/01/27 11:11:02 das Exp $ */ #include "tcl.h" @@ -330,7 +330,7 @@ static void SourceDialog() { int result; - char *path; + CONST char *path; char openCmd[] = "tk_getOpenFile -filetypes {\ {{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}"; |