Magellan Linux

Annotation of /trunk/lynx/patches/lynx-2.8.8-ncurses61.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3141 - (hide annotations) (download)
Thu Jun 21 10:04:18 2018 UTC (5 years, 10 months ago) by niro
File size: 2586 byte(s)
-added patch for ncurses-6.1
1 niro 3141 From f0b064b47bfa046da941f5029cdc1b4c851553ce Mon Sep 17 00:00:00 2001
2     From: "Thomas E. Dickey" <dickey@invisible-island.net>
3     Date: Sat, 18 Mar 2017 21:44:28 +0000
4     Subject: [PATCH] snapshot of project "lynx", label v2-8-9dev_11m
5    
6     ---
7     CHANGES | 5 +++--
8     src/LYCurses.c | 18 ++++++++++++------
9     src/LYStrings.c | 7 ++++---
10     3 files changed, 19 insertions(+), 11 deletions(-)
11    
12     diff --git a/src/LYCurses.c b/src/LYCurses.c
13     index 6b839c28..63b73ece 100644
14     --- a/src/LYCurses.c
15     +++ b/src/LYCurses.c
16     @@ -1696,7 +1696,7 @@ void lynx_enable_mouse(int state)
17     void lynx_nl2crlf(int normal GCC_UNUSED)
18     {
19     #if defined(NCURSES_VERSION_PATCH) && defined(SET_TTY) && defined(TERMIOS) && defined(ONLCR)
20     - static TTY saved_tty;
21     + static struct termios saved_tty;
22     static int did_save = FALSE;
23     static int waiting = FALSE;
24     static int can_fix = TRUE;
25     @@ -1705,8 +1705,10 @@ void lynx_nl2crlf(int normal GCC_UNUSED)
26     if (cur_term == 0) {
27     can_fix = FALSE;
28     } else {
29     - saved_tty = cur_term->Nttyb;
30     + tcgetattr(fileno(stdout), &saved_tty);
31     did_save = TRUE;
32     + if ((saved_tty.c_oflag & ONLCR))
33     + can_fix = FALSE;
34     #if NCURSES_VERSION_PATCH < 20010529
35     /* workaround for optimizer bug with nonl() */
36     if ((tigetstr("cud1") != 0 && *tigetstr("cud1") == '\n')
37     @@ -1718,14 +1720,18 @@ void lynx_nl2crlf(int normal GCC_UNUSED)
38     if (can_fix) {
39     if (normal) {
40     if (!waiting) {
41     - cur_term->Nttyb.c_oflag |= ONLCR;
42     + struct termios alter_tty = saved_tty;
43     +
44     + alter_tty.c_oflag |= ONLCR;
45     + tcsetattr(fileno(stdout), TCSAFLUSH, &alter_tty);
46     + def_prog_mode();
47     waiting = TRUE;
48     nonl();
49     }
50     } else {
51     if (waiting) {
52     - cur_term->Nttyb = saved_tty;
53     - SET_TTY(fileno(stdout), &saved_tty);
54     + tcsetattr(fileno(stdout), TCSAFLUSH, &saved_tty);
55     + def_prog_mode();
56     waiting = FALSE;
57     nl();
58     LYrefresh();
59     diff --git a/src/LYStrings.c b/src/LYStrings.c
60     index e97481c2..02b1286d 100644
61     --- a/src/LYStrings.c
62     +++ b/src/LYStrings.c
63     @@ -1004,12 +1004,13 @@ static const char *expand_tiname(const char *first, size_t len, char **result, c
64     {
65     char name[BUFSIZ];
66     int code;
67     + TERMTYPE *tp = (TERMTYPE *) (cur_term);
68    
69     LYStrNCpy(name, first, len);
70     if ((code = lookup_tiname(name, strnames)) >= 0
71     || (code = lookup_tiname(name, strfnames)) >= 0) {
72     - if (cur_term->type.Strings[code] != 0) {
73     - LYStrNCpy(*result, cur_term->type.Strings[code], (final - *result));
74     + if (tp->Strings[code] != 0) {
75     + LYStrNCpy(*result, tp->Strings[code], (final - *result));
76     (*result) += strlen(*result);
77     }
78     }