summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/minibuf.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9265051e311..9d5dff49166 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-12 Eli Zaretskii <eliz@gnu.org>
+
+ * minibuf.c (read_minibuf_noninteractive) [WINDOWSNT]: Switch
+ stdin to binary mode only if it is connected to a terminal.
+
2014-07-11 Paul Eggert <eggert@cs.ucla.edu>
Coalesce extern decls.
diff --git a/src/minibuf.c b/src/minibuf.c
index 1f2fb1fdf3f..e2450b53964 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -241,7 +241,8 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
{
emacs_get_tty (fileno (stdin), &etty);
#ifdef WINDOWSNT
- _setmode (fileno (stdin), O_BINARY);
+ if (isatty (fileno (stdin)))
+ _setmode (fileno (stdin), O_BINARY);
#endif
suppress_echo_on_tty (fileno (stdin));
}
@@ -282,7 +283,8 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
fprintf (stdout, "\n");
emacs_set_tty (fileno (stdin), &etty, 0);
#ifdef WINDOWSNT
- _setmode (fileno (stdin), O_TEXT);
+ if (isatty (fileno (stdin)))
+ _setmode (fileno (stdin), O_TEXT);
#endif
}