[PATCH] fix a small bug in abook

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

[PATCH] fix a small bug in abook

Mohamed Aslan
Hello,

Similar to a previous (and applied) patch [1] for calcurse, the
patch below fixes a small bug in abook by also checking if getch(3)
returned KEY_ENTER (when the enter key is pressed), or it may fail
in some terminals such as pccon0.

Regards,
Aslan

[1] https://marc.info/?l=openbsd-ports&m=153924245717587&w=2

Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/abook/Makefile,v
retrieving revision 1.35
diff -u -p -u -p -r1.35 Makefile
--- Makefile 7 Sep 2017 16:03:34 -0000 1.35
+++ Makefile 8 Feb 2019 08:38:53 -0000
@@ -3,7 +3,7 @@
 COMMENT= addressbook program with mutt support
 
 DISTNAME= abook-0.6.1
-REVISION= 0
+REVISION= 1
 CATEGORIES= mail
 
 HOMEPAGE= http://abook.sourceforge.net/
Index: patches/patch-ui_c
===================================================================
RCS file: patches/patch-ui_c
diff -N patches/patch-ui_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ui_c 8 Feb 2019 08:38:53 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Also check if getch(3) returns KEY_ENTER in get_commands(), or it may fail
+when the enter key is pressed in some terminals (e.g., TERM=pccon0).
+
+Index: ui.c
+--- ui.c.orig
++++ ui.c
+@@ -573,6 +573,7 @@ get_commands()
+  refresh_screen();
+  break;
+ case 'a': add_item(); break;
++ case KEY_ENTER:
+ case '\r': edit_item(-1); break;
+ case KEY_DC:
+ case 'd':
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fix a small bug in abook

Stuart Henderson-6
On 2019/02/08 03:56, Mohamed Aslan wrote:
> Hello,
>
> Similar to a previous (and applied) patch [1] for calcurse, the
> patch below fixes a small bug in abook by also checking if getch(3)
> returned KEY_ENTER (when the enter key is pressed), or it may fail
> in some terminals such as pccon0.
>
> Regards,
> Aslan

Thanks, diff committed.