From 44ccadcde30136253b7623a8eb2f17883d725d43 Mon Sep 17 00:00:00 2001 From: Samadi van Koten Date: Sun, 28 Jan 2018 14:51:38 +0000 Subject: [PATCH] Fix line buffering issue with ed prompt This fixes an issue whereby ed would not output the prompt (when enabled) until after exitting due to stdout being line-buffered. --- ed.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ed.c b/ed.c index 4b28848..f45535c 100644 --- a/ed.c +++ b/ed.c @@ -1374,8 +1374,10 @@ edit(void) ocurln = curln; cmdsiz = 0; repidx = -1; - if (optprompt) + if (optprompt) { fputs(prompt, stdout); + fflush(stdout); + } getlst(); chkglobal() ? doglobal() : docmd(); }