diff options
author | Steve Bennett <steveb@workware.net.au> | 2013-12-09 07:28:30 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2013-12-09 08:20:05 +1000 |
commit | dd213d13411bce204850d48669632bc57b242c7c (patch) | |
tree | 8dc14dafde01afe73ca826dff438d40254c927d8 /jim-sqlite3.c | |
parent | 2448a2047e587cae8a1b2f401607b7b4c3108429 (diff) | |
download | jimtcl-dd213d13411bce204850d48669632bc57b242c7c.zip jimtcl-dd213d13411bce204850d48669632bc57b242c7c.tar.gz jimtcl-dd213d13411bce204850d48669632bc57b242c7c.tar.bz2 |
Fix aio close from non-global namespace
aio [open], as well as similar commands return the name of the
created command. If this is done in the non-global namespace, the
returned name is implicitly scoped to the current namespace while
the actual command is created in the global namespace. Thus [close]
does not work when invoked in that namespace.
The solution is to return a fully qualified name, such as ::aio.handle3
Note that this may also be a problem for similar command such as
[proc] and [alias] that return command names.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-sqlite3.c')
-rw-r--r-- | jim-sqlite3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/jim-sqlite3.c b/jim-sqlite3.c index 62d8fa9..25efb26 100644 --- a/jim-sqlite3.c +++ b/jim-sqlite3.c @@ -286,7 +286,9 @@ static int JimSqliteOpenCommand(Jim_Interp *interp, int argc, Jim_Obj *const *ar sh->db = db; snprintf(buf, sizeof(buf), "sqlite.handle%ld", Jim_GetId(interp)); Jim_CreateCommand(interp, buf, JimSqliteHandlerCommand, sh, JimSqliteDelProc); - Jim_SetResultString(interp, buf, -1); + + Jim_SetResult(interp, Jim_MakeGlobalNamespaceName(interp, Jim_NewStringObj(interp, buf, -1))); + return JIM_OK; } |