Skip to content

Commit

Permalink
Fix editor prediction code garbling input
Browse files Browse the repository at this point in the history
This applies a patch from OpenSUSE. Source:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-edpredict.dif

| Tue Jul  5 14:49:03 CEST 2016 - mls@suse.de
|
| - fix editor prediction code garbling input [bnc#964966]
|   new patch: ksh93-edpredict.dif

Unfortunately the bug report is not currently public:
https://bugzilla.opensuse.org/show_bug.cgi?id=964966
but this one seems sensible enough and is in production use,
so I'll take it on faith.
  • Loading branch information
McDutchie committed Jan 27, 2021
1 parent 9b5ff0f commit db5621d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cmd/ksh93/edit/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
ep->hoff = 0;
#endif /* SHOPT_EDPREDICT */
#if KSHELL
ep->e_stkptr = stakptr(0);
ep->e_stkoff = staktell();
ep->e_stkptr = stakfreeze(0);
if(!(last = shp->prompt))
last = "";
shp->prompt = 0;
Expand Down
4 changes: 1 addition & 3 deletions src/cmd/ksh93/edit/emacs.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,8 @@ int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit)
draw(ep,FINAL);
tty_cooked(ERRIO);
if(ed->e_nlist)
{
ed->e_nlist = 0;
stakset(ed->e_stkptr,ed->e_stkoff);
}
stakset(ed->e_stkptr,ed->e_stkoff);
if(c == '\n')
{
out[eol++] = '\n';
Expand Down
4 changes: 1 addition & 3 deletions src/cmd/ksh93/edit/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,8 @@ int ed_viread(void *context, int fd, register char *shbuf, int nchar, int reedit
/* to cause the shell to process the line */
tty_cooked(ERRIO);
if(ed->e_nlist)
{
ed->e_nlist = 0;
stakset(ed->e_stkptr,ed->e_stkoff);
}
stakset(ed->e_stkptr,ed->e_stkoff);
if( vp->addnl )
{
virtual[++last_virt] = '\n';
Expand Down

0 comments on commit db5621d

Please sign in to comment.