summaryrefslogtreecommitdiffstats
path: root/generic/tclPkg.c
diff options
context:
space:
mode:
authorandreas_kupries <andreas_kupries@noemail.net>2006-10-11 21:32:11 (GMT)
committerandreas_kupries <andreas_kupries@noemail.net>2006-10-11 21:32:11 (GMT)
commit583663a8d9bd2d7536b373952a2461fabd3bc03d (patch)
tree01b84e7284a5cfaa0c90c487c4805c2936ec0ac3 /generic/tclPkg.c
parente36afe82bec3f3ac9cb588b3856a579a8641e60a (diff)
downloadtcl-583663a8d9bd2d7536b373952a2461fabd3bc03d.zip
tcl-583663a8d9bd2d7536b373952a2461fabd3bc03d.tar.gz
tcl-583663a8d9bd2d7536b373952a2461fabd3bc03d.tar.bz2
* generic/tclPkg.c (Tcl_PkgRequireEx): Corrected crash when
argument version==NULL passed in. Backport of the fix for the same problem in 8.5. FossilOrigin-Name: 52ce4a8c3aef5bd7835b2c22787e7cdde919d956
Diffstat (limited to 'generic/tclPkg.c')
-rw-r--r--generic/tclPkg.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 052992a..8f1f413 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.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: tclPkg.c,v 1.9.2.6 2006/09/22 18:31:54 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclPkg.c,v 1.9.2.7 2006/10/11 21:32:13 andreas_kupries Exp $
*
* TIP #268.
* Heavily rewritten to handle the extend version numbers, and extended
@@ -332,15 +332,19 @@ Tcl_PkgRequireEx(interp, name, version, exact, clientDataPtr)
#ifdef TCL_TIP268
/* Translate between old and new API, and defer to the new function. */
- if (exact) {
- ov = ExactRequirement (version);
+ if (version == NULL) {
+ res = Tcl_PkgRequireProc(interp, name, 0, NULL, clientDataPtr);
} else {
- ov = Tcl_NewStringObj (version,-1);
- }
+ if (exact) {
+ ov = ExactRequirement (version);
+ } else {
+ ov = Tcl_NewStringObj (version,-1);
+ }
- Tcl_IncrRefCount (ov);
- res = Tcl_PkgRequireProc(interp, name, 1, &ov, clientDataPtr);
- Tcl_DecrRefCount (ov);
+ Tcl_IncrRefCount (ov);
+ res = Tcl_PkgRequireProc(interp, name, 1, &ov, clientDataPtr);
+ Tcl_DecrRefCount (ov);
+ }
if (res != TCL_OK) {
return NULL;