diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-05 14:47:07 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-05 14:47:07 (GMT) |
commit | bc79da4cbdd316c54d2a5b1e58de629b1c114ade (patch) | |
tree | 6cdb4748d375f599c6f943f9dcd5438d330043bd /generic | |
parent | 7660a167e1a0bfce591e4b2a7b6b7043e72925af (diff) | |
parent | 2ba138980311e60d5317ba5ed8814e11d9c4a997 (diff) | |
download | tcl-bc79da4cbdd316c54d2a5b1e58de629b1c114ade.zip tcl-bc79da4cbdd316c54d2a5b1e58de629b1c114ade.tar.gz tcl-bc79da4cbdd316c54d2a5b1e58de629b1c114ade.tar.bz2 |
Merge trunk
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCmdIL.c | 3 | ||||
-rw-r--r-- | generic/tclLoad.c | 42 |
2 files changed, 21 insertions, 24 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index ec85741..a7a5f43 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -1728,9 +1728,6 @@ InfoLoadedCmd( interpName = NULL; } else { /* Get pkgs just in specified interp. */ interpName = TclGetString(objv[1]); - if (!interpName[0]) { - interpName = NULL; - } } if (objc < 3) { /* Get loaded files in all packages. */ packageName = NULL; 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. */ |