From 34b465e85f0f2b75425a4ecf210d4e81a3d4689a Mon Sep 17 00:00:00 2001 From: stanton Date: Thu, 4 Feb 1999 20:51:36 +0000 Subject: * generic/tkConsole.c: Fixed so errors in console eval are reported properly. Eliminated duplicate result messages. [Bug: 973] --- generic/tkConsole.c | 11 +++++++---- 1 file 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], -- cgit v0.12