summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-09-17 14:50:42 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-09-17 14:50:42 (GMT)
commit531cd3e85b7f36bc521f8e9f4f3a0394e3be5b84 (patch)
tree02776b4d71e3ead075f236772f6f91ef36a9956f /generic/tclStubLib.c
parent3ad66d99fd717405fb14ba64c0c8560bee0dc477 (diff)
downloadtcl-531cd3e85b7f36bc521f8e9f4f3a0394e3be5b84.zip
tcl-531cd3e85b7f36bc521f8e9f4f3a0394e3be5b84.tar.gz
tcl-531cd3e85b7f36bc521f8e9f4f3a0394e3be5b84.tar.bz2
* generic/tcl.h: Revised Tcl_InitStubs() to restore Tcl 8.4
* generic/tclPkg.c: source compatibility with callers of * generic/tclStubLib.c: Tcl_InitStubs(interp, TCL_VERSION, 1). [Bug 1578344].
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r--generic/tclStubLib.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index 5389cfc..be2a1fa 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStubLib.c,v 1.15 2007/05/16 18:28:40 jenglish Exp $
+ * RCS: @(#) $Id: tclStubLib.c,v 1.16 2007/09/17 14:50:44 dgp Exp $
*/
/*
@@ -95,10 +95,28 @@ Tcl_InitStubs(
return NULL;
}
- actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact, &pkgData);
+ actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, 0, &pkgData);
if (actualVersion == NULL) {
return NULL;
}
+ if (exact) {
+ CONST char *p = version;
+ int count = 0;
+
+ while (*p) {
+ count += !isdigit(*p++);
+ }
+ if (count == 1) {
+ if (0 != strncmp(version, actualVersion, strlen(version))) {
+ return NULL;
+ }
+ } else {
+ actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
+ if (actualVersion == NULL) {
+ return NULL;
+ }
+ }
+ }
tclStubsPtr = (TclStubs*)pkgData;
if (tclStubsPtr->hooks) {