60 lines
1.9 KiB
Diff
60 lines
1.9 KiB
Diff
|
Patch devised by comparing current source code against the
|
||
|
latest snapshot at https://github.com/ThomasDickey/lynx-snapshots/
|
||
|
@pullmoll
|
||
|
|
||
|
--- src/LYStrings.c 2013-11-29 01:52:56.000000000 +0100
|
||
|
+++ src/LYStrings.c 2018-02-20 02:05:57.955776204 +0100
|
||
|
@@ -1004,12 +1004,13 @@
|
||
|
{
|
||
|
char name[BUFSIZ];
|
||
|
int code;
|
||
|
+ TERMTYPE *tp = (TERMTYPE *) (cur_term);
|
||
|
|
||
|
LYStrNCpy(name, first, len);
|
||
|
if ((code = lookup_tiname(name, strnames)) >= 0
|
||
|
|| (code = lookup_tiname(name, strfnames)) >= 0) {
|
||
|
- if (cur_term->type.Strings[code] != 0) {
|
||
|
- LYStrNCpy(*result, cur_term->type.Strings[code], (final - *result));
|
||
|
+ if (tp->Strings[code] != 0) {
|
||
|
+ LYStrNCpy(*result, tp->Strings[code], (final - *result));
|
||
|
(*result) += strlen(*result);
|
||
|
}
|
||
|
}
|
||
|
--- src/LYCurses.c 2014-03-09 22:43:10.000000000 +0100
|
||
|
+++ src/LYCurses.c 2018-02-20 02:15:16.849798027 +0100
|
||
|
@@ -1704,8 +1704,10 @@
|
||
|
if (cur_term == 0) {
|
||
|
can_fix = FALSE;
|
||
|
} else {
|
||
|
- saved_tty = cur_term->Nttyb;
|
||
|
+ tcgetattr(fileno(stdout), &saved_tty);
|
||
|
did_save = TRUE;
|
||
|
+ if ((saved_tty.c_oflag & ONLCR))
|
||
|
+ can_fix = FALSE;
|
||
|
#if NCURSES_VERSION_PATCH < 20010529
|
||
|
/* workaround for optimizer bug with nonl() */
|
||
|
if ((tigetstr("cud1") != 0 && *tigetstr("cud1") == '\n')
|
||
|
--- src/LYCurses.c 2018-02-20 02:16:04.602799891 +0100
|
||
|
+++ src/LYCurses.c 2018-02-20 02:18:32.008805647 +0100
|
||
|
@@ -1719,14 +1719,17 @@
|
||
|
if (can_fix) {
|
||
|
if (normal) {
|
||
|
if (!waiting) {
|
||
|
- cur_term->Nttyb.c_oflag |= ONLCR;
|
||
|
+ struct termios alter_tty = saved_tty;
|
||
|
+ alter_tty.c_oflag |= ONLCR;
|
||
|
+ tcsetattr(fileno(stdout), TCSAFLUSH, &alter_tty);
|
||
|
+ def_prog_mode();
|
||
|
waiting = TRUE;
|
||
|
nonl();
|
||
|
}
|
||
|
} else {
|
||
|
if (waiting) {
|
||
|
- cur_term->Nttyb = saved_tty;
|
||
|
- SET_TTY(fileno(stdout), &saved_tty);
|
||
|
+ tcsetattr(fileno(stdout), TCSAFLUSH, &saved_tty);
|
||
|
+ def_prog_mode();
|
||
|
waiting = FALSE;
|
||
|
nl();
|
||
|
LYrefresh();
|