Jim Tcl
Check-in [c6eab746a7]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:interp: command should be created in the global namespace

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c6eab746a7211614152d8a05061ef03b492d5dac
User & Date: steveb@workware.net.au 2017-11-04 09:16:03
Context
2017-11-07
21:47
tclcompat.tcl: minor comment updates

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 92e4698aad user: steveb@workware.net.au tags: trunk

2017-11-04
09:16
interp: command should be created in the global namespace

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: c6eab746a7 user: steveb@workware.net.au tags: trunk

09:16
tests: exec2-3.2 now passes on OpenBSD

Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 713502fb49 user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim-interp.c.

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
    JimInterpCopyVariable(child, interp, "jim::exe", NULL);

    /* Allow the child interpreter to find the parent */
    Jim_SetAssocData(child, "interp.parent", NULL, interp);

    snprintf(buf, sizeof(buf), "interp.handle%ld", Jim_GetId(interp));
    Jim_CreateCommand(interp, buf, JimInterpSubCmdProc, child, JimInterpDelProc);
    Jim_SetResultString(interp, buf, -1);
    return JIM_OK;
}

int Jim_interpInit(Jim_Interp *interp)
{
    if (Jim_PackageProvide(interp, "interp", "1.0", JIM_ERRMSG))
        return JIM_ERR;

    Jim_CreateCommand(interp, "interp", JimInterpCommand, NULL, NULL);

    return JIM_OK;
}







|












159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
    JimInterpCopyVariable(child, interp, "jim::exe", NULL);

    /* Allow the child interpreter to find the parent */
    Jim_SetAssocData(child, "interp.parent", NULL, interp);

    snprintf(buf, sizeof(buf), "interp.handle%ld", Jim_GetId(interp));
    Jim_CreateCommand(interp, buf, JimInterpSubCmdProc, child, JimInterpDelProc);
    Jim_SetResult(interp, Jim_MakeGlobalNamespaceName(interp, Jim_NewStringObj(interp, buf, -1)));
    return JIM_OK;
}

int Jim_interpInit(Jim_Interp *interp)
{
    if (Jim_PackageProvide(interp, "interp", "1.0", JIM_ERRMSG))
        return JIM_ERR;

    Jim_CreateCommand(interp, "interp", JimInterpCommand, NULL, NULL);

    return JIM_OK;
}