emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117519: Fix reading input without echoing on MS-Win


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r117519: Fix reading input without echoing on MS-Windows.
Date: Fri, 11 Jul 2014 15:45:22 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117519
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17839
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2014-07-11 18:44:25 +0300
message:
  Fix reading input without echoing on MS-Windows.
  
   src/minibuf.c (read_minibuf_noninteractive) [WINDOWSNT]: Switch stdin
   to binary mode when not echoing input.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/minibuf.c                  minibuf.c-20091113204419-o5vbwnq5f7feedwu-242
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-11 13:58:02 +0000
+++ b/src/ChangeLog     2014-07-11 15:44:25 +0000
@@ -2,6 +2,7 @@
 
        * 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.

=== modified file 'src/minibuf.c'
--- a/src/minibuf.c     2014-07-11 13:58:02 +0000
+++ b/src/minibuf.c     2014-07-11 15:44:25 +0000
@@ -22,6 +22,10 @@
 #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 @@
   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 @@
     {
       fprintf (stdout, "\n");
       emacs_set_tty (fileno (stdin), &etty, 0);
+#ifdef WINDOWSNT
+      _setmode (fileno (stdin), O_TEXT);
+#endif
     }
 
   if (len || c == '\n' || c == '\r')


reply via email to

[Prev in Thread] Current Thread [Next in Thread]