From 769d198e1e1ea936d21523bb1b301255dc79233e Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 6 Feb 2014 11:33:28 +1000 Subject: package: fix corruption of versions string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partially revert 5f31686cb40c5b84638dbb5ffe1ad327440e1903 The version isn't allocated in the hash table, so we can't take a reference to a version object. Packages once again have a fixed, dummy "1.0" version. Reported-by: Florian Schäfer Signed-off-by: Steve Bennett --- jim-package.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jim-package.c b/jim-package.c index 3dc9d54..8b37c0a 100644 --- a/jim-package.c +++ b/jim-package.c @@ -9,7 +9,7 @@ #define R_OK 4 #endif -/* All Tcl packages have a fixed, dummy version */ +/* All packages have a fixed, dummy version */ static const char *package_version_1 = "1.0"; /* ----------------------------------------------------------------------------- @@ -157,14 +157,13 @@ int Jim_PackageRequire(Jim_Interp *interp, const char *name, int flags) * The package must not already be provided in the interpreter. * * Results: - * Returns JIM_OK and sets the results to the version (defaults to "1.0") + * Returns JIM_OK and sets results as "1.0" (the given version is ignored) * *---------------------------------------------------------------------- */ static int package_cmd_provide(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - return Jim_PackageProvide(interp, Jim_String(argv[0]), - argc > 1 ? Jim_String(argv[1]) : package_version_1, JIM_ERRMSG); + return Jim_PackageProvide(interp, Jim_String(argv[0]), package_version_1, JIM_ERRMSG); } /* -- cgit v1.1