summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-10-08 14:50:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-10-08 14:50:56 (GMT)
commit7d5aead5703d324d80a98cf890f90b9a452cb9a2 (patch)
tree1e54193a5e8b7423f7fa37f5f18a862109ea7eb2 /generic/tclVar.c
parentea51624d959bfd0e5e3da93cc4c454e57ee21a72 (diff)
downloadtcl-7d5aead5703d324d80a98cf890f90b9a452cb9a2.zip
tcl-7d5aead5703d324d80a98cf890f90b9a452cb9a2.tar.gz
tcl-7d5aead5703d324d80a98cf890f90b9a452cb9a2.tar.bz2
* generic/tclTrace.c: Corrected handling of errors returned by
variable traces so that the errorInfo value contains the original error message. [Bug 2151707] * generic/tclVar.c: Revised implementation of TclObjVarErrMsg so that error message construction does not disturb an existing iPtr->errorInfo that may be in progress.
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 15b1856..a359711 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.168 2008/09/25 19:51:29 dgp Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.169 2008/10/08 14:50:57 dgp Exp $
*/
#include "tclInt.h"
@@ -4641,16 +4641,13 @@ TclObjVarErrMsg(
* variable, or -1. Only used when part1Ptr is
* NULL. */
{
- Tcl_ResetResult(interp);
if (!part1Ptr) {
part1Ptr = localName(((Interp *)interp)->varFramePtr, index);
}
- Tcl_AppendResult(interp, "can't ", operation, " \"",
- TclGetString(part1Ptr), NULL);
- if (part2Ptr) {
- Tcl_AppendResult(interp, "(", TclGetString(part2Ptr), ")", NULL);
- }
- Tcl_AppendResult(interp, "\": ", reason, NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("can't %s \"%s%s%s%s\": %s",
+ operation, TclGetString(part1Ptr), (part2Ptr ? "(" : ""),
+ (part2Ptr ? TclGetString(part2Ptr) : ""), (part2Ptr ? ")" : ""),
+ reason));
}
/*