src/minibuf.c (read_minibuf_noninteractive) [WINDOWSNT]: Switch stdin
to binary mode when not echoing input.
Fixes: debbugs:17839
* minibuf.c (read_minibuf_noninteractive): Finish reading on '\r',
not only on '\n'.
+ [WINDOWSNT]: Switch stdin to binary mode when not echoing input.
* sysdep.c (emacs_get_tty, emacs_set_tty, suppress_echo_on_tty)
[DOS_NT]: Implement for WINDOWSNT.
#include <errno.h>
#include <stdio.h>
+#ifdef WINDOWSNT
+#include <fcntl.h> /* For O_BINARY, O_TEXT. */
+#endif
+
#include "lisp.h"
#include "commands.h"
#include "character.h"
if (hide_char)
{
emacs_get_tty (fileno (stdin), &etty);
+#ifdef WINDOWSNT
+ _setmode (fileno (stdin), O_BINARY);
+#endif
suppress_echo_on_tty (fileno (stdin));
}
{
fprintf (stdout, "\n");
emacs_set_tty (fileno (stdin), &etty, 0);
+#ifdef WINDOWSNT
+ _setmode (fileno (stdin), O_TEXT);
+#endif
}
if (len || c == '\n' || c == '\r')