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; ocurln = curln;
cmdsiz = 0; cmdsiz = 0;
repidx = -1; repidx = -1;
if (optprompt) if (optprompt) {
fputs(prompt, stdout); fputs(prompt, stdout);
fflush(stdout);
}
getlst(); getlst();
chkglobal() ? doglobal() : docmd(); chkglobal() ? doglobal() : docmd();
} }