summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-04 08:34:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-04 08:34:32 (GMT)
commitbb81e3d8bc4e2c0eb6898fdbe724d5643e75d2cc (patch)
tree2abb404592d4d77b0c723c809e0682ada734db38 /generic/tclStubLib.c
parent6f640f9e5701a60ac0fbde981742fd3a80f59d18 (diff)
parent578ce801fa24d938208f1ef2fe164283d686caf9 (diff)
downloadtcl-bb81e3d8bc4e2c0eb6898fdbe724d5643e75d2cc.zip
tcl-bb81e3d8bc4e2c0eb6898fdbe724d5643e75d2cc.tar.gz
tcl-bb81e3d8bc4e2c0eb6898fdbe724d5643e75d2cc.tar.bz2
TIP #414 implementation
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r--generic/tclStubLib.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index 859cbf9..3656f9a 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -73,37 +73,42 @@ Tcl_InitStubs(
return NULL;
}
- actualVersion = stubsPtr->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(iPtr->errorLine == TCL_STUB_MAGIC) {
+ actualVersion = (const char *)interp;
+ tclStubsPtr = stubsPtr;
+ } else {
+ actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 0, &pkgData);
+ if (actualVersion == NULL) {
+ return NULL;
}
- if (count == 1) {
- const char *q = actualVersion;
+ if (exact) {
+ const char *p = version;
+ int count = 0;
- p = version;
- while (*p && (*p == *q)) {
- p++; q++;
- }
- if (*p || isDigit(*q)) {
- /* Construct error message */
- stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
- return NULL;
+ while (*p) {
+ count += !isDigit(*p++);
}
- } else {
- actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
- if (actualVersion == NULL) {
- return NULL;
+ if (count == 1) {
+ const char *q = actualVersion;
+
+ p = version;
+ while (*p && (*p == *q)) {
+ p++; q++;
+ }
+ if (*p || isDigit(*q)) {
+ /* Construct error message */
+ stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
+ return NULL;
+ }
+ } else {
+ actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
+ if (actualVersion == NULL) {
+ return NULL;
+ }
}
}
+ tclStubsPtr = (const TclStubs *)pkgData;
}
- tclStubsPtr = (TclStubs *)pkgData;
if (tclStubsPtr->hooks) {
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;