summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-03 10:17:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-03 10:17:14 (GMT)
commit342be44f4da2cc09411fd0dc070ddcab26d87355 (patch)
tree6409566107a1b493b87f1d79be68f18648b64ee9
parente42dd00e9836c6252fccd12da751140385e6bff5 (diff)
downloadtcl-342be44f4da2cc09411fd0dc070ddcab26d87355.zip
tcl-342be44f4da2cc09411fd0dc070ddcab26d87355.tar.gz
tcl-342be44f4da2cc09411fd0dc070ddcab26d87355.tar.bz2
don't use iPtr->legacyResult for Tcl >= 8.1, because it doesn't work. Use Tcl_AppendResult in stead.
-rw-r--r--generic/tclStubLib.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index fc07c26..fb9c132 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -108,8 +108,18 @@ TclInitStubs(
* This is quicker to check for than calling Tcl_GetVersion() */
if (sizeof(size_t) != sizeof(int)) {
if (stubsPtr->reserved77 != NULL) {
- iPtr->legacyResult = "incompatible stub library: have 9, need 8";
- iPtr->legacyFreeProc = 0; /* TCL_STATIC */
+ /* Accessing iPtr->legacyResult doesn't work here as Tcl 8 doesn't
+ * check this field after the Xxx_Init call. */
+ char stripped[32]; /* Requested version stripped starting with '-' */
+ char *p = stripped;
+
+ while (*version && (*version != '-')) {
+ *p++ = *version++;
+ }
+ *p = '\0';
+ stubsPtr->tcl_ResetResult(interp);
+ stubsPtr->tcl_AppendResult(interp, "incompatible stub library: have ",
+ tclversion, ", need ", stripped, NULL);
return NULL;
}
}