Commit da3f83ed authored by Axel Beckert's avatar Axel Beckert

Update upstream source from tag 'upstream/2.8.9dev19'

Update to upstream version '2.8.9dev19'
with Debian dir c98fb6eaffc465495c9e078a8ebba1a52efe9603
parents c3f49cc7 2028bb88
-- $LynxId: CHANGES,v 1.974 2018/05/06 20:06:36 tom Exp $
-- $LynxId: CHANGES,v 1.983 2018/05/17 23:29:45 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
2018-05-17 (2.8.9dev.19)
* update test-packages to use current ncurses test-packages -TD
* improve portability for sockaddr structures used in HTTP and FTP, for
IPv6 and SOCKS configurations -TD
* fix several minor warnings reported by Coverity -TD
* build-fix overlooked in 2.8.9dev.3 when INACTIVE_INPUT_STYLE_VH is defined,
for problem introduced by 2.8.8dev.17 code-cleanup -GV
* trim unnecessary intllib symbols from src/chrtrans/makefile.in -TD
* when cross-compiling, trim LDFLAGS from makefile rule linking makeuctb,
because it is a build tool, which should generally use BUILD_LDFLAGS
(patch by Thomas Petazzoni)
2018-05-06 (2.8.9dev.18)
* ignore content-encoding in HTContentToCompressType() if the content-type is
known, to improve the suggested filename (report by Russell Bell) -TD
......
lynx-dev (2.8.9dev.18) unstable; urgency=low
lynx-dev (2.8.9dev.19) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 27 Mar 2018 04:22:59 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 07 May 2018 19:37:31 -0400
lynx-dev (2.8.8dev.16) unstable; urgency=high
......
Source: lynx-dev
Section: web
Priority: extra
Priority: optional
Maintainer: Thomas E. Dickey <dickey@invisible-island.net>
Homepage: http://invisible-island.net/lynx/
Build-Depends: debhelper (>= 7), dpatch, po-debconf, libncursesw5-dev, zlib1g-dev, gettext, libgnutls-dev, sharutils, telnet, openssh-client, libbsd-dev, libidn11-dev
......
......@@ -7,3 +7,12 @@ lynx-dev: extra-license-file usr/share/doc/lynx-dev/COPYING
# These are intentional, part of the sample files:
lynx-dev: zero-byte-file-in-doc-directory usr/share/doc/lynx-dev/test/X
lynx-dev: zero-byte-file-in-doc-directory usr/share/doc/lynx-dev/test/nobody
# These are a known problem with lintian:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891301
lynx-dev: privacy-breach-generic usr/share/doc/lynx-dev/test/ALT88592.html [<link rev="owner" href="http://mail.gnu.org/mailman/listinfo/lynx-dev/">] (http://mail.gnu.org/mailman/listinfo/lynx-dev/)
lynx-dev: privacy-breach-generic usr/share/doc/lynx-dev/test/bad-html.html [<link rev="owner" href="http://mail.gnu.org/mailman/listinfo/lynx-dev/">] (http://mail.gnu.org/mailman/listinfo/lynx-dev/)
lynx-dev: privacy-breach-generic usr/share/doc/lynx-dev/test/cp-1252.html [<link rev="owner" href="http://mail.gnu.org/mailman/listinfo/lynx-dev/">] (http://mail.gnu.org/mailman/listinfo/lynx-dev/)
lynx-dev: privacy-breach-generic usr/share/doc/lynx-dev/test/cp-1252a.html [<link rev="owner" href="http://mail.gnu.org/mailman/listinfo/lynx-dev/">] (http://mail.gnu.org/mailman/listinfo/lynx-dev/)
lynx-dev: privacy-breach-generic usr/share/doc/lynx-dev/test/iso-8859-2.html [<link rev="owner" href="http://mail.gnu.org/mailman/listinfo/lynx-dev/">] (http://mail.gnu.org/mailman/listinfo/lynx-dev/)
lynx-dev: privacy-breach-generic usr/share/doc/lynx-dev/test/iso-8859-2a.html [<link rev="owner" href="http://mail.gnu.org/mailman/listinfo/lynx-dev/">] (http://mail.gnu.org/mailman/listinfo/lynx-dev/)
......@@ -95,7 +95,7 @@ configure-stamp:
--enable-source-cache \
--enable-syslog \
--with-gnutls=/usr \
--with-screen=ncursesw6 \
--with-screen=ncursesw6dev \
--with-textdomain=$(PACKAGE) \
--with-zlib \
--without-included-gettext \
......
; $LynxId: lynx.nsi,v 1.40 2018/03/27 08:22:59 tom Exp $
; $LynxId: lynx.nsi,v 1.41 2018/05/07 23:37:31 tom Exp $
; Script originally generated with the Venis Install Wizard, but customized.
; The Inno Setup script is preferred; but this can be built via cross-compiling.
......@@ -9,8 +9,8 @@
!define VERSION_EPOCH "2"
!define VERSION_MAJOR "8"
!define VERSION_MINOR "9"
!define VERSION_LEVEL "1018"
!define VERSION_PATCH "dev.18"
!define VERSION_LEVEL "1019"
!define VERSION_PATCH "dev.19"
!define SUBKEY "Lynx"
......
# $LynxId: lynx.spec,v 1.48 2018/03/27 08:22:59 tom Exp $
# $LynxId: lynx.spec,v 1.50 2018/05/17 22:00:16 tom Exp $
Summary: A text-based Web browser
Name: lynx-dev
Version: 2.8.9
Release: dev.18
Release: dev.19
License: GPLv2
Group: Applications/Internet
Source: lynx%{version}%{release}.tgz
URL: http://lynx.invisible-island.net
Provides: webclient
Provides: text-www-browser
URL: https://lynx.invisible-island.net
Provides: webclient >= 0.0
Provides: text-www-browser >= 0.0
# Fedora:
BuildRequires: openssl-devel, pkgconfig, ncurses-devel >= 5.3-5,
......@@ -17,7 +17,7 @@ BuildRequires: libidn-devel
# BuildRequires: bzip2-devel
# SuSE:
# BuildRequires: libbz2-devel
# BuildRequires: libbz2-devel
Requires: gzip, bzip2, tar, zip, unzip
......@@ -89,7 +89,7 @@ HTTP, FTP, WAIS, and NNTP servers.
--enable-syslog \
--enable-warnings \
--with-bzlib \
--with-screen=ncursesw6 \
--with-screen=ncursesw6dev \
--with-ssl \
--with-zlib
make \
......@@ -122,6 +122,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Thu May 17 2018 Thomas E. Dickey
- use "ncursesw6dev", reflecting renaming of ncurses test-packages to avoid
conflict with new packages in Fedora.
* Mon Mar 12 2018 Thomas E. Dickey
- rename to "lynx-dev", add a few dependencies where package names are same.
......
; version used for Inno Setup files.
; $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$
#define LYNX_VERSION "2.8.9dev.18"
#define LYNX_VERSION "2.8.9dev.19"
; most-recent full release and target
#define LYNX_RELEASE "2.8.9"
......
/*
* $LynxId: HTAABrow.c,v 1.42 2016/11/24 23:57:57 tom Exp $
* $LynxId: HTAABrow.c,v 1.43 2018/05/11 22:54:19 tom Exp $
*
* MODULE HTAABrow.c
* BROWSER SIDE ACCESS AUTHORIZATION MODULE
......@@ -535,11 +535,17 @@ static HTAARealm *HTAARealm_new(HTList *realm_table,
BOOL HTAA_HaveUserinfo(const char *hostname)
{
int gen_delims = 0;
BOOL result = FALSE;
char *my_info = NULL;
char *at_sign = HTSkipToAt(StrAllocCopy(my_info, hostname), &gen_delims);
free(my_info);
return (at_sign != NULL && gen_delims == 0) ? TRUE : FALSE;
if (StrAllocCopy(my_info, hostname) != NULL) {
char *at_sign = HTSkipToAt(my_info, &gen_delims);
free(my_info);
if (at_sign != NULL && gen_delims == 0)
result = TRUE;
}
return result;
}
/*
......
/*
* $LynxId: HTAccess.c,v 1.81 2018/03/29 21:41:37 tom Exp $
* $LynxId: HTAccess.c,v 1.84 2018/05/11 21:36:35 tom Exp $
*
* Access Manager HTAccess.c
* ==============
......@@ -754,7 +754,9 @@ static BOOL HTLoadDocument(const char *full_address, /* may include #fragment */
char *cp;
BOOL ForcingNoCache = LYforce_no_cache;
CTRACE((tfp, "HTAccess: loading document %s\n", address_to_load));
CTRACE((tfp, "HTAccess: loading document %s\n", NonNull(address_to_load)));
if (isEmpty(address_to_load))
return NO;
/*
* Free use_this_url_instead and reset permanent_redirection if not done
......@@ -1290,6 +1292,10 @@ BOOL HTSearch(const char *keywords,
if (escaped == NULL)
outofmem(__FILE__, "HTSearch");
if (here->isIndexAction == NULL) {
free(escaped);
return FALSE;
}
StrAllocCopy(address, here->isIndexAction);
/*
......
/*
* $LynxId: HTFTP.c,v 1.132 2018/03/28 08:51:10 Gisle.Vanem Exp $
* $LynxId: HTFTP.c,v 1.137 2018/05/16 19:36:44 tom Exp $
*
* File Transfer Protocol (FTP) Client
* for a WorldWideWeb browser
......@@ -1156,15 +1156,11 @@ static int close_master_socket(void)
*/
static int get_listen_socket(void)
{
LY_SOCKADDR soc_A;
#ifdef INET6
struct sockaddr_storage soc_address; /* Binary network address */
struct sockaddr_in *soc_in = (struct sockaddr_in *) &soc_address;
int af;
unsigned short af;
LY_SOCKLEN slen;
#else
struct sockaddr_in soc_address; /* Binary network address */
struct sockaddr_in *soc_in = &soc_address;
#endif /* INET6 */
int new_socket; /* Will be master_socket */
......@@ -1178,13 +1174,12 @@ static int get_listen_socket(void)
#ifdef INET6
/* query address family of control connection */
slen = (LY_SOCKLEN) sizeof(soc_address);
if (getsockname(control->socket, (struct sockaddr *) &soc_address,
&slen) < 0) {
slen = (LY_SOCKLEN) sizeof(soc_A);
if (getsockname(control->socket, SOCKADDR_OF(soc_A), &slen) < 0) {
return HTInetStatus("getsockname failed");
}
af = ((struct sockaddr *) &soc_address)->sa_family;
memset(&soc_address, 0, sizeof(soc_address));
af = SOCKADDR_OF(soc_A)->sa_family;
memset(&soc_A, 0, sizeof(soc_A));
#endif /* INET6 */
/* Create internet socket
......@@ -1203,25 +1198,25 @@ static int get_listen_socket(void)
/* Search for a free port.
*/
#ifdef INET6
memset(&soc_address, 0, sizeof(soc_address));
((struct sockaddr *) &soc_address)->sa_family = af;
memset(&soc_A, 0, sizeof(soc_A));
SOCKADDR_OF(soc_A)->sa_family = (unsigned short) af;
switch (af) {
case AF_INET:
#ifdef SIN6_LEN
((struct sockaddr *) &soc_address)->sa_len = sizeof(struct sockaddr_in);
SOCKADDR_OF(soc_A)->sa_len = sizeof(struct sockaddr_in);
#endif /* SIN6_LEN */
break;
case AF_INET6:
#ifdef SIN6_LEN
((struct sockaddr *) &soc_address)->sa_len = sizeof(struct sockaddr_in6);
SOCKADDR_OF(soc_A)->sa_len = sizeof(struct sockaddr_in6);
#endif /* SIN6_LEN */
break;
default:
HTInetStatus("AF");
}
#else
soc_in->sin_family = AF_INET; /* Family = internet, host order */
soc_in->sin_addr.s_addr = INADDR_ANY; /* Any peer address */
soc_A.soc_in.sin_family = AF_INET; /* Family = internet, host order */
soc_A.soc_in.sin_addr.s_addr = INADDR_ANY; /* Any peer address */
#endif /* INET6 */
#ifdef POLL_PORTS
{
......@@ -1236,23 +1231,21 @@ static int get_listen_socket(void)
return HTInetStatus("bind");
}
#ifdef INET6
soc_in->sin_port = htons(port_number);
soc_A.soc_in.sin_port = htons(port_number);
#else
soc_address.sin_port = htons(port_number);
soc_A.sin_port = htons(port_number);
#endif /* INET6 */
#ifdef SOCKS
if (socks_flag)
if ((status = Rbind(new_socket,
(struct sockaddr *) &soc_address,
/* Cast to generic sockaddr */
SOCKADDR_LEN(soc_address))) == 0) {
SOCKADDR_OF(soc_A),
SOCKADDR_LEN(soc_A))) == 0) {
break;
} else
#endif /* SOCKS */
if ((status = bind(new_socket,
(struct sockaddr *) &soc_address,
/* Cast to generic sockaddr */
SOCKADDR_LEN(soc_address)
SOCKADDR_OF(soc_A),
SOCKADDR_LEN(soc_A)
)) == 0) {
break;
}
......@@ -1263,61 +1256,51 @@ static int get_listen_socket(void)
#else
{
int status;
LY_SOCKLEN address_length = (LY_SOCKLEN) sizeof(soc_address);
LY_SOCKLEN address_length = (LY_SOCKLEN) sizeof(soc_A);
#ifdef SOCKS
if (socks_flag)
status = Rgetsockname(control->socket,
(struct sockaddr *) &soc_address,
SOCKADDR_OF(soc_A),
&address_length);
else
#endif /* SOCKS */
status = getsockname(control->socket,
(struct sockaddr *) &soc_address,
SOCKADDR_OF(soc_A),
&address_length);
if (status < 0) {
close(new_socket);
return HTInetStatus("getsockname");
}
#ifdef INET6
CTRACE((tfp, "HTFTP: This host is %s\n",
HTInetString((void *) soc_in)));
HTInetString((void *) &soc_A.soc_in)));
soc_in->sin_port = 0; /* Unspecified: please allocate */
#else
CTRACE((tfp, "HTFTP: This host is %s\n",
HTInetString(soc_in)));
soc_address.sin_port = 0; /* Unspecified: please allocate */
#endif /* INET6 */
soc_A.soc_in.sin_port = 0; /* Unspecified: please allocate */
#ifdef SOCKS
if (socks_flag)
status = Rbind(new_socket,
(struct sockaddr *) &soc_address,
/* Cast to generic sockaddr */
sizeof(soc_address));
SOCKADDR_OF(soc_A),
sizeof(soc_A));
else
#endif /* SOCKS */
status = bind(new_socket,
(struct sockaddr *) &soc_address,
/* Cast to generic sockaddr */
SOCKADDR_LEN(soc_address)
);
SOCKADDR_OF(soc_A),
SOCKADDR_LEN(soc_A));
if (status < 0) {
close(new_socket);
return HTInetStatus("bind");
}
address_length = sizeof(soc_address);
address_length = sizeof(soc_A);
#ifdef SOCKS
if (socks_flag)
status = Rgetsockname(new_socket,
(struct sockaddr *) &soc_address,
SOCKADDR_OF(soc_A),
&address_length);
else
#endif /* SOCKS */
status = getsockname(new_socket,
(struct sockaddr *) &soc_address,
SOCKADDR_OF(soc_A),
&address_length);
if (status < 0) {
close(new_socket);
......@@ -1326,15 +1309,9 @@ static int get_listen_socket(void)
}
#endif /* POLL_PORTS */
#ifdef INET6
CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
(int) ntohs(soc_in->sin_port),
HTInetString((void *) soc_in)));
#else
CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
(int) ntohs(soc_in->sin_port),
HTInetString(soc_in)));
#endif /* INET6 */
(int) ntohs(soc_A.soc_in.sin_port),
HTInetString((void *) &soc_A.soc_in)));
#ifdef REPEAT_LISTEN
if (have_socket)
......@@ -1347,16 +1324,16 @@ static int get_listen_socket(void)
*/
(void) HTHostName(); /* Make address valid - doesn't work */
#ifdef INET6
switch (((struct sockaddr *) &soc_address)->sa_family) {
switch (SOCKADDR_OF(soc_A)->sa_family) {
case AF_INET:
#endif /* INET6 */
sprintf(port_command, "PORT %d,%d,%d,%d,%d,%d%c%c",
(int) *((unsigned char *) (&soc_in->sin_addr) + 0),
(int) *((unsigned char *) (&soc_in->sin_addr) + 1),
(int) *((unsigned char *) (&soc_in->sin_addr) + 2),
(int) *((unsigned char *) (&soc_in->sin_addr) + 3),
(int) *((unsigned char *) (&soc_in->sin_port) + 0),
(int) *((unsigned char *) (&soc_in->sin_port) + 1),
(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 0),
(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 1),
(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 2),
(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 3),
(int) *((unsigned char *) (&soc_A.soc_in.sin_port) + 0),
(int) *((unsigned char *) (&soc_A.soc_in.sin_port) + 1),
CR, LF);
#ifdef INET6
......@@ -1367,8 +1344,8 @@ static int get_listen_socket(void)
char hostbuf[MAXHOSTNAMELEN];
char portbuf[MAXHOSTNAMELEN];
getnameinfo((struct sockaddr *) &soc_address,
SOCKADDR_LEN(soc_address),
getnameinfo(SOCKADDR_OF(soc_A),
SOCKADDR_LEN(soc_A),
hostbuf,
(socklen_t) sizeof(hostbuf),
portbuf,
......@@ -1448,7 +1425,7 @@ static void set_years_and_date(void)
sprintf(date, "9999%02d%.2s", i, day);
TheDate = atoi(date);
LYStrNCpy(ThisYear, printable + 20, 4);
sprintf(LastYear, "%d", (atoi(ThisYear) - 1));
sprintf(LastYear, "%d", (atoi(ThisYear) - 1) % 10000);
HaveYears = TRUE;
}
......@@ -3359,7 +3336,7 @@ static int setup_connection(const char *name,
sprintf(dst, "%d.%d.%d.%d", h0, h1, h2, h3);
} else if (strcmp(p, "EPSV") == 0) {
char c0, c1, c2, c3;
struct sockaddr_storage ss;
LY_SOCKADDR ss;
LY_SOCKLEN sslen;
/*
......@@ -3382,13 +3359,12 @@ static int setup_connection(const char *name,
passive_port = (PortNumber) p0;
sslen = (LY_SOCKLEN) sizeof(ss);
if (getpeername(control->socket, (struct sockaddr *) &ss,
&sslen) < 0) {
if (getpeername(control->socket, SOCKADDR_OF(ss), &sslen) < 0) {
fprintf(tfp, "HTFTP: getpeername(control) failed\n");
status = HT_NO_CONNECTION;
break;
}
if (getnameinfo((struct sockaddr *) &ss,
if (getnameinfo(SOCKADDR_OF(ss),
sslen,
dst,
(socklen_t) sizeof(dst),
......@@ -4015,23 +3991,18 @@ int HTFTPLoad(const char *name,
listen:
if (!ftp_local_passive) {
/* Wait for the connection */
#ifdef INET6
struct sockaddr_storage soc_address;
#else
struct sockaddr_in soc_address;
#endif /* INET6 */
LY_SOCKLEN soc_addrlen = (LY_SOCKLEN) sizeof(soc_address);
LY_SOCKADDR soc_A;
LY_SOCKLEN soc_addrlen = (LY_SOCKLEN) sizeof(soc_A);
#ifdef SOCKS
if (socks_flag)
status = Raccept((int) master_socket,
(struct sockaddr *) &soc_address,
SOCKADDR_OF(soc_A),
&soc_addrlen);
else
#endif /* SOCKS */
status = accept((int) master_socket,
(struct sockaddr *) &soc_address,
SOCKADDR_OF(soc_A),
&soc_addrlen);
if (status < 0) {
init_help_message_cache(); /* to free memory */
......
/*
* $LynxId: HTFile.c,v 1.149 2018/05/06 19:46:38 tom Exp $
* $LynxId: HTFile.c,v 1.151 2018/05/11 23:20:35 tom Exp $
*
* File Access HTFile.c
* ===========
......@@ -997,14 +997,17 @@ HTFormat HTCharsetFormat(HTFormat format,
char *cp = NULL, *cp1, *cp2, *cp3 = NULL, *cp4;
BOOL chartrans_ok = FALSE;
int chndl = -1;
const char *format_name = format->name;
FREE(anchor->charset);
StrAllocCopy(cp, format->name);
if (format_name == 0)
format_name = "";
StrAllocCopy(cp, format_name);
LYLowerCase(cp);
if (((cp1 = StrChr(cp, ';')) != NULL) &&
(cp2 = strstr(cp1, "charset")) != NULL) {
CTRACE((tfp, "HTCharsetFormat: Extended MIME Content-Type is %s\n",
format->name));
format_name));
cp2 += 7;
while (*cp2 == ' ' || *cp2 == '=')
cp2++;
......@@ -1512,14 +1515,15 @@ HTStream *HTFileSaveStream(HTParentAnchor *anchor)
/* Output one directory entry.
* ---------------------------
*/
void HTDirEntry(HTStructured * target, const char *tail,
const char *entry)
void HTDirEntry(HTStructured * target, const char *tail, const char *entry)
{
char *relative = NULL;
char *stripped = NULL;
char *escaped = NULL;
int len;
if (entry == NULL)
entry = "";
StrAllocCopy(escaped, entry);
LYTrimPathSep(escaped);
if (strcmp(escaped, "..") != 0) {
......
/*
* $LynxId: HTFormat.c,v 1.89 2018/03/11 21:33:34 tom Exp $
* $LynxId: HTFormat.c,v 1.90 2018/05/11 22:18:24 tom Exp $
*
* Manage different file formats HTFormat.c
* =============================
......@@ -865,10 +865,10 @@ int HTCopy(HTParentAnchor *anchor,
}
#endif /* NOT_ASCII */
header_length = anchor->header_length;
header_length = anchor != 0 ? anchor->header_length : 0;
(*targetClass.put_block) (sink, input_buffer, status);
if (anchor->inHEAD) {
if (anchor != 0 && anchor->inHEAD) {
if (!suppress_readprogress) {
statusline(gettext("Reading headers..."));
}
......@@ -880,7 +880,7 @@ int HTCopy(HTParentAnchor *anchor,
* HTMIME, which detects the end of the server headers. There
* may be additional (non-header) data in that block.
*/
if (anchor->header_length > header_length) {
if (anchor != 0 && (anchor->header_length > header_length)) {
int header = (int) (anchor->header_length - header_length);
CTRACE((tfp, "HTCopy read %" PRI_off_t " header bytes "
......
/*
* $LynxId: HTGopher.c,v 1.67 2018/05/04 22:42:37 tom Exp $
* $LynxId: HTGopher.c,v 1.68 2018/05/15 21:58:15 tom Exp $
*
* GOPHER ACCESS HTGopher.c
* =============
......@@ -970,7 +970,6 @@ static int parse_cso_fields(char *buf,
* Lines beginning with 5 are errors. Print them and quit.
*/
if (*p == '5') {
strcpy(buf, p);
return 5;
}
......@@ -1712,7 +1711,7 @@ static char *link_to_URL(const char *arg)
result = next + 1;
}
/* check if the selector is the special html one */
if (!strncmp(result, "hURL:", (size_t)5)) {
if (!strncmp(result, "hURL:", (size_t) 5)) {
result += 5;
next = result;
result = temp;
......
/*
* $LynxId: HTMLGen.c,v 1.44 2018/03/07 10:26:05 tom Exp $
* $LynxId: HTMLGen.c,v 1.45 2018/05/11 22:41:59 tom Exp $
*
* HTML Generator
* ==============
......@@ -322,15 +322,16 @@ static int HTMLGen_start_element(HTStructured * me, int element_number,
#if defined(USE_COLOR_STYLE)
char *title = NULL;
char *title_tmp = NULL;
const char *name;
if (LYPreparsedSource) {
if (LYPreparsedSource && (name = tag->name) != 0) {
char *myHash = NULL;
/*
* Same logic as in HTML_start_element, copied from there. - kw
*/
HTSprintf(&Style_className, ";%s", HTML_dtd.tags[element_number].name);
StrAllocCopy(myHash, HTML_dtd.tags[element_number].name);
HTSprintf(&Style_className, ";%s", name);
StrAllocCopy(myHash, name);
if (class_string[0]) {
StrAllocCat(myHash, ".");
StrAllocCat(myHash, class_string);
......@@ -365,7 +366,7 @@ static int HTMLGen_start_element(HTStructured * me, int element_number,
if (displayStyles[element_number + STARTAT].color > -2) {
CTRACE2(TRACE_STYLE,
(tfp, "CSSTRIM: start_element: top <%s>\n",
HTML_dtd.tags[element_number].name));
tag->name));
do_cstyle_flush(me);
HText_characterStyle(me->text, hcode, 1);
}
......@@ -473,7 +474,7 @@ static int HTMLGen_start_element(HTStructured * me, int element_number,
* Can break after element start.
*/
if (!me->preformatted && tag->contents != SGML_EMPTY) {
if (HTML_dtd.tags[element_number].contents == SGML_ELEMENT)
if (tag->contents == SGML_ELEMENT)
allow_break(me, 15, NO);
else
allow_break(me, 2, NO);
......@@ -489,8 +490,7 @@ static int HTMLGen_start_element(HTStructured * me, int element_number,
(tfp, "STYLE:begin_element:ending EMPTY element style\n"));
do_cstyle_flush(me);
HText_characterStyle(me->text, hcode, STACK_OFF);
TrimColorClass(HTML_dtd.tags[element_number].name,
Style_className, &hcode);
TrimColorClass(tag->name, Style_className, &hcode);
}
#endif /* USE_COLOR_STYLE */
if (element_number == HTML_OBJECT && tag->contents == SGML_LITTERAL) {
......
/*
* $LynxId: HTString.h,v 1.38 2013/11/28 11:09:55 tom Exp $
* $LynxId: HTString.h,v 1.39 2018/05/11 22:36:34 tom Exp $
* String handling for libwww
* STRINGS
*
......@@ -146,7 +146,7 @@ extern "C" {
#define BINEQ(a,b) (HTSABEql(a,b)) /* like STREQ() */
#define isBEmpty(p) ((p) == 0 || BStrLen(p) == 0)
#define isBEmpty(p) ((p) == 0 || BStrData(p) == 0 || BStrLen(p) == 0)
#define BStrAlloc(d,n) HTSABAlloc( &(d), n)
#define BStrCopy(d,s) HTSABCopy( &(d), BStrData(s), BStrLen(s))
......
/*
* $LynxId: HTTCP.c,v 1.144 2018/03/30 00:13:21 tom Exp $
* $LynxId: HTTCP.c,v 1.149 2018/05/16 19:48:49 tom Exp $
*
* Generic Communication Code HTTCP.c
* ==========================
......@@ -280,18 +280,20 @@ unsigned int HTCardinal(int *pstatus,
* returns a pointer to a static string which must be copied if
* it is to be kept.
*/
const char *HTInetString(SockA * soc_in)
const char *HTInetString(LY_SOCKADDR * soc_A)
{
#ifdef INET6
static char hostbuf[MAXHOSTNAMELEN];
struct sockaddr *soc_addr = &(soc_A->soc_address);
getnameinfo((struct sockaddr *) soc_in,
SOCKADDR_LEN(soc_in),
getnameinfo(soc_addr,
SA_LEN(soc_addr),
hostbuf, (socklen_t) sizeof(hostbuf),
NULL, 0,
NI_NUMERICHOST);
return hostbuf;
#else
struct sockaddr_in *soc_in = &(soc_A->soc_in);
static char string[20];
sprintf(string, "%d.%d.%d.%d",
......@@ -1832,8 +1834,8 @@ int HTDoConnect(const char *url,
LYNX_ADDRINFO *res = 0, *res0 = 0;
#else
struct sockaddr_in soc_address;
struct sockaddr_in *soc_in = &soc_address;
struct sockaddr_in sock_A;
struct sockaddr_in *soc_in = &sock_A;
/*
* Set up defaults.
......@@ -1950,15 +1952,14 @@ int HTDoConnect(const char *url,
#ifdef INET6
status = Rconnect(*s, res->ai_addr, res->ai_addrlen);
#else
status = Rconnect(*s, (struct sockaddr *) &soc_address,
sizeof(soc_address));
status = Rconnect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));
#endif /* INET6 */
} else
#endif /* SOCKS */
#ifdef INET6
status = connect(*s, res->ai_addr, res->ai_addrlen);
#else
status = connect(*s, (struct sockaddr *) &soc_address, sizeof(soc_address));
status = connect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));
#endif /* INET6 */
/*
......@@ -2079,8 +2080,7 @@ int HTDoConnect(const char *url,
#ifdef INET6
status = connect(*s, res->ai_addr, res->ai_addrlen);
#else
status = connect(*s, (struct sockaddr *) &soc_address,
sizeof(soc_address));
status = connect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));