[hackers] [sbase] Fix line buffering issue with ed prompt || Samadi van Koten

From: <git_AT_suckless.org>
Date: Sat, 24 Feb 2018 09:15:19 +0100 (CET)

commit 44ccadcde30136253b7623a8eb2f17883d725d43
Author: Samadi van Koten <samadi_AT_vktec.co.uk>
AuthorDate: Sun Jan 28 14:51:38 2018 +0000
Commit: Michael Forney <mforney_AT_mforney.org>
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
_AT_@ -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();
         }
Received on Sat Feb 24 2018 - 09:15:19 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 24 2018 - 09:24:32 CET