summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1999-02-04 20:51:36 (GMT)
committerstanton <stanton>1999-02-04 20:51:36 (GMT)
commit34b465e85f0f2b75425a4ecf210d4e81a3d4689a (patch)
tree0b13ccef30b5e37d908d6d4e6af9c07cdbdc616f
parent439b3cab115374548ce631f285aa28f4ce2f5aa0 (diff)
downloadtk-34b465e85f0f2b75425a4ecf210d4e81a3d4689a.zip
tk-34b465e85f0f2b75425a4ecf210d4e81a3d4689a.tar.gz
tk-34b465e85f0f2b75425a4ecf210d4e81a3d4689a.tar.bz2
* generic/tkConsole.c: Fixed so errors in console eval are
reported properly. Eliminated duplicate result messages. [Bug: 973]
-rw-r--r--generic/tkConsole.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 597b16e..0ff1479 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkConsole.c,v 1.2 1998/09/14 18:23:08 stanton Exp $
+ * RCS: @(#) $Id: tkConsole.c,v 1.3 1999/02/04 20:51:36 stanton Exp $
*/
#include "tk.h"
@@ -399,12 +399,14 @@ ConsoleCmd(clientData, interp, argc, argv)
Tcl_Eval(consoleInterp, Tcl_DStringValue(&dString));
Tcl_DStringFree(&dString);
} else if ((c == 'h') && (strncmp(argv[1], "hide", length)) == 0) {
- Tcl_Eval(info->consoleInterp, "wm withdraw .");
+ Tcl_Eval(consoleInterp, "wm withdraw .");
} else if ((c == 's') && (strncmp(argv[1], "show", length)) == 0) {
- Tcl_Eval(info->consoleInterp, "wm deiconify .");
+ Tcl_Eval(consoleInterp, "wm deiconify .");
} else if ((c == 'e') && (strncmp(argv[1], "eval", length)) == 0) {
if (argc == 3) {
- Tcl_Eval(info->consoleInterp, argv[2]);
+ result = Tcl_Eval(consoleInterp, argv[2]);
+ Tcl_AppendResult(interp, Tcl_GetStringResult(consoleInterp),
+ (char *) NULL);
} else {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" eval command\"", (char *) NULL);
@@ -466,6 +468,7 @@ InterpreterCmd(clientData, interp, argc, argv)
} else if ((c == 'r') && (strncmp(argv[1], "record", length)) == 0) {
Tcl_RecordAndEval(otherInterp, argv[2], TCL_EVAL_GLOBAL);
result = TCL_OK;
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp, otherInterp->result, (char *) NULL);
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],