diff options
-rw-r--r-- | win32/winansi.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/win32/winansi.c b/win32/winansi.c index dc98b9d2b..0dd2e17f2 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -850,13 +850,7 @@ static int ansi_emulate(const char *s, FILE *stream) | |||
850 | 850 | ||
851 | int winansi_putchar(int c) | 851 | int winansi_putchar(int c) |
852 | { | 852 | { |
853 | char t = c; | 853 | return winansi_fputc(c, stdout); |
854 | char *s = &t; | ||
855 | |||
856 | if (!is_console(STDOUT_FILENO)) | ||
857 | return putchar(c); | ||
858 | |||
859 | return conv_fwriteCon(stdout, s, 1) == EOF ? EOF : (unsigned char)c; | ||
860 | } | 854 | } |
861 | 855 | ||
862 | int winansi_puts(const char *s) | 856 | int winansi_puts(const char *s) |
@@ -947,7 +941,7 @@ int winansi_fputc(int c, FILE *stream) | |||
947 | char t = c; | 941 | char t = c; |
948 | char *s = &t; | 942 | char *s = &t; |
949 | 943 | ||
950 | if (!is_console(fileno(stream))) { | 944 | if ((unsigned char)c <= 0x7f || !is_console(fileno(stream))) { |
951 | SetLastError(0); | 945 | SetLastError(0); |
952 | if ((ret=fputc(c, stream)) == EOF) | 946 | if ((ret=fputc(c, stream)) == EOF) |
953 | check_pipe(stream); | 947 | check_pipe(stream); |