diff options
author | das <das> | 2002-01-27 11:10:47 (GMT) |
---|---|---|
committer | das <das> | 2002-01-27 11:10:47 (GMT) |
commit | fe24d04c6483292efc629c4542d61f514fb33ba4 (patch) | |
tree | a2017775ea4c396115dd40b75be07b516138e2a0 /mac/tkMacInit.c | |
parent | e7c600c1dfbc54021b852e337e06b83daee83b81 (diff) | |
download | tk-fe24d04c6483292efc629c4542d61f514fb33ba4.zip tk-fe24d04c6483292efc629c4542d61f514fb33ba4.tar.gz tk-fe24d04c6483292efc629c4542d61f514fb33ba4.tar.bz2 |
* generic/tkFileFilter.c:
* mac/tkMacInit.c:
* mac/tkMacKeyboard.c:
* mac/tkMacMenus.c: TIP 27 CONSTification induced changes
Diffstat (limited to 'mac/tkMacInit.c')
-rw-r--r-- | mac/tkMacInit.c | 10 |
1 files changed, 6 insertions, 4 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); } |