summaryrefslogtreecommitdiffstats
path: root/unix/dltest
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-02 14:30:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-02 14:30:30 (GMT)
commit46821e04b63ebe9ea4a5b3e92678374028841310 (patch)
tree51f4f029ebd5893bc62dcc7b5f35078b6b9bf25c /unix/dltest
parent53eb119d0b2711c0dc9ec4bdad28ae9c185ca7e4 (diff)
parent51e5bda4769c125a8d712a3b7fef28d126cf61d1 (diff)
downloadtcl-46821e04b63ebe9ea4a5b3e92678374028841310.zip
tcl-46821e04b63ebe9ea4a5b3e92678374028841310.tar.gz
tcl-46821e04b63ebe9ea4a5b3e92678374028841310.tar.bz2
test Tcl_GetErrorLine() forwards/backwards compatibility in pkgb.so as well.
Marked some string subcommands as obsolete, following discussion on tcl-core. Don't free ctrl.script if thread creation fails: it is a constant string "testthread wait" normally.
Diffstat (limited to 'unix/dltest')
-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 3338eb5..039ad91 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -39,6 +39,10 @@ static int Pkgb_UnsafeObjCmd(ClientData clientData,
*----------------------------------------------------------------------
*/
+#ifndef Tcl_GetErrorLine
+# define Tcl_GetErrorLine(interp) ((interp)->errorLine)
+#endif
+
static int
Pkgb_SubObjCmd(
ClientData dummy, /* Not used. */
@@ -54,6 +58,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));