diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-04 16:23:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-04 16:23:23 (GMT) |
commit | 9f5fab9296c69ae125f5d288a5cca0d1dc3321ec (patch) | |
tree | 159bdd1c58c9819216cc696df735b5b0f7b5396d /generic | |
parent | 707993b1dd4f01322cdbea334c71a1202373fa9b (diff) | |
download | tcl-9f5fab9296c69ae125f5d288a5cca0d1dc3321ec.zip tcl-9f5fab9296c69ae125f5d288a5cca0d1dc3321ec.tar.gz tcl-9f5fab9296c69ae125f5d288a5cca0d1dc3321ec.tar.bz2 |
In stead of "source -nopkg" use a ::tcl::Pkg::source utility function.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCmdMZ.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index fbc9d8f..23e6bd1 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -989,11 +989,8 @@ TclNRSourceObjCmd( { const char *encodingName = NULL; Tcl_Obj *fileName; - int result; - void **pkgFiles = NULL; - void *names = NULL; - if (objc < 2 || objc > 4) { + if (objc != 2 && objc !=4) { Tcl_WrongNumArgs(interp, 1, objv, "?-encoding name? fileName"); return TCL_ERROR; } @@ -1011,28 +1008,9 @@ TclNRSourceObjCmd( return TCL_ERROR; } encodingName = TclGetString(objv[2]); - } else if (objc == 3) { - static const char *const nopkgoptions[] = { - "-nopkg", NULL - }; - int index; - - if (TCL_ERROR == Tcl_GetIndexFromObj(interp, objv[1], nopkgoptions, - "option", TCL_EXACT, &index)) { - return TCL_ERROR; - } - pkgFiles = Tcl_GetAssocData(interp, "tclPkgFiles", NULL); - /* Make sure that during the following TclNREvalFile no filenames - * are recorded for inclusion in the "package files" command */ - names = *pkgFiles; - *pkgFiles = NULL; - } - result = TclNREvalFile(interp, fileName, encodingName); - if (pkgFiles) { - /* restore "tclPkgFiles" assocdata to how it was. */ - *pkgFiles = names; } - return result; + + return TclNREvalFile(interp, fileName, encodingName); } /* |