summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 8b7283ba6a..15832a8c0a 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2135,6 +2135,9 @@ init_stdhandle(void)
if (fileno(stdin) < 0) {
stdin->_file = open_null(0);
}
+ else {
+ setmode(fileno(stdin), O_BINARY);
+ }
if (fileno(stdout) < 0) {
stdout->_file = open_null(1);
}
@@ -5817,3 +5820,8 @@ rb_w32_inet_ntop(int af, void *addr, char *numaddr, size_t numaddr_len)
}
return numaddr;
}
+
+char
+rb_w32_fd_is_text(int fd) {
+ return _osfile(fd) & FTEXT;
+}