commit 44ccadcde30136253b7623a8eb2f17883d725d43
Author: Samadi van Koten <[email protected]>
AuthorDate: Sun Jan 28 14:51:38 2018 +0000
Commit: Michael Forney <[email protected]>
CommitDate: Fri Feb 23 23:58:29 2018 -0800
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.
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();
}