Commit 6678192b authored by Axel Beckert's avatar Axel Beckert

Imported Upstream version 2.8.8dev.10

parent fb388d90
-- $LynxId: CHANGES,v 1.556 2011/06/12 16:04:15 tom Exp $
-- $LynxId: CHANGES,v 1.588 2012/02/13 00:16:30 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
2012-02-12 (2.8.8dev.10)
* updated po/lynx.pot; there are a few new messages -TD
* add "submit" and "reset" commands (Debian #603645) -TD
* add "pwd" command, to show current working directory in the statusline -TD
* modify check in HText_endForm() when a form contains only a single input
field, to allow a return in any text-like field other than textarea to cause
the form to be submitted (Debian #603648) -TD
* add bzlib to win32 makefile.msc -TD
* define WIN32_LEAN_AND_MEAN in makefile.msc to accommodate naming conflict
in recent Win32 SDKs, which otherwise include winsock.h in windows.h -TD
* fixes for the dev.9 Win32 feature to toggle between normal/fullscreen,
by checking the actual screensize after maximizing the display -TD
* use ASCII apostrophe for 7-bit approximation to U+02bd as well -TD
* use ASCII apostrophe 0x27 for 7-bit approximation to Unicode apostrophe
U+02bc (suggested by Ralph Babel)
* update LYLeaks.c / LYLeaks.h to include the bstring allocation, copy and free
functions -TD
* several fixes for the -find-leaks option, e.g., include LYLeaks.h in a few
modules, modify the StrAllocVsprintf function to update the bookkeeping,
etc -TD
* move call to LYCanWriteFile into LYValidateOutput, to make prompts for
download, print and upload more alike -TD
* correct an old bug in send_file_to_file(), used when printing a page to a
file, which prevented its check for appending to an existing file -TD
* modify LYValidateFilename to use LYTildeExpand -TD
* modify LYConvertToURL to use LYTildeExpand for Unix, and further modify
LYTildeExpand to lookup given user's home directory, thereby making commands
such as "g ~root/tmp" work as expected -TD
* replaced most LYgetStr calls with LYgetBString, except for LYMail.c and
LYNews.c since those do use LYgetStr's limits as it was designed. Other
calls generally did not need those limits -TD
* modify finish_ExtEditForm to eliminate wrapping when an edited line is longer
than MAX_LINE. The user is still offered the choice of wrapping to the
displayed size of a TEXTAREA, but if declined, the TEXTAREA's content will
not be wrapped -TD
* modify LYgetstr, making it call revised function LYgetBString which handles
bstring's, and allows editing fields which can grow without fixed buffer
limits. In particular, forms all use the same calls, which means that
their result is no longer limited by MAX_LINE -TD
* extend ^X-e editing of textarea's to include single-line fields -TD
* modify comparison for splitting lines to allow for long preformatted lines,
e.g., using  's to not wrap when the line-wrap mode is disabled -TD
* modify cfg2html.pl to handle options which contain a digit, e.g.,
HTML5_CHARSETS whose default value was not marked properly -TD
* modify HTLoadDocument() to not retain a cached document if user is explicitly
doing a refresh. This fixes the case for a #fragment url, which was
otherwise treated as the same as the address without the #fragment -TD
* clarify version of GPL used in README (request by Paul Menzel) -TD
* modify HTLoad() to discard charset information before reloading a document,
in case the server changes the content-type information between loads
(report by Stanislav Brabec) -TD
* use tidy to indent html documentation -TD
* provide a way to substitute parameters in URLs for jumpfiles (adapted from
patch by Mark Skilbeck -TD
* ensure that button/input tags have a value for display, in case the tag is
improperly terminated (report by Aki Helin) -TD
* work around glibc bug in sscanf in SGML_character() using strtol() (report by
Aki Helin) -TD
* add check for charset attribute on meta element -Kihara Hideto
* eliminate ON/OFF macros, using TRUE/FALSE both to work around breakage from
zlib 1.2.5.1 changes as well as because they were unnecessary (GenToo
#383113) -Nikos Chantziaras, TD
* updated several configure script macros (TD):
CF_ANSI_CC_CHECK, CF_CURSES_LIBS, CF_LD_RPATH_OPT, CF_NETLIBS,
CF_XOPEN_SOURCE, CF_X_ATHENA_LIBS
2011-06-12 (2.8.8dev.9)
* modfy cfg2html to add ".url" directive for referencing RFC's etc -TD
* document blat/blatj usage in lynx.cfg -TD
......
......@@ -1167,9 +1167,8 @@ V. Compile instructions -- 386 DOS
Compile or place your compiled PDCurses library in /djgpp/pdcur26, and
compile or place your compiled WATT-32 library in /djgpp/watt32. If
using the SLANG library, put libslang.a in your DJGPP/lib directory and put
slang.h and slcurses.h in your DJGPP/include directory, or in the
appropriate directories specified by LIBRARY_PATH and INCLUDE_PATH in your
DJGPP.ENV file.
slang.h in your DJGPP/include directory, or in the appropriate directories
specified by LIBRARY_PATH and INCLUDE_PATH in your DJGPP.ENV file.
Move to the "lynx2-*/WWW/Library/djgpp" directory. If compiling with
PDCurses, do "make". If using SLANG, do "make -f makefile.sla". This
......@@ -1388,4 +1387,4 @@ VIII. Acknowledgment
-- 1999/04/24 - H. Nelson <lynx-admin@irm.nara.kindai.ac.jp>
-- vile:txtmode
-- $LynxId: INSTALLATION,v 1.116 2011/05/28 13:07:55 tom Exp $
-- $LynxId: INSTALLATION,v 1.117 2012/02/03 22:29:17 tom Exp $
/*
* $LynxId: LYMessages_en.h,v 1.71 2010/12/08 01:28:43 Doug.Kaufman Exp $
* $LynxId: LYMessages_en.h,v 1.73 2012/02/12 23:59:14 tom Exp $
*
* Lynx - Hypertext navigation system
*
......@@ -141,6 +141,8 @@
#define RESETTING_FORM gettext("Resetting form...")
#define RELOADING_FORM \
gettext("Reloading document. Any form entries will be lost!")
#define LINK_NOT_IN_FORM \
gettext("The current link is not in a FORM")
#define CANNOT_TRANSCODE_FORM gettext("Warning: Cannot transcode form data to charset %s!")
#define NORMAL_LINK_MESSAGE \
......@@ -364,6 +366,7 @@
#define CURRENT_DOC_HAS_POST_DATA gettext("Current document has POST data.")
#define EDIT_CURDOC_URL gettext("Edit this document's URL: ")
#define EDIT_CURLINK_URL gettext("Edit the current link's URL: ")
#define EDIT_SUBMIT_URL gettext("Edit the form's submit-URL: ")
#define EDIT_FM_MENU_URLS_DISALLOWED gettext("You cannot edit File Management URLs")
#define ENTER_DATABASE_QUERY gettext("Enter a database query: ")
#define ENTER_WHEREIS_QUERY gettext("Enter a whereis query: ")
......
lynx-dev (2.8.8dev.10) unstable; urgency=low
* changes for dev.10
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 06 Oct 2011 18:19:01 -0400
lynx-dev (2.8.8dev.9) unstable; urgency=low
* changes for dev.9
......
; $LynxId: lynx.iss,v 1.4 2009/11/22 23:59:04 tom Exp $
; $LynxId: lynx.iss,v 1.5 2012/02/11 13:21:25 tom Exp $
; vile:ts=2 sw=2 notabinsert
;
; This is the BASE script for different flavors of the installer for Lynx.
......@@ -32,6 +32,22 @@
#endif
#endif
#ifndef BzipDllName
#define BzipDllName "bzip2.dll"
#endif
#ifndef ZlibDllName
#define ZlibDllName "zlib.dll"
#endif
#ifndef BzipExeName
#define BzipExeName "bzip2.exe"
#endif
#ifndef GzipExeName
#define GzipExeName "gzip.exe"
#endif
#ifndef SetupBaseName
#define SetupBaseName "lynx"
#endif
......@@ -110,6 +126,10 @@ Name: "{app}\tmp"
#ifndef NoScreenDll
#emit 'Source: "' + DllsSrcDir + '\' + ScreenDllName + '"; DestDir: "{app}"; DestName: ' + ScreenDllName + '; Flags: ignoreversion'
#endif
#emit 'Source: "' + DllsSrcDir + '\' + ZlibDllName + '"; DestDir: "{app}"; DestName: ' + ZlibDllName + '; Flags: ignoreversion'
#emit 'Source: "' + DllsSrcDir + '\' + BzipDllName + '"; DestDir: "{app}"; DestName: ' + BzipDllName + '; Flags: ignoreversion'
#emit 'Source: "' + DllsSrcDir + '\' + BzipExeName + '"; DestDir: "{app}"; DestName: ' + BzipExeName + '; Flags: ignoreversion'
#emit 'Source: "' + DllsSrcDir + '\' + GzipExeName + '"; DestDir: "{app}"; DestName: ' + GzipExeName + '; Flags: ignoreversion'
#emit 'Source: "' + DocsSrcDir + '\*.*"; DestDir: "{app}\doc"; Flags: '
#emit 'Source: "' + DocsSrcDir + '\samples\*.*"; DestDir: "{app}\doc\samples"; Flags: '
#emit 'Source: "' + DocsSrcDir + '\test\*.*"; DestDir: "{app}\doc\test"; Flags: '
......
# $LynxId: lynx.spec,v 1.9 2011/04/27 23:37:38 tom Exp $
# $LynxId: lynx.spec,v 1.10 2011/10/06 22:18:32 tom Exp $
Summary: A text-based Web browser
Name: lynx
Version: 2.8.8
Release: dev.9
Release: dev.10
License: GPLv2
Group: Applications/Internet
Source: lynx%{version}%{release}.tgz
......
; version used for Inno Setup files.
; $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$
#define LYNX_VERSION "2.8.8dev.9"
#define LYNX_VERSION "2.8.8dev.10"
#define MyAppName "Lynx"
#define MyAppPublisher "Thomas E Dickey"
......
......@@ -42,11 +42,11 @@ HOW TO GET LYNX
LICENSE
Lynx is distributed under the GNU General Public License (GPL) without
restrictions on usage or redistribution. The Lynx copyright statement,
"COPYHEADER", and GNU GPL, "COPYING", are included in the top-level
directory of the distribution. Lynx is supported by the Lynx user
community, an entirely volunteer (and unofficial) organization.
Lynx is distributed under the GNU General Public License, version 2 (GPLv2)
without restrictions on usage or redistribution. The Lynx copyright
statement, "COPYHEADER", and GNU GPL, "COPYING", are included in the
top-level directory of the distribution. Lynx is supported by the Lynx
user community, an entirely volunteer (and unofficial) organization.
Certain portions of the Lynx source distribution were originally
created by CERN and have been modified during the development of
......
/*
* $LynxId: HTAccess.c,v 1.74 2011/05/24 09:35:29 tom Exp $
* $LynxId: HTAccess.c,v 1.76 2012/02/04 00:15:53 tom Exp $
*
* Access Manager HTAccess.c
* ==============
......@@ -687,6 +687,11 @@ static int HTLoad(const char *addr,
HTProtocol *p;
int status = get_physical(addr, anchor);
if (reloading) {
FREE(anchor->charset);
FREE(anchor->UCStages);
}
if (status == HT_FORBIDDEN) {
/* prevent crash if telnet or similar was forbidden by rule. - kw */
LYFixCursesOn("show alert:");
......@@ -890,15 +895,16 @@ static BOOL HTLoadDocument(const char *full_address, /* may include #fragment */
* based on an If-Modified-Since check, etc.) but the code for doing
* those other things isn't available yet.
*/
if (LYoverride_no_cache ||
if (!reloading &&
(LYoverride_no_cache ||
#ifdef DONT_TRACK_INTERNAL_LINKS
!HText_hasNoCacheSet(text) ||
!HText_AreDifferent(anchor, full_address)
!HText_hasNoCacheSet(text) ||
!HText_AreDifferent(anchor, full_address)
#else
((LYinternal_flag || !HText_hasNoCacheSet(text)) &&
!isLYNXIMGMAP(full_address))
((LYinternal_flag || !HText_hasNoCacheSet(text)) &&
!isLYNXIMGMAP(full_address))
#endif /* TRACK_INTERNAL_LINKS */
) {
)) {
CTRACE((tfp, "HTAccess: Document already in memory.\n"));
HText_select(text);
......
/*
* $LynxId: HTAnchor.c,v 1.70 2011/06/06 08:25:33 tom Exp $
* $LynxId: HTAnchor.c,v 1.71 2012/02/03 01:52:50 tom Exp $
*
* Hypertext "Anchor" Object HTAnchor.c
* ==========================
......@@ -1234,6 +1234,29 @@ void HTAnchor_setPhysical(HTParentAnchor *me,
}
}
#ifdef DEBUG
static void show_stages(HTParentAnchor *me, const char *tag, int which_stage)
{
int j;
CTRACE((tfp, "Stages %s*%s", NonNull(me->charset), tag));
for (j = 0; j < UCT_STAGEMAX; j++) {
CTRACE((tfp, " "));
if (j == which_stage)
CTRACE((tfp, "("));
CTRACE((tfp, "%d:%d:%s",
j,
me->UCStages->s[j].LYhndl,
NonNull(me->UCStages->s[j].C.MIMEname)));
if (j == which_stage)
CTRACE((tfp, ")"));
}
CTRACE((tfp, "\n"));
}
#else
#define show_stages(me,tag,which_stage) /* nothing */
#endif
/*
* We store charset info in the HTParentAnchor object, for several
* "stages". (See UCDefs.h)
......@@ -1261,42 +1284,45 @@ void HTAnchor_setPhysical(HTParentAnchor *me,
LYUCcharset *HTAnchor_getUCInfoStage(HTParentAnchor *me,
int which_stage)
{
if (me && !me->UCStages) {
int i;
int chndl = UCLYhndl_for_unspec; /* always >= 0 */
UCAnchorInfo *stages = typecalloc(UCAnchorInfo);
LYUCcharset *result = NULL;
if (stages == NULL)
outofmem(__FILE__, "HTAnchor_getUCInfoStage");
if (me) {
if (!me->UCStages) {
int i;
int chndl = UCLYhndl_for_unspec; /* always >= 0 */
UCAnchorInfo *stages = typecalloc(UCAnchorInfo);
assert(stages != NULL);
if (stages == NULL)
outofmem(__FILE__, "HTAnchor_getUCInfoStage");
for (i = 0; i < UCT_STAGEMAX; i++) {
stages->s[i].C.MIMEname = "";
stages->s[i].LYhndl = -1;
}
if (me->charset) {
chndl = UCGetLYhndl_byMIME(me->charset);
if (chndl < 0)
chndl = UCLYhndl_for_unrec;
if (chndl < 0)
/*
* UCLYhndl_for_unrec not defined :-(
* fallback to UCLYhndl_for_unspec which always valid.
*/
chndl = UCLYhndl_for_unspec; /* always >= 0 */
}
MemCpy(&stages->s[UCT_STAGE_MIME].C, &LYCharSet_UC[chndl],
sizeof(LYUCcharset));
assert(stages != NULL);
stages->s[UCT_STAGE_MIME].lock = UCT_SETBY_DEFAULT;
stages->s[UCT_STAGE_MIME].LYhndl = chndl;
me->UCStages = stages;
}
if (me) {
return (&me->UCStages->s[which_stage].C);
for (i = 0; i < UCT_STAGEMAX; i++) {
stages->s[i].C.MIMEname = "";
stages->s[i].LYhndl = -1;
}
if (me->charset) {
chndl = UCGetLYhndl_byMIME(me->charset);
if (chndl < 0)
chndl = UCLYhndl_for_unrec;
if (chndl < 0)
/*
* UCLYhndl_for_unrec not defined :-(
* fallback to UCLYhndl_for_unspec which always valid.
*/
chndl = UCLYhndl_for_unspec; /* always >= 0 */
}
MemCpy(&stages->s[UCT_STAGE_MIME].C, &LYCharSet_UC[chndl],
sizeof(LYUCcharset));
stages->s[UCT_STAGE_MIME].lock = UCT_SETBY_DEFAULT;
stages->s[UCT_STAGE_MIME].LYhndl = chndl;
me->UCStages = stages;
}
result = (&me->UCStages->s[which_stage].C);
show_stages(me, "_getUCInfoStage", which_stage);
}
return (NULL);
return (result);
}
int HTAnchor_getUCLYhndl(HTParentAnchor *me,
......@@ -1362,6 +1388,7 @@ LYUCcharset *HTAnchor_setUCInfoStage(HTParentAnchor *me,
} else {
p->UChndl = -1;
}
show_stages(me, "_setUCInfoStage", which_stage);
return (p);
}
}
......@@ -1373,21 +1400,25 @@ LYUCcharset *HTAnchor_resetUCInfoStage(HTParentAnchor *me,
int which_stage,
int set_by)
{
LYUCcharset *result = NULL;
int ohandle;
if (!me || !me->UCStages)
return (NULL);
me->UCStages->s[which_stage].lock = set_by;
ohandle = me->UCStages->s[which_stage].LYhndl;
me->UCStages->s[which_stage].LYhndl = LYhndl;
if (me && me->UCStages) {
me->UCStages->s[which_stage].lock = set_by;
ohandle = me->UCStages->s[which_stage].LYhndl;
me->UCStages->s[which_stage].LYhndl = LYhndl;
#ifdef CAN_SWITCH_DISPLAY_CHARSET
/* Allow a switch to a more suitable display charset */
if (LYhndl >= 0 && LYhndl != ohandle && which_stage == UCT_STAGE_PARSER)
setup_switch_display_charset(me, LYhndl);
/* Allow a switch to a more suitable display charset */
if (LYhndl >= 0 && LYhndl != ohandle
&& which_stage == UCT_STAGE_PARSER)
setup_switch_display_charset(me, LYhndl);
#else
(void) ohandle;
(void) ohandle;
#endif
return (&me->UCStages->s[which_stage].C);
show_stages(me, "_resetUCInfoStage", which_stage);
result = (&me->UCStages->s[which_stage].C);
}
return result;
}
/*
......
/*
* $LynxId: HTChunk.c,v 1.26 2010/09/25 00:32:33 tom Exp $
* $LynxId: HTChunk.c,v 1.27 2012/02/07 11:28:44 tom Exp $
*
* Chunk handling: Flexible arrays
* ===============================
......@@ -150,10 +150,11 @@ HTChunk *HTChunkPutc2(HTChunk *ch, int c)
HTChunk *chunk = HTChunkCreateMayFail(ch->growby, ch->failok);
ch->next = chunk;
HTChunkPutc(chunk, UCH(c));
return chunk;
ch = chunk;
HTChunkPutc(ch, UCH(c));
} else {
ch->data[ch->size++] = (char) c;
}
ch->data[ch->size++] = (char) c;
return ch;
}
......@@ -205,11 +206,12 @@ HTChunk *HTChunkPutb2(HTChunk *ch, const char *b, int l)
chunk = HTChunkCreateMayFail(ch->growby, ch->failok);
ch->next = chunk;
HTChunkPutb(chunk, b + m, l - m);
return chunk;
ch = chunk;
HTChunkPutb(ch, b + m, l - m);
} else {
MemCpy(ch->data + ch->size, b, (unsigned) l);
ch->size += l;
}
MemCpy(ch->data + ch->size, b, (unsigned) l);
ch->size += l;
return ch;
}
......@@ -305,7 +307,7 @@ void HTChunkPuts(HTChunk *ch, const char *s)
for (p = s; *p; p++) {
if (ch->size >= ch->allocated) {
if (!HTChunkRealloc(ch, ch->growby))
return;
break;
}
ch->data[ch->size++] = *p;
}
......@@ -323,8 +325,9 @@ HTChunk *HTChunkPuts2(HTChunk *ch, const char *s)
HTChunk *chunk = HTChunkCreateMayFail(ch->growby, ch->failok);
ch->next = chunk;
HTChunkPuts(chunk, p);
return chunk;
ch = chunk;
HTChunkPuts(ch, p);
break;
}
ch->data[ch->size++] = *p;
}
......
/*
* $LynxId: HTFTP.c,v 1.100 2011/05/24 09:49:44 tom Exp $
* $LynxId: HTFTP.c,v 1.101 2012/02/09 12:34:48 tom Exp $
*
* File Transfer Protocol (FTP) Client
* for a WorldWideWeb browser
......@@ -1304,7 +1304,7 @@ static int get_listen_socket(void)
return HTInetStatus("getsockname");
#ifdef INET6
CTRACE((tfp, "HTFTP: This host is %s\n",
HTInetString((SockA *) soc_in)));
HTInetString((void *) soc_in)));
soc_in->sin_port = 0; /* Unspecified: please allocate */
#else
......@@ -1352,7 +1352,7 @@ static int get_listen_socket(void)
#ifdef INET6
CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
(int) ntohs(soc_in->sin_port),
HTInetString((SockA *) soc_in)));
HTInetString((void *) soc_in)));
#else
CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
(int) ntohs(soc_in->sin_port),
......
/*
* $LynxId: HTFile.c,v 1.128 2011/06/06 09:27:35 tom Exp $
* $LynxId: HTFile.c,v 1.129 2012/02/10 01:10:51 tom Exp $
*
* File Access HTFile.c
* ===========
......@@ -3086,7 +3086,7 @@ void HTSetProgramPath(ProgramPaths code, const char *path)
/*
* Reset the list of known program paths to the ones that are compiled-in
*/
void HTInitProgramPaths(void)
void HTInitProgramPaths(BOOL init)
{
ProgramPaths code;
int n;
......@@ -3218,7 +3218,9 @@ void HTInitProgramPaths(void)
if (test != NULL && test != path) {
free((char *) test);
}
HTSetProgramPath(code, path);
if (init) {
HTSetProgramPath(code, path);
}
}
}
......
/*
* $LynxId: HTFile.h,v 1.32 2010/09/24 00:32:16 tom Exp $
* $LynxId: HTFile.h,v 1.33 2012/02/10 00:59:15 tom Exp $
* File access in libwww
* FILE ACCESS
*
......@@ -347,7 +347,7 @@ extern "C" {
/*
* Reset the list of known program paths to the ones that are compiled-in
*/
extern void HTInitProgramPaths(void);
extern void HTInitProgramPaths(BOOL init);
/*
* The Protocols
......
/*
* $LynxId: HTMLGen.c,v 1.36 2011/06/11 12:10:02 tom Exp $
* $LynxId: HTMLGen.c,v 1.37 2012/02/10 18:32:26 tom Exp $
*
* HTML Generator
* ==============
......@@ -312,7 +312,7 @@ static void HTMLGen_write(HTStructured * me, const char *s,
*/
static int HTMLGen_start_element(HTStructured * me, int element_number,
const BOOL *present,
const char **value,
STRING2PTR value,
int charset GCC_UNUSED,
char **insert GCC_UNUSED)
{
......
/*
* $LynxId: HTParse.c,v 1.69 2011/06/06 10:46:18 tom Exp $
* $LynxId: HTParse.c,v 1.70 2012/02/09 19:57:37 tom Exp $
*
* Parse HyperText Document Address HTParse.c
* ================================
......@@ -300,7 +300,7 @@ static void convert_to_idna(char *host)
buffer,
idna_strerror((Idna_rc) code)));
}
if (output)
if (output) /* "(free)" to bypass LYLeaks.c */
(free) (output);
}
free(buffer);
......
/*
* $LynxId: HTString.c,v 1.65 2010/11/07 21:20:58 tom Exp $
* $LynxId: HTString.c,v 1.69 2012/02/09 22:02:21 tom Exp $
*
* Case-independent string comparison HTString.c
*
......@@ -359,7 +359,7 @@ char *HTSACopy_extra(char **dest,
EXTRA_TYPE size = 0;
if (*dest != 0) {
size = *(EXTRA_TYPE *) ((*dest) - EXTRA_SIZE);
size = *(EXTRA_TYPE *) (void *) ((*dest) - EXTRA_SIZE);
}
if ((*dest == 0) || (size < srcsize)) {
FREE_extra(*dest);
......@@ -368,7 +368,7 @@ char *HTSACopy_extra(char **dest,
if (*dest == NULL)
outofmem(__FILE__, "HTSACopy_extra");
assert(*dest != NULL);
*(EXTRA_TYPE *) (*dest) = size;
*(EXTRA_TYPE *) (void *) (*dest) = size;
*dest += EXTRA_SIZE;
}
MemCpy(*dest, src, srcsize);
......@@ -649,9 +649,8 @@ PUBLIC_IF_FIND_LEAKS char *StrAllocVsprintf(char **pstr,
result = HTAlloc(pstr ? *pstr : 0, new_len);
if (result != 0) {
strcpy(result + dst_len, temp);
mark_malloced(temp, new_len);
}
free(temp);
(free) (temp);
} else {
result = temp;
mark_malloced(temp, strlen(temp));
......@@ -1188,6 +1187,21 @@ void HTEndParam(char **result,
* there is a null on the end, anyway.
*/
/* (Re)allocate a bstring, e.g., to increase its buffer size for ad hoc
* operations.
*/
void HTSABAlloc(bstring **dest, int len)
{
if (*dest == 0)
*dest = typecalloc(bstring);
if ((*dest)->len != len) {
(*dest)->str = typeRealloc(char, (*dest)->str, len);
(*dest)->len = len;
}
}
/* Allocate a new bstring, and return it.
*/
void HTSABCopy(bstring **dest, const char *src,
......
/*
* $LynxId: HTString.h,v 1.34 2010/09/25 00:32:47 tom Exp $
* $LynxId: HTString.h,v 1.37 2012/02/07 23:41:25 tom Exp $
* String handling for libwww
* STRINGS
*
......@@ -128,6 +128,7 @@ extern "C" {
int len;
} bstring;
extern void HTSABAlloc(bstring **dest, int len);
extern void HTSABCopy(bstring **dest, const char *src, int len);
extern void HTSABCopy0(bstring **dest, const char *src);
extern void HTSABCat(bstring **dest, const char *src, int len);
......@@ -142,11 +143,13 @@ extern "C" {
#define isBEmpty(p) ((p) == 0 || BStrLen(p) == 0)
#define BStrCopy(d,s) HTSABCopy( &(d), BStrData(s), BStrLen(s))
#define BStrCopy0(d,s) HTSABCopy0( &(d), s)
#define BStrCat(d,s) HTSABCat( &(d), BStrData(s), BStrLen(s))
#define BStrCat0(d,s) HTSABCat0( &(d), s)
#define BStrFree(d) HTSABFree( &(d))
#define BStrAlloc(d,n) HTSABAlloc( &(d), n)
#define BStrCopy(d,s) HTSABCopy( &(d), BStrData(s), BStrLen(s))
#define BStrCopy0(d,s) HTSABCopy0( &(d), s)
#define BStrCopy1(d,s,n) HTSABCopy( &(d), s, n)
#define BStrCat(d,s) HTSABCat( &(d), BStrData(s), BStrLen(s))
#define BStrCat0(d,s) HTSABCat0( &(d), s)
#define BStrFree(d) HTSABFree( &(d))
extern bstring *HTBprintf(bstring **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3);
......
/*
* $LynxId: HTTCP.c,v 1.106 2010/11/07 21:20:58 tom Exp $
* $LynxId: HTTCP.c,v 1.107 2012/02/09 12:36:45 tom Exp $
*
* Generic Communication Code HTTCP.c
* ==========================
......@@ -450,7 +450,7 @@ static size_t fill_rehostent(char *rehostent,
size_t rehostentsize,
const LYNX_HOSTENT *phost)
{
AlignedHOSTENT *data = (AlignedHOSTENT *) rehostent;
AlignedHOSTENT *data = (AlignedHOSTENT *) (void *) rehostent;
int num_addrs = 0;
int num_aliases = 0;
char **pcnt;
......@@ -513,7 +513,7 @@ static size_t fill_rehostent(char *rehostent,
data->h.h_addrtype = phost->h_addrtype;
data->h.h_length = phost->h_length;
p_next_charptr = (char **) (rehostent + curlen);
p_next_charptr = (char **) (void *) (rehostent + curlen);
p_next_char = rehostent + curlen;
if (phost->h_addr_list)
p_next_char += (size_t) (num_addrs + 1) * sizeof(phost->h_addr_list[0]);
......@@ -706,7 +706,7 @@ LYNX_HOSTENT *LYGetHostByName(char *str)
* in the child's, otherwise the internal pointers built by the child's
* call to fill_rehostent would be invalid when seen by the parent). -kw
*/
char *rehostent = (char *) &aligned_full_rehostent;
void *rehostent = (void *) &aligned_full_rehostent;
/* for transfer of status from child to parent: */
struct _statuses {
......
/*
* $LynxId: HTUtils.h,v 1.107 2011/05/28 15:13:56 tom Exp $
* $LynxId: HTUtils.h,v 1.109 2012/02/10 18:44:24 tom Exp $
*
* Utility macros for the W3 code library
* MACROS FOR GENERAL USE
......@@ -196,6 +196,16 @@ extern int ignore_unused;
*/
#if defined(_WINDOWS) && !defined(__CYGWIN__)
#ifndef __GNUC__
#pragma warning (disable : 4100) /* unreferenced formal parameter */
#pragma warning (disable : 4127) /* conditional expression is constant */
#pragma warning (disable : 4201) /* nameless struct/union */
#pragma warning (disable : 4214) /* bit field types other than int */
#pragma warning (disable : 4310) /* cast truncates constant value */
#pragma warning (disable : 4514) /* unreferenced inline function has been removed */
#pragma warning (disable : 4996) /* This function or variable may be unsafe. ... */