Hello ports@,

The patch below fixes a small bug in calcurse, where in some cases
(e.g., TERM=pccon0) wgetch(3) can return KEY_ENTER instead of '\n'
(when the return key is pressed), causing calcurse's getstring()
to fail.

Regards,
Aslan


Index: Makefile
===================================================================
RCS file: /cvs/ports/productivity/calcurse/Makefile,v
retrieving revision 1.25
diff -u -p -u -r1.25 Makefile
--- Makefile    22 Mar 2018 23:15:29 -0000      1.25
+++ Makefile    11 Oct 2018 06:17:19 -0000
@@ -3,7 +3,7 @@
 COMMENT=       text-based calendar and scheduling application
 
 DISTNAME=      calcurse-4.3.0
-REVISION=      0
+REVISION=      1
 EPOCH=         0
 
 CATEGORIES=    productivity
Index: patches/patch-src_getstring_c
===================================================================
RCS file: patches/patch-src_getstring_c
diff -N patches/patch-src_getstring_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_getstring_c       11 Oct 2018 06:17:19 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+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 */

Reply via email to