summaryrefslogtreecommitdiffstats
path: root/lib/libncurses/lib_getch.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-12-02 06:40:24 +0000
committerache <ache@FreeBSD.org>1994-12-02 06:40:24 +0000
commitda3bc85e1374c51c5dced6baacf60288a5a3ea40 (patch)
tree0beef683196d6d2f76165d3756c20ac09c0ee20b /lib/libncurses/lib_getch.c
parentd856190a55e1ac4bbc1e389083c70c3a9c37746e (diff)
downloadFreeBSD-src-da3bc85e1374c51c5dced6baacf60288a5a3ea40.zip
FreeBSD-src-da3bc85e1374c51c5dced6baacf60288a5a3ea40.tar.gz
Upgrade to version 1.8.6
Diffstat (limited to 'lib/libncurses/lib_getch.c')
-rw-r--r--lib/libncurses/lib_getch.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libncurses/lib_getch.c b/lib/libncurses/lib_getch.c
index 56fdb5b..458cdec 100644
--- a/lib/libncurses/lib_getch.c
+++ b/lib/libncurses/lib_getch.c
@@ -14,7 +14,7 @@
#include <string.h>
#include <signal.h>
#include <errno.h>
-#ifdef BRAINDEAD
+#if defined(BRAINDEAD)
extern int errno;
#endif
#include "curses.priv.h"
@@ -79,6 +79,7 @@ again:
n = read(fileno(SP->_ifp), &ch, 1);
if (n == -1 && errno == EINTR)
goto again;
+ T(("read %d characters", n));
SP->_fifo[tail] = ch;
if (head == -1) head = tail;
t_inc();
@@ -139,7 +140,8 @@ int ch;
if (win->_use_keypad)
ch = kgetch(win);
else {
- fifo_push();
+ if (head == -1)
+ fifo_push();
ch = fifo_pull();
}
@@ -182,7 +184,7 @@ kgetch(WINDOW *win)
{
struct try *ptr;
int ch = 0;
-int timeleft = 2000;
+int timeleft = 1000;
T(("kgetch(%x) called", win));
@@ -204,8 +206,7 @@ int timeleft = 2000;
} else { /* go back for another character */
ptr = ptr->child;
T(("going back for more"));
- }
- else
+ } else
break;
T(("waiting for rest of sequence"));
OpenPOWER on IntegriCloud