summaryrefslogtreecommitdiffstats
path: root/generic/tkArgv.c
diff options
context:
space:
mode:
authorstanton <stanton@noemail.net>1999-04-16 01:51:06 (GMT)
committerstanton <stanton@noemail.net>1999-04-16 01:51:06 (GMT)
commit58364783d6f176ecb8520dade8d1cb1a346c0950 (patch)
tree31378e81bd58f8c726fc552d6b30cbf3ca07497b /generic/tkArgv.c
parent878ed3a2c9af6e583516ac48fd69ce3b349ac5f8 (diff)
downloadtk-58364783d6f176ecb8520dade8d1cb1a346c0950.zip
tk-58364783d6f176ecb8520dade8d1cb1a346c0950.tar.gz
tk-58364783d6f176ecb8520dade8d1cb1a346c0950.tar.bz2
* Merged 8.1 branch into the main trunk
FossilOrigin-Name: 1120dc4257448ed1955333e682de48e2940cc741
Diffstat (limited to 'generic/tkArgv.c')
-rw-r--r--generic/tkArgv.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/generic/tkArgv.c b/generic/tkArgv.c
index 8d5d661..7f35368 100644
--- a/generic/tkArgv.c
+++ b/generic/tkArgv.c
@@ -5,12 +5,12 @@
* argv-argc parsing.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994 Sun Microsystems, Inc.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkArgv.c,v 1.2 1998/09/14 18:23:03 stanton Exp $
+ * RCS: @(#) $Id: tkArgv.c,v 1.3 1999/04/16 01:51:10 stanton Exp $
*/
#include "tkPort.h"
@@ -45,7 +45,7 @@ static void PrintUsage _ANSI_ARGS_((Tcl_Interp *interp,
*
* Results:
* The return value is a standard Tcl return value. If an
- * error occurs then an error message is left in interp->result.
+ * error occurs then an error message is left in the interp's result.
* Under normal conditions, both *argcPtr and *argv are modified
* to return the arguments that couldn't be processed here (they
* didn't match the option table, or followed an TK_ARGV_REST
@@ -291,10 +291,14 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
srcIndex += 2;
argc -= 2;
break;
- default:
- sprintf(interp->result, "bad argument type %d in Tk_ArgvInfo",
+ default: {
+ char buf[64 + TCL_INTEGER_SPACE];
+
+ sprintf(buf, "bad argument type %d in Tk_ArgvInfo",
infoPtr->type);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
+ }
}
}
@@ -328,7 +332,7 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
* Generate a help string describing command-line options.
*
* Results:
- * Interp->result will be modified to hold a help string
+ * The interp's result will be modified to hold a help string
* describing all the options in argTable, plus all those
* in the default table unless TK_ARGV_NO_DEFAULTS is
* specified in flags.
@@ -353,7 +357,7 @@ PrintUsage(interp, argTable, flags)
int width, i, numSpaces;
#define NUM_SPACES 20
static char spaces[] = " ";
- char tmp[30];
+ char tmp[TCL_DOUBLE_SPACE];
/*
* First, compute the width of the widest option key, so that we