diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-05 14:27:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-05 14:27:20 (GMT) |
commit | 570a13bc17e30542ae39ec77fe3b3cdc37a1979c (patch) | |
tree | 33d0914dd38a59968c26095328543dbdcc537eaa /generic/tclLoad.c | |
parent | 45db0256846ed40d1eef23295a881e985a14a4d7 (diff) | |
download | tcl-570a13bc17e30542ae39ec77fe3b3cdc37a1979c.zip tcl-570a13bc17e30542ae39ec77fe3b3cdc37a1979c.tar.gz tcl-570a13bc17e30542ae39ec77fe3b3cdc37a1979c.tar.bz2 |
Fix [7c7d3b4481d4e4e86420b54031f4abd1df18d64|7c7d3b4481]: load test failures. There's a difference between "" and NULL as interpreter name.
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r-- | generic/tclLoad.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c index aabe3bb..44085d6 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -1051,7 +1051,7 @@ TclGetLoadedPackagesEx( * otherwise, just return info about this * interpreter. */ const char *packageName) /* Package name or NULL. If NULL, return info - * all packages. + * for all packages. */ { Tcl_Interp *target; @@ -1060,26 +1060,6 @@ TclGetLoadedPackagesEx( Tcl_Obj *resultObj, *pkgDesc[2]; if (targetName == NULL) { - /* - * Return information about all of the available packages. - */ - if (packageName) { - resultObj = NULL; - Tcl_MutexLock(&packageMutex); - for (pkgPtr = firstPackagePtr; pkgPtr != NULL; - pkgPtr = pkgPtr->nextPtr) { - if (!strcmp(packageName, pkgPtr->packageName)) { - resultObj = Tcl_NewStringObj(pkgPtr->fileName, -1); - break; - } - } - Tcl_MutexUnlock(&packageMutex); - if (resultObj) { - Tcl_SetObjResult(interp, resultObj); - } - return TCL_OK; - } - resultObj = Tcl_NewObj(); Tcl_MutexLock(&packageMutex); for (pkgPtr = firstPackagePtr; pkgPtr != NULL; @@ -1095,6 +1075,26 @@ TclGetLoadedPackagesEx( } /* + * Return information about all of the available packages. + */ + if (packageName) { + resultObj = NULL; + Tcl_MutexLock(&packageMutex); + for (pkgPtr = firstPackagePtr; pkgPtr != NULL; + pkgPtr = pkgPtr->nextPtr) { + if (!strcmp(packageName, pkgPtr->packageName)) { + resultObj = Tcl_NewStringObj(pkgPtr->fileName, -1); + break; + } + } + Tcl_MutexUnlock(&packageMutex); + if (resultObj) { + Tcl_SetObjResult(interp, resultObj); + } + return TCL_OK; + } + + /* * Return information about only the packages that are loaded in a given * interpreter. */ |