summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-02 14:37:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-02 14:37:23 (GMT)
commit23c8c8b5e43fffff7f81e26ffa820d4f51cca5c5 (patch)
treed89982bd2cd0bc211c455c625c08676a6cade532 /unix
parent1c7c1c74c471463c45093f14f25a4f69af26211f (diff)
parent8214e44b57a7ed7914a9d3eb4de78d298402edf0 (diff)
downloadtcl-23c8c8b5e43fffff7f81e26ffa820d4f51cca5c5.zip
tcl-23c8c8b5e43fffff7f81e26ffa820d4f51cca5c5.tar.gz
tcl-23c8c8b5e43fffff7f81e26ffa820d4f51cca5c5.tar.bz2
test Tcl_GetErrorLine() forwards/backwards compatibility in pkgb.so as well.
Don't free ctrl.script if thread creation fails: it is a constant string "testthread wait" normally.
Diffstat (limited to 'unix')
-rw-r--r--unix/dltest/pkgb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 40f1fdd..ad61d77 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -42,6 +42,10 @@ static int Pkgb_DemoObjCmd(ClientData clientData,
*----------------------------------------------------------------------
*/
+#ifndef Tcl_GetErrorLine
+# define Tcl_GetErrorLine(interp) ((interp)->errorLine)
+#endif
+
static int
Pkgb_SubObjCmd(
ClientData dummy, /* Not used. */
@@ -57,6 +61,9 @@ Pkgb_SubObjCmd(
}
if ((Tcl_GetIntFromObj(interp, objv[1], &first) != TCL_OK)
|| (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) {
+ char buf[TCL_INTEGER_SPACE];
+ sprintf(buf, "%d", Tcl_GetErrorLine(interp));
+ Tcl_AppendResult(interp, " in line: ", buf, NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));