From 20c5fc1767436ee106156a9aabf6545e72a4b519 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Thu, 10 Dec 2015 01:02:02 +0100 Subject: Use custom function to feed console instead of trying to be clever and capturing stdout. This fixes IO on Windows 8 and Windows 10. --- src/ui_readline.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ui_readline.c') diff --git a/src/ui_readline.c b/src/ui_readline.c index ebb21ef..5d6b7a7 100644 --- a/src/ui_readline.c +++ b/src/ui_readline.c @@ -241,7 +241,7 @@ size_t BarReadline (char *buf, const size_t bufSize, const char *mask, case VK_RETURN: if (echo) - fputc('\n', stdout); + BarConsolePutc('\n'); return bufLen; default: { @@ -274,8 +274,8 @@ size_t BarReadline (char *buf, const size_t bufSize, const char *mask, strncpy(bufOut, encodedCodePoint, encodedCodePointLength); if (echo) { - fputs(encodedCodePoint, stdout); - fflush(stdout); + BarConsolePuts(encodedCodePoint); + BarConsoleFlush(); } bufOut += encodedCodePointLength; @@ -285,7 +285,7 @@ size_t BarReadline (char *buf, const size_t bufSize, const char *mask, if ((bufLen >= (int)(bufSize - 1)) && overflow) { if (echo) - fputc('\n', stdout); + BarConsolePutc('\n'); return bufLen; } } -- cgit v1.2.3