summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2006-03-10 19:49:13 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2006-03-10 19:49:13 (GMT)
commite7c6e0ca85731660713714016acde44d23e78e30 (patch)
tree47aec5ab19d9564687f1427738d2bb9f032fe4e8 /generic
parent123a450f1b884cd20b6fb652c77f83fd20844a2f (diff)
downloadtcl-e7c6e0ca85731660713714016acde44d23e78e30.zip
tcl-e7c6e0ca85731660713714016acde44d23e78e30.tar.gz
tcl-e7c6e0ca85731660713714016acde44d23e78e30.tar.bz2
* generic/tclProc.c (ObjInterpProcEx):
* tests/apply.test (apply-5.1): fix [apply] error messages so that they quote the lambda expression [Bug 1447355].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclProc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 1627f2e..beb3d48 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclProc.c,v 1.87 2006/02/02 10:45:07 dkf Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.88 2006/03/10 19:49:14 msofer Exp $
*/
#include "tclInt.h"
@@ -1405,7 +1405,22 @@ ObjInterpProcEx(
}
if (result != TCL_OK) {
- result = ProcessProcResultCode(interp, procName, nameLen, result);
+ if (skip == 1) {
+ result = ProcessProcResultCode(interp, procName, nameLen, result);
+ } else {
+ /*
+ * Use a 'procName' that contains the first skip elements of objv
+ * for error reporting. This insures that we do not see just
+ * 'apply', but also the lambda expression that caused the error.
+ */
+
+ Tcl_Obj *namePtr;
+
+ namePtr = Tcl_NewListObj(skip, objv);
+ procName = Tcl_GetStringFromObj(namePtr, &nameLen);
+ result = ProcessProcResultCode(interp, procName, nameLen, result);
+ TclDecrRefCount(namePtr);
+ }
}
/*