summaryrefslogtreecommitdiff
path: root/src/minibuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/minibuf.c')
-rw-r--r--src/minibuf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index c77f5955d86..5b6c9154621 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -22,6 +22,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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"
@@ -240,6 +244,9 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
if (hide_char)
{
emacs_get_tty (fileno (stdin), &etty);
+#ifdef WINDOWSNT
+ _setmode (fileno (stdin), O_BINARY);
+#endif
suppress_echo_on_tty (fileno (stdin));
}
@@ -278,6 +285,9 @@ 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);
+#endif
}
if (len || c == '\n' || c == '\r')