[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b8bf62b: On MS-Windows, fflush stderr after newline
From: |
Paul Eggert |
Subject: |
master b8bf62b: On MS-Windows, fflush stderr after newline |
Date: |
Thu, 11 Mar 2021 13:43:38 -0500 (EST) |
branch: master
commit b8bf62b60a63e4af4be0cfdd7b4e0d4b424af45c
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
On MS-Windows, fflush stderr after newline
Problem reported by Ioannis Kappas (Bug#46388).
* src/sysdep.c (errputc) [WINDOWSNT]: Flush stderr after newline.
---
src/sysdep.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/sysdep.c b/src/sysdep.c
index 24d8832..d940acc 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b8bf62b: On MS-Windows, fflush stderr after newline,
Paul Eggert <=