[misc] calcurse 7b81e69 and OpenBSD patches - wgetch and TERM pccon0

Hi,

Another patch currently in OpenBSD ports tree for calcurse. This
is not only specific for calcurse, other software (like abook)
recently got similar change. GitHub mirror with patch against
4.3.0:

https://github.com/openbsd/ports/blob/master/productivity/calcurse/patches/patch-src_getstring_c

Patch regenerated against git commit 7b81e69:

$OpenBSD: patch-src_getstring_c,v 1.1 2018/10/19 14:19:59 naddy Exp $

In some cases (e.g., TERM=pccon0) wgetch(3) can return KEY_ENTER
instead of '\n' when the return key is pressed, causing getstring()
to fail.

Index: src/getstring.c
--- src/getstring.c.orig
+++ src/getstring.c
@@ -191,7 +191,8 @@ enum getstr getstring(WINDOW * win, char *str, int l, 
 		getstr_print(win, x, y, &st);
 		wins_doupdate();
 
-		if ((ch = wgetch(win)) == '\n')
+		ch = wgetch(win);
+		if ((ch == '\n') || (ch == KEY_ENTER))
 			break;
 		switch (ch) {
 		case KEY_BACKSPACE:	/* delete one character */


Please CC me with any replies, as I have email delivery for the mailing
list disabled. Thanks.

-- 
Regards,
 Mikolaj

Links