summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclProc.c16
2 files changed, 14 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f7f7dc..c130118 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-24 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclProc.c (ObjInterpProcEx): disable itcl hacks for
+ calls from ApplyObjCmd (islambda==1), as they mess apply's error
+ messages [Bug 1583266]
+
2006-10-23 Miguel Sofer <msofer@users.sf.net>
* generic/tclProc.c (ApplyObjCmd): fix wrong#args for apply by
diff --git a/generic/tclProc.c b/generic/tclProc.c
index b2ff2b9..cff6bef 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.98 2006/10/24 00:29:31 msofer Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.99 2006/10/24 22:31:09 msofer Exp $
*/
#include "tclInt.h"
@@ -1316,7 +1316,7 @@ ObjInterpProcEx(
#ifdef AVOID_HACKS_FOR_ITCL
desiredObjs[0] = objv[0];
#else
- desiredObjs[0] = Tcl_NewListObj(1, objv);
+ desiredObjs[0] = (isLambda? objv[0]: Tcl_NewListObj(1, objv));
#endif /* AVOID_HACKS_FOR_ITCL */
localPtr = procPtr->firstLocalPtr;
@@ -1337,15 +1337,15 @@ ObjInterpProcEx(
Tcl_WrongNumArgs(interp, numArgs+1, desiredObjs, NULL);
result = TCL_ERROR;
-#ifdef AVOID_HACKS_FOR_ITCL
- for (i=1 ; i<=numArgs ; i++) {
- TclDecrRefCount(desiredObjs[i]);
+#ifndef AVOID_HACKS_FOR_ITCL
+ if (!isLambda) {
+ TclDecrRefCount(desiredObjs[0]);
}
-#else
- for (i=0 ; i<=numArgs ; i++) {
+#endif /* AVOID_HACKS_FOR_ITCL */
+
+ for (i=1 ; i<=numArgs ; i++) {
TclDecrRefCount(desiredObjs[i]);
}
-#endif /* AVOID_HACKS_FOR_ITCL */
ckfree((char *) desiredObjs);
goto procDone;
}