diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2017-03-18 21:44:28 +0000 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2017-03-18 21:44:28 +0000 |
commit | 70ff3f84d223064f6d29abc7075d7a7f5a2fd1c9 (patch) | |
tree | 5fe9e6ad987dec218224c8e99e75d76d5aa655b9 | |
parent | b137257aa2e7a24e12be556035f119208cdb723c (diff) | |
download | lynx-snapshots-70ff3f84d223064f6d29abc7075d7a7f5a2fd1c9.tar.gz |
snapshot of project "lynx", label v2-8-9dev_11m
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | src/LYCurses.c | 18 | ||||
-rw-r--r-- | src/LYStrings.c | 7 |
3 files changed, 19 insertions, 11 deletions
diff --git a/CHANGES b/CHANGES index d5efd153..bafbf270 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,10 @@ --- $LynxId: CHANGES,v 1.878 2017/02/10 22:41:32 tom Exp $ +-- $LynxId: CHANGES,v 1.879 2017/03/18 21:44:28 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2017-02-10 (2.8.9dev.12) +2017-03-18 (2.8.9dev.12) +* modify ncurses-specific to allow its TERMINAL struct to be opaque -TD * refine special case of server Content-Type from 2.8.7dev.11 changes to decompress files offered for download when the server has gzip'd them (report by TH) -TD diff --git a/src/LYCurses.c b/src/LYCurses.c index 6b839c28..63b73ece 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1,4 +1,4 @@ -/* $LynxId: LYCurses.c,v 1.182 2017/02/07 09:34:11 tom Exp $ */ +/* $LynxId: LYCurses.c,v 1.183 2017/03/18 21:42:48 tom Exp $ */ #include <HTUtils.h> #include <HTAlert.h> @@ -1696,7 +1696,7 @@ void lynx_enable_mouse(int state) void lynx_nl2crlf(int normal GCC_UNUSED) { #if defined(NCURSES_VERSION_PATCH) && defined(SET_TTY) && defined(TERMIOS) && defined(ONLCR) - static TTY saved_tty; + static struct termios saved_tty; static int did_save = FALSE; static int waiting = FALSE; static int can_fix = TRUE; @@ -1705,8 +1705,10 @@ void lynx_nl2crlf(int normal GCC_UNUSED) 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') @@ -1718,14 +1720,18 @@ void lynx_nl2crlf(int normal GCC_UNUSED) 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(); diff --git a/src/LYStrings.c b/src/LYStrings.c index e97481c2..02b1286d 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -1,4 +1,4 @@ -/* $LynxId: LYStrings.c,v 1.264 2016/11/24 15:35:29 tom Exp $ */ +/* $LynxId: LYStrings.c,v 1.265 2017/03/18 21:42:48 tom Exp $ */ #include <HTUtils.h> #include <HTCJK.h> #include <UCAux.h> @@ -1004,12 +1004,13 @@ static const char *expand_tiname(const char *first, size_t len, char **result, c { 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); } } |