app-text/fbpdf: add SIGUSR1 patches to make it act more like mupdf
[sgilles-overlay.git] / app-text / fbpdf / files / 0001-disable-arrow-keys.patch
blobb24bf5d8bf88fdd6229c213d0336250fd3791138
1 From a971e4f90726a54adadd65e6ac36cb3abc846eee Mon Sep 17 00:00:00 2001
2 From: "S. Gilles" <sgilles@math.umd.edu>
3 Date: Fri, 30 Nov 2018 10:44:54 +0000
4 Subject: [PATCH 1/5] disable arrow keys
6 ---
7 fbpdf.c | 16 +++++++++++++++-
8 1 file changed, 15 insertions(+), 1 deletion(-)
10 diff --git a/fbpdf.c b/fbpdf.c
11 index 6caa08f..7c387e9 100644
12 --- a/fbpdf.c
13 +++ b/fbpdf.c
14 @@ -115,9 +115,23 @@ static void jmpmark(int c, int offset)
15 static int readkey(void)
17 unsigned char b;
18 +again:
19 if (read(0, &b, 1) <= 0)
20 return -1;
21 - return b;
23 + if (b != 27)
24 + return b;
26 + if (read(0, &b, 1) <= 0)
27 + return -1;
29 + if (b != 91)
30 + return b;
32 + if (read(0, &b, 1) <= 0)
33 + return -1;
35 + goto again;
38 static int getcount(int def)
39 --
40 2.19.2