aboutsummaryrefslogtreecommitdiff
path: root/jim-interp.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-07-13 09:47:40 +1000
committerSteve Bennett <steveb@workware.net.au>2023-08-13 12:43:28 +1000
commit9784dcf88e8f0204550b4218f1c77bfa510a497b (patch)
treed5fa4adb6dcb2d26dd541a1fc1dcbc134101fdf3 /jim-interp.c
parent3c9587340bcd62eef8e246fcd1c0a2469943898f (diff)
downloadjimtcl-9784dcf88e8f0204550b4218f1c77bfa510a497b.zip
jimtcl-9784dcf88e8f0204550b4218f1c77bfa510a497b.tar.gz
jimtcl-9784dcf88e8f0204550b4218f1c77bfa510a497b.tar.bz2
jimsh, interp, tests: fixes when line editing is disabled
- Set jim::lineedit to indicate if line editing is configured - Ensure that aio tty works even if line editing is disabled - Skip some tests if line editing is not configured Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-interp.c')
-rw-r--r--jim-interp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/jim-interp.c b/jim-interp.c
index 90e2474..8868076 100644
--- a/jim-interp.c
+++ b/jim-interp.c
@@ -141,6 +141,10 @@ static int JimInterpCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
Jim_Interp *child;
char buf[34];
+ int i;
+ static const char * const copyvars[] = {
+ "argv", "argc", "argv0", "jim::argv0", "jim::exe", "jim::lineedit", NULL
+ };
if (argc != 1) {
Jim_WrongNumArgs(interp, 1, argv, "");
@@ -153,11 +157,9 @@ static int JimInterpCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
Jim_InitStaticExtensions(child);
/* Copy some core variables to the new interpreter */
- JimInterpCopyVariable(child, interp, "argv", NULL);
- JimInterpCopyVariable(child, interp, "argc", NULL);
- JimInterpCopyVariable(child, interp, "argv0", NULL);
- JimInterpCopyVariable(child, interp, "jim::argv0", NULL);
- JimInterpCopyVariable(child, interp, "jim::exe", NULL);
+ for (i = 0; copyvars[i]; i++) {
+ JimInterpCopyVariable(child, interp, copyvars[i], NULL);
+ }
/* Allow the child interpreter to find the parent */
Jim_SetAssocData(child, "interp.parent", NULL, interp);