1 Submitted By: Pierre Labastie <pierre dot labastie at neuf dot fr>
2 Date: 2018-01-30
3 Initial Package Version: 2.8.8rel.2
4 Upstream Status: Fixed in master (at lynx-2.8.9dev.12)
5 Origin: Upstream
6 Description: Fix for building with ncurses-6.1
7 diff -ur lynx2.8.9dev.11/src/LYCurses.c lynx2.8.9dev.12/src/LYCurses.c
8 --- lynx2.8.9dev.11/src/LYCurses.c 2016-11-04 22:54:57.000000000 +0100
9 +++ lynx2.8.9dev.12/src/LYCurses.c 2017-03-18 22:42:48.000000000 +0100
10 @@ -1696,7 +1696,7 @@
11 void lynx_nl2crlf(int normal GCC_UNUSED)
12 {
13 #if defined(NCURSES_VERSION_PATCH) && defined(SET_TTY) && defined(TERMIOS) && defined(ONLCR)
14 - static TTY saved_tty;
15 + static struct termios saved_tty;
16 static int did_save = FALSE;
17 static int waiting = FALSE;
18 static int can_fix = TRUE;
19 @@ -1705,8 +1705,10 @@
20 if (cur_term == 0) {
21 can_fix = FALSE;
22 } else {
23 - saved_tty = cur_term->Nttyb;
24 + tcgetattr(fileno(stdout), &saved_tty);
25 did_save = TRUE;
26 + if ((saved_tty.c_oflag & ONLCR))
27 + can_fix = FALSE;
28 #if NCURSES_VERSION_PATCH < 20010529
29 /* workaround for optimizer bug with nonl() */
30 if ((tigetstr("cud1") != 0 && *tigetstr("cud1") == '\n')
31 @@ -1718,14 +1720,18 @@
32 if (can_fix) {
33 if (normal) {
34 if (!waiting) {
35 - cur_term->Nttyb.c_oflag |= ONLCR;
36 + struct termios alter_tty = saved_tty;
37 +
38 + alter_tty.c_oflag |= ONLCR;
39 + tcsetattr(fileno(stdout), TCSAFLUSH, &alter_tty);
40 + def_prog_mode();
41 waiting = TRUE;
42 nonl();
43 }
44 } else {
45 if (waiting) {
46 - cur_term->Nttyb = saved_tty;
47 - SET_TTY(fileno(stdout), &saved_tty);
48 + tcsetattr(fileno(stdout), TCSAFLUSH, &saved_tty);
49 + def_prog_mode();
50 waiting = FALSE;
51 nl();
52 LYrefresh();
53 @@ -2203,6 +2209,8 @@
54 int y, x;
55 size_t inx;
56
57 + (void) y;
58 + (void) y0;
59 #ifdef USE_CURSES_PADS
60 /*
61 * If we've configured to use pads for left/right scrolling, that can
62 diff -ur lynx2.8.9dev.11/src/LYStrings.c lynx2.8.9dev.12/src/LYStrings.c
63 --- lynx2.8.9dev.11/src/LYStrings.c 2015-12-16 02:18:53.000000000 +0100
64 +++ lynx2.8.9dev.12/src/LYStrings.c 2017-04-29 02:32:21.000000000 +0200
65 @@ -1004,12 +1004,13 @@
66 {
67 char name[BUFSIZ];
68 int code;
69 + TERMTYPE *tp = (TERMTYPE *) (cur_term);
70
71 LYStrNCpy(name, first, len);
72 if ((code = lookup_tiname(name, strnames)) >= 0
73 || (code = lookup_tiname(name, strfnames)) >= 0) {
74 - if (cur_term->type.Strings[code] != 0) {
75 - LYStrNCpy(*result, cur_term->type.Strings[code], (final - *result));
76 + if (tp->Strings[code] != 0) {
77 + LYStrNCpy(*result, tp->Strings[code], (final - *result));
78 (*result) += strlen(*result);
79 }
80 }
|