summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2000-01-23 04:57:41 +0000
committermillert <millert@openbsd.org>2000-01-23 04:57:41 +0000
commit2bbfa12c6ec4d3975c7bfdf5e1b377db08134d8a (patch)
treef8820043321d24c4e4837c401879d3d35392024e
parentremove vga/vgafb for now. mac is currently running on openfirmware (diff)
downloadwireguard-openbsd-2bbfa12c6ec4d3975c7bfdf5e1b377db08134d8a.tar.xz
wireguard-openbsd-2bbfa12c6ec4d3975c7bfdf5e1b377db08134d8a.zip
Update to ncurses-5.0-20000122
-rw-r--r--lib/libcurses/base/lib_getch.c26
-rw-r--r--lib/libcurses/curses.h4
2 files changed, 19 insertions, 11 deletions
diff --git a/lib/libcurses/base/lib_getch.c b/lib/libcurses/base/lib_getch.c
index 65d314e1907..9c1b5f314a6 100644
--- a/lib/libcurses/base/lib_getch.c
+++ b/lib/libcurses/base/lib_getch.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: lib_getch.c,v 1.2 1999/03/11 21:03:55 millert Exp $ */
+/* $OpenBSD: lib_getch.c,v 1.3 2000/01/23 04:57:41 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$From: lib_getch.c,v 1.43 1999/03/08 02:35:10 tom Exp $")
+MODULE_ID("$From: lib_getch.c,v 1.44 2000/01/17 19:58:18 tom Exp $")
#include <fifo_defs.h>
@@ -58,23 +58,31 @@ int nums = SP->_ifd+1;
for (;;) {
FD_ZERO(&fdset);
- FD_SET(SP->_checkfd, &fdset);
+ FD_SET(SP->_ifd, &fdset);
+ if (SP->_checkfd >= 0) {
+ FD_SET(SP->_checkfd, &fdset);
+ if (SP->_checkfd >= nums)
+ nums = SP->_checkfd + 1;
+ }
if (SP->_mouse_fd >= 0) {
FD_SET(SP->_mouse_fd, &fdset);
- if (SP->_mouse_fd > SP->_checkfd)
- nums = SP->_mouse_fd+1;
+ if (SP->_mouse_fd >= nums)
+ nums = SP->_mouse_fd + 1;
}
if (select(nums, &fdset, NULL, NULL, NULL) >= 0) {
int n;
- if (FD_ISSET(SP->_mouse_fd, &fdset)) /* Prefer mouse */
+ if (SP->_mouse_fd >= 0
+ && FD_ISSET(SP->_mouse_fd, &fdset)) { /* Prefer mouse */
n = read(SP->_mouse_fd, p, 1);
- else
+ } else {
n = read(SP->_ifd, p, 1);
+ }
return n;
}
- if (errno != EINTR)
+ if (errno != EINTR) {
return -1;
+ }
}
}
#endif /* USE_EMX_MOUSE */
diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h
index 6c751a4f665..3b1aded0c2e 100644
--- a/lib/libcurses/curses.h
+++ b/lib/libcurses/curses.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.h,v 1.44 2000/01/16 01:35:17 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.45 2000/01/23 04:57:41 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -50,7 +50,7 @@
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 5
#define NCURSES_VERSION_MINOR 0
-#define NCURSES_VERSION_PATCH 20000115
+#define NCURSES_VERSION_PATCH 20000122
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION