diff options
author | dgp <dgp@users.sourceforge.net> | 2006-10-11 20:41:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-10-11 20:41:15 (GMT) |
commit | cb0c6b2b09bb7c74985e12d5983a636bc6046553 (patch) | |
tree | 2e75eb560ae31ed025489575c89c6e75e80909da | |
parent | b8681b96906f6ff8a7b3a24be9596edd0ce7f307 (diff) | |
download | tcl-cb0c6b2b09bb7c74985e12d5983a636bc6046553.zip tcl-cb0c6b2b09bb7c74985e12d5983a636bc6046553.tar.gz tcl-cb0c6b2b09bb7c74985e12d5983a636bc6046553.tar.bz2 |
* generic/tclPkg.c (Tcl_PackageRequireEx): Corrected crash
when argument version=NULL passed in.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclPkg.c | 20 |
2 files changed, 17 insertions, 8 deletions
@@ -1,3 +1,8 @@ +2006-10-11 Don Porter <dgp@users.sourceforge.net> + + * generic/tclPkg.c (Tcl_PackageRequireEx): Corrected crash + when argument version=NULL passed in. + 2006-10-10 Don Porter <dgp@users.sourceforge.net> *** 8.5a5 TAGGED FOR RELEASE *** diff --git a/generic/tclPkg.c b/generic/tclPkg.c index d2952a0..029f0b5 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.19 2006/09/28 20:54:45 andreas_kupries Exp $ + * RCS: @(#) $Id: tclPkg.c,v 1.20 2006/10/11 20:41:16 dgp Exp $ * * TIP #268. * Heavily rewritten to handle the extend version numbers, and extended @@ -282,15 +282,19 @@ Tcl_PkgRequireEx( /* 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; |