summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
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);
+ }
}
/*