Skip to content

Commit

Permalink
Remove obsolete and partial crash workaround (re: 61437b2, 51b2e36)
Browse files Browse the repository at this point in the history
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.

#103 (comment)
  • Loading branch information
McDutchie committed Jul 19, 2022
1 parent 6c71c5e commit 60b3e3a
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/cmd/ksh93/sh/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit 60b3e3a

Please sign in to comment.