From: Paul Eggert Date: Thu, 11 Mar 2021 18:35:04 +0000 (-0800) Subject: On MS-Windows, fflush stderr after newline X-Git-Tag: emacs-28.0.90~3317 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b8bf62b60a63e4af4be0cfdd7b4e0d4b424af45c;p=emacs.git On MS-Windows, fflush stderr after newline Problem reported by Ioannis Kappas (Bug#46388). * src/sysdep.c (errputc) [WINDOWSNT]: Flush stderr after newline. --- diff --git a/src/sysdep.c b/src/sysdep.c index 24d8832b2f3..d940acc4e05 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2670,6 +2670,13 @@ void errputc (int c) { fputc_unlocked (c, errstream ()); + +#ifdef WINDOWSNT + /* Flush stderr after outputting a newline since stderr is fully + buffered when redirected to a pipe, contrary to POSIX. */ + if (c == '\n') + fflush_unlocked (stderr); +#endif } void