diff options
author | stanton <stanton@noemail.net> | 1999-02-04 20:51:35 (GMT) |
---|---|---|
committer | stanton <stanton@noemail.net> | 1999-02-04 20:51:35 (GMT) |
commit | d6e21413d18703e62e695fcad6a7bbe3620011e0 (patch) | |
tree | 0b13ccef30b5e37d908d6d4e6af9c07cdbdc616f /generic/tkConsole.c | |
parent | d2be735a92189a9129d386e4c6de42ee0ac4450a (diff) | |
download | tk-d6e21413d18703e62e695fcad6a7bbe3620011e0.zip tk-d6e21413d18703e62e695fcad6a7bbe3620011e0.tar.gz tk-d6e21413d18703e62e695fcad6a7bbe3620011e0.tar.bz2 |
* generic/tkConsole.c: Fixed so errors in console eval are
reported properly. Eliminated duplicate result messages. [Bug: 973]
FossilOrigin-Name: 108ff6c589d8ca9309358ffffe27fe0b6b43ccca
Diffstat (limited to 'generic/tkConsole.c')
-rw-r--r-- | generic/tkConsole.c | 11 |
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], |