From 16e4824c456dde259a765988534d479c8d8e8d75 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 15 Sep 2020 05:50:08 +0200 Subject: [PATCH] emacs.c: unbreak menu-driven pathname completion (re: e8b3274a) One of the few AT&T fixes applied in early 2020 was a one-line change to emacs.c tab handling, with only this info in the commit message: | - fix to emacs.c (I think from dgk) So, it's unknown what that was meant to accomplish, but I did just find that it breaks menu-driven pathname completion: $ ls arch/darwin.i386-64/ 1) bin/ 2) fun/ 3) include/ 4) lib/ 5) man/ 6) src/ $ ls arch/darwin.i386-64/3 _ Typing 3+TAB should have inserted 'include/' but inserted a literal tab instead. Reverting the vague "fix" fixes this bug. --- 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 81ba527a9..533907027 100644 --- a/src/cmd/ksh93/edit/emacs.c +++ b/src/cmd/ksh93/edit/emacs.c @@ -1007,7 +1007,7 @@ static int escape(register Emacs_t* ep,register genchar *out,int count) else if(i=='=' || (i=='\\' && out[cur-1]=='/')) { draw(ep,REFRESH); - if(count>0 || i=='\\') + if(count>0) ep->ed->e_tabcount=0; else {