From 60b3e3a28dd99c885d6e39bde12677e5f02bd3a9 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 19 Jul 2022 08:54:19 +0200 Subject: [PATCH] Remove obsolete and partial crash workaround (re: 61437b27, 51b2e360) The fix for #103 was incomplete and papered over the problem. The real fix for this bug was applied in 51b2e36 on 20th February 2021. That crash was the same one triggered differently. https://github.com/ksh93/ksh/issues/103#issuecomment-1188666733 --- src/cmd/ksh93/sh/io.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/cmd/ksh93/sh/io.c b/src/cmd/ksh93/sh/io.c index e02c4ee6d..a6e12eef9 100644 --- a/src/cmd/ksh93/sh/io.c +++ b/src/cmd/ksh93/sh/io.c @@ -2125,17 +2125,12 @@ static int io_prompt(Sfio_t *iop,register int flag) char *endprompt; static short cmdno; int sfflags; - int was_ttywait_on; if(flag<3 && !sh_isstate(SH_INTERACTIVE)) flag = 0; if(flag==2 && sfpkrd(sffileno(iop),buff,1,'\n',0,1) >= 0) flag = 0; if(flag==0) return(sfsync(sfstderr)); - /* Temporarily disable 'set -o notify' while expanding the prompt to avoid - possible crashes (https://github.com/ksh93/ksh/issues/103). */ - was_ttywait_on = sh_isstate(SH_TTYWAIT); - sh_offstate(SH_TTYWAIT); sfflags = sfset(sfstderr,SF_SHARE|SF_PUBLIC|SF_READ,0); if(!(sh.prompt=(char*)sfreserve(sfstderr,0,0))) sh.prompt = ""; @@ -2197,8 +2192,6 @@ static int io_prompt(Sfio_t *iop,register int flag) done: if(*sh.prompt && (endprompt=(char*)sfreserve(sfstderr,0,0))) *endprompt = 0; - if(was_ttywait_on) - sh_onstate(SH_TTYWAIT); /* re-enable 'set -o notify' */ sfset(sfstderr,sfflags&SF_READ|SF_SHARE|SF_PUBLIC,1); return(sfsync(sfstderr)); }