1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

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
This commit is contained in:
Eli Zaretskii 2014-07-12 10:47:40 +03:00
parent cf90015a10
commit 2a0bae50e3
2 changed files with 9 additions and 2 deletions

View File

@ -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.

View File

@ -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
}