summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c12
-rw-r--r--Src/options.c6
2 files changed, 17 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index f2911807c..c8bcf4ee5 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -5961,11 +5961,23 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval)
emulation = funcsave->emulation;
sticky = funcsave->sticky;
} else if (isset(LOCALOPTIONS)) {
+ /* we need to call inittyptab() if these options change */
+ int init_typtab =
+#ifdef MULTIBYTE_SUPPORT
+ funcsave->opts[MULTIBYTE] != opts[MULTIBYTE] ||
+#endif
+ funcsave->opts[BANGHIST] != opts[BANGHIST] ||
+ funcsave->opts[SHINSTDIN] != opts[SHINSTDIN];
+ /* take care of SUNKEYBOARDHACK but not of EMACS/VI */
+ if (funcsave->opts[SUNKEYBOARDHACK] != opts[SUNKEYBOARDHACK])
+ keyboardhackchar = funcsave->opts[SUNKEYBOARDHACK] ? '`' : '\0';
/* restore all shell options except PRIVILEGED and RESTRICTED */
funcsave->opts[PRIVILEGED] = opts[PRIVILEGED];
funcsave->opts[RESTRICTED] = opts[RESTRICTED];
memcpy(opts, funcsave->opts, sizeof(opts));
emulation = funcsave->emulation;
+ if (init_typtab)
+ inittyptab();
} else {
/* just restore a couple. */
opts[XTRACE] = funcsave->opts[XTRACE];
diff --git a/Src/options.c b/Src/options.c
index a1fe918fc..a994b563e 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -904,7 +904,11 @@ dosetopt(int optno, int value, int force, char *new_opts)
keyboardhackchar = (value ? '`' : '\0');
}
new_opts[optno] = value;
- if (optno == BANGHIST || optno == SHINSTDIN)
+ if (
+#ifdef MULTIBYTE_SUPPORT
+ optno == MULTIBYTE ||
+#endif
+ optno == BANGHIST || optno == SHINSTDIN)
inittyptab();
return 0;
}