Permalink
Browse files

package: fix corruption of versions string

Partially revert 5f31686

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 <florian.schaefer+github@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
  • Loading branch information...
1 parent ade2e02 commit 769d198e1e1ea936d21523bb1b301255dc79233e @msteveb committed Feb 6, 2014
Showing with 3 additions and 4 deletions.
  1. +3 −4 jim-package.c
View
@@ -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);
}
/*

0 comments on commit 769d198

Please sign in to comment.