summaryrefslogtreecommitdiff
path: root/jim-sqlite3.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2013-12-09 07:28:30 +1000
committerSteve Bennett <steveb@workware.net.au>2013-12-09 08:20:05 +1000
commitdd213d13411bce204850d48669632bc57b242c7c (patch)
tree8dc14dafde01afe73ca826dff438d40254c927d8 /jim-sqlite3.c
parent2448a2047e587cae8a1b2f401607b7b4c3108429 (diff)
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.c4
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;
}