[PATCH] fix a small bug in calcurse

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] fix a small bug in calcurse

Mohamed Aslan
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 | Threaded
Open this post in threaded view
|

Re: [PATCH] fix a small bug in calcurse

Frederic Cambus
On Thu, Oct 11, 2018 at 02:30:48AM -0400, Mohamed Aslan wrote:

> 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.

This looks reasonable to me. Could you send the diff upstream so
we can reference the Git commit ID in the patch for reference and
remove it on our side once a new version is released?