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.
This commit is contained in:
Samadi van Koten 2018-01-28 14:51:38 +00:00 committed by Michael Forney
parent 4b9c6645f5
commit 44ccadcde3

4
ed.c
View File

@ -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();
}