Commit 2a0bae50 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Minor fix for read_minibuf_noninteractive on MS-Windows.

 src/minibuf.c (read_minibuf_noninteractive) [WINDOWSNT]: Switch
 stdin to binary mode only if it is connected to a terminal.

Fixes: debbugs:17839
parent cf90015a
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.
......
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment