summaryrefslogtreecommitdiff
path: root/games/canfield
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2021-01-21 20:08:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2021-01-21 20:08:18 +0000
commitfa83e8b8bb17a6bc5c7b7cba4a25a0ec70dcf515 (patch)
treef74ff016e40249fabe0f274a0d86ac4cea003b6c /games/canfield
parent33c663a159b6e3b24b2434360cb9703aa71cb16d (diff)
Ignore special keys returned by the curses getch() function.
Prevents canfield from suspending itself when you resize the window. Canfield is not prepared to deal with anything other than normal characters so just ignore them. OK tb@ pjanzen@
Diffstat (limited to 'games/canfield')
-rw-r--r--games/canfield/canfield/canfield.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c
index df81b14f517..346fd20a1d2 100644
--- a/games/canfield/canfield/canfield.c
+++ b/games/canfield/canfield/canfield.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: canfield.c,v 1.28 2018/08/24 11:14:49 mestre Exp $ */
+/* $OpenBSD: canfield.c,v 1.29 2021/01/21 20:08:17 millert Exp $ */
/* $NetBSD: canfield.c,v 1.7 1995/05/13 07:28:35 jtc Exp $ */
/*
@@ -1332,7 +1332,8 @@ getcmd(int row, int col, const char *cp)
do {
if ((ch = getch()) == ERR)
cleanup(0);
- ch &= 0177;
+ if (ch >= KEY_MIN)
+ continue;
if (ch >= 'A' && ch <= 'Z')
ch += ('a' - 'A');
if (ch == '\f') {