From f57f7b7a19ce068541466c396e76f8c5b6550ebf Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 20 Feb 2021 22:12:23 +0000 Subject: [PATCH] emacs: more correct fix (re: 9ccb9572) sptr is set to drawbuff, but may change; drawbuff itself will not change and reading before the start of that was the actual cause of the crash. --- src/cmd/ksh93/edit/emacs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/edit/emacs.c b/src/cmd/ksh93/edit/emacs.c index 6ca2aa963..195259835 100644 --- a/src/cmd/ksh93/edit/emacs.c +++ b/src/cmd/ksh93/edit/emacs.c @@ -1445,7 +1445,7 @@ static void draw(register Emacs_t *ep,Draw_t option) *****************************************/ - if(logcursor > sptr) + if(logcursor > drawbuff) i = *(logcursor-1); /* last character inserted */ else i = 0;