diff --git a/Src/exec.c b/Src/exec.c index f2911807c..77763f536 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -5962,10 +5962,17 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) sticky = funcsave->sticky; } else if (isset(LOCALOPTIONS)) { /* restore all shell options except PRIVILEGED and RESTRICTED */ +#ifdef MULTIBYTE_SUPPORT + int flip_multibyte = opts[MULTIBYTE]; +#endif funcsave->opts[PRIVILEGED] = opts[PRIVILEGED]; funcsave->opts[RESTRICTED] = opts[RESTRICTED]; memcpy(opts, funcsave->opts, sizeof(opts)); emulation = funcsave->emulation; +#ifdef MULTIBYTE_SUPPORT + if (flip_multibyte != opts[MULTIBYTE]) + inittyptab(); +#endif } else { /* just restore a couple. */ opts[XTRACE] = funcsave->opts[XTRACE];