diff options
Diffstat (limited to 'generic/tkStubLib.c')
-rw-r--r-- | generic/tkStubLib.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 93033ae..6c884c5 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.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: tkStubLib.c,v 1.15 2007/09/07 00:34:53 dgp Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.16 2007/09/17 14:58:04 dgp Exp $ */ /* @@ -85,11 +85,29 @@ Tk_InitStubs( CONST char *actualVersion; TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */ - actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact, + actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0, (ClientData *) stubsPtrPtr); if (!actualVersion) { 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, "Tk", version, 1, NULL); + if (actualVersion == NULL) { + return NULL; + } + } + } if (!tkStubsPtr) { Tcl_SetResult(interp, |