about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES128
-rw-r--r--INSTALLATION6
-rw-r--r--WWW/Library/Implementation/HTAABrow.c117
-rw-r--r--WWW/Library/Implementation/HTAAProt.c62
-rw-r--r--WWW/Library/Implementation/HTAccess.c10
-rw-r--r--WWW/Library/Implementation/HTAnchor.c34
-rw-r--r--WWW/Library/Implementation/HTChunk.c18
-rw-r--r--WWW/Library/Implementation/HTFTP.c2
-rw-r--r--WWW/Library/Implementation/HTFWriter.c4
-rw-r--r--WWW/Library/Implementation/HTFile.c53
-rw-r--r--WWW/Library/Implementation/HTGopher.c2
-rw-r--r--WWW/Library/Implementation/HTGroup.c13
-rw-r--r--WWW/Library/Implementation/HTList.c34
-rw-r--r--WWW/Library/Implementation/HTMIME.c36
-rw-r--r--WWW/Library/Implementation/HTNews.c26
-rw-r--r--WWW/Library/Implementation/HTParse.c30
-rw-r--r--WWW/Library/Implementation/HTRules.c22
-rw-r--r--WWW/Library/Implementation/HTString.c2
-rw-r--r--WWW/Library/Implementation/HTTCP.c15
-rw-r--r--WWW/Library/Implementation/HTTP.c43
-rw-r--r--WWW/Library/Implementation/HTUtils.h11
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.c2
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisUI.c2
-rw-r--r--WWW/Library/Implementation/HTWAIS.c50
-rw-r--r--WWW/Library/Implementation/HTWSRC.c2
-rw-r--r--WWW/Library/Implementation/HTioctl.h11
-rw-r--r--WWW/Library/Implementation/SGML.c2
-rw-r--r--WWW/Library/Implementation/makefile.in109
-rw-r--r--aclocal.m42
-rw-r--r--config.hin18
-rwxr-xr-xconfigure1563
-rw-r--r--configure.in8
-rw-r--r--docs/README.defines2
-rw-r--r--lynx.cfg38
-rw-r--r--lynx_help/Lynx_users_guide.html4
-rw-r--r--lynx_help/keystrokes/keystroke_help.html2
-rw-r--r--makefile.in2
-rw-r--r--makefile.msc2
-rw-r--r--samples/bright-blue.lss57
-rw-r--r--samples/lynx.lss1
-rw-r--r--src/GridText.c1673
-rw-r--r--src/HTFWriter.c12
-rw-r--r--src/HTML.c4
-rw-r--r--src/LYBookmark.c2
-rw-r--r--src/LYCharUtils.c13
-rw-r--r--src/LYCookie.c6
-rw-r--r--src/LYCurses.c113
-rw-r--r--src/LYCurses.h9
-rw-r--r--src/LYDownload.c14
-rw-r--r--src/LYEdit.c2
-rw-r--r--src/LYExtern.c425
-rw-r--r--src/LYForms.c4
-rw-r--r--src/LYGlobalDefs.h4
-rw-r--r--src/LYHash.h1
-rw-r--r--src/LYHistory.c2
-rw-r--r--src/LYHistory.h2
-rw-r--r--src/LYJump.c4
-rw-r--r--src/LYKeymap.c26
-rw-r--r--src/LYKeymap.h7
-rw-r--r--src/LYLeaks.c38
-rw-r--r--src/LYLocal.c79
-rw-r--r--src/LYMain.c18
-rw-r--r--src/LYMainLoop.c19
-rw-r--r--src/LYNews.c10
-rw-r--r--src/LYOptions.c2
-rw-r--r--src/LYPrint.c12
-rw-r--r--src/LYReadCFG.c250
-rw-r--r--src/LYReadCFG.h3
-rw-r--r--src/LYStrings.c132
-rw-r--r--src/LYStrings.h4
-rw-r--r--src/LYStructs.h32
-rw-r--r--src/LYStyle.c28
-rw-r--r--src/LYUpload.c8
-rw-r--r--src/LYUtils.c43
-rw-r--r--src/LYUtils.h6
-rw-r--r--src/TRSTable.c55
-rw-r--r--src/TRSTable.h11
-rw-r--r--src/UCAuto.c30
-rw-r--r--src/Xsystem.c4
-rw-r--r--src/chrtrans/makefile.in13
-rw-r--r--src/makefile.dos4
-rw-r--r--src/makefile.in67
-rw-r--r--userdefs.h4
83 files changed, 2837 insertions, 2903 deletions
diff --git a/CHANGES b/CHANGES
index 1d8696a3..4ce18a76 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,132 @@
 Changes since Lynx 2.8 release
 ===============================================================================
 
+2001-04-01 (2.8.4dev.20)
+* rename KEYMAP 'EXTERN' to 'EXTERN_LINK', adding 'EXTERN_PAGE'.  Existing
+  keymaps should work since 'EXTERN_LINK' matches first.  EXTERN_PAGE runs the
+  external command on the current page.  Map comma (,) to EXTERN_PAGE -TD
+* replace most calloc calls with typecalloc or typecallocn -TD
+* modify LYExtern.c to recognize if more than one EXTERN command has been
+  defined in lynx.cfg for a given name, and allow the user to select one
+  command from a popup menu -TD
+* split-out code that opens lynx.cfg and lynx.lss as LYOpenCFG() function,
+  making that check if the given pathname is absolute.  If not, it attempts
+  to look in the same directory as the parent file (when processing includes),
+  or the directory of the default config file -TD
+* replace some explicit "r", "w", and "a+" fopen modes with TXT_R, TXT_W and
+  TXT_A, add/use corresponding BIN_R, BIN_W, BIN_A definitions.  Correction to
+  OpenHiddenFile(), which would have appended text to a binary file -TD
+* combined lynx_html_item_type and lynx_printer_item_type structs as
+  lynx_list_item_type to simplify LYReadCFG.c and incidentally fixing a bug in
+  add_printer_to_list by merging it with add_item_to_list -TD
+* implement a simple workaround for staircased messages from running xli as an
+  external viewer, with lynx_nl2crlf() function -TD
+* add bright-blue.lss sample (from IZ) -TD
+* modify makefile.in's to use symbol _O for object suffix to allow simple
+  override for OS/2 EMX -Zomf compiler option (request by IZ) -TD
+* add HAVE_LYHELP_H definition in config.hin and use that in LYGlobalDefs.h
+  to workaround misuse of HAVE_CONFIG_H in makelynx.bat -TD
+* work-around in LYrefresh() when curses pads are used, for special case where
+  cursor is not set properly when prompting with long subject line for mailto
+  URL -TD
+* eliminate some pointer mismatch compiler warnings in LYEditInsert() for
+  EXP_KEYBOARD_LAYOUT configuration -TD
+* improve handling of tables with respect to bad HTML.  Also took an
+  opportunity to macroize a couple of places which missed in
+  unobfuscation-of-faking <td></td> (this faking happens when line break
+  happens in a non-first column of a table) -IZ
+  For example:
+    <TR>
+      <TD>
+             <FORM ACTION="FrameWork.class" METHOD="post">
+          y
+      </TD>
+      <TD>
+         <DIV>
+              x
+         </DIV></FORM>
+      </TD>
+    </TR>
+  Note FORM which spans cells.  -trace'ing it gives very unintuitive
+  results: it skips </TD> inside FORM, but not <TD>.  Then it supplied
+  </TD> when the FORM ends.
+* repair treatment of colspans in TRST, making it work again in one of the
+  special cases it worked before.  Another bug was in interaction of
+  justification and tables -IZ
+* marked more TRACEs in TRST as "BUG"s -IZ
+* TRST would sometimes produce non-intuitive results if <td> follows </tr>. 
+  Add error recovery for this case -IZ
+* corrections for nested-table configuration -IZ
+  + make trailing <BR> in table cells "behave well" again (the following cell
+    would not be horizontally offset).
+  + fix highlighting of multiline links inside tables, and a "80M tracelog" bug
+    (due to a misprint update of the enclosing table was performed once-per-row
+    instead of once-per-table).  Extra updates would not hurt, but led to
+    slowdowns and quadratic-size logs.
+  + fix a special case with table-in-table for partial-display
+* resizing a window on a console may lead to a switch of the character-cell
+  size.  The "downloaded font" loaded during an auto-switch of display-charset
+  may be no longer valid.  In this case, force a re-download of the suitable
+  font for the current charcell size -IZ
+* add reverse-video style for forwbackw.arrow to lynx.lss -TD
+* while an error in .lynx-keymaps is fatal, but a more or less equivalent error
+  in the KEYMAP section of lynx.cfg is benign.  Make them both benign -IZ
+* change remaining uses of lookup_keymap(LYK_xxx) to LAC_TO_LKC0(LYK_xxx) -TD
+* modify set_clicked_link() to return lynx keycodes rather than character
+  values -IZ
+* remove line_for_char() function since it is used for HTLine.start
+  computations -TD
+* several changes to GridText.c -IZ
+  + '#' (shown at the UL corner when there is a toolbar) is shown even at the
+    beginning-of-the document.
+  + with mouse enabled, the first 6 chars in the UL corner were "always"
+    sensitive to Click-1, behaving as PREV_DOC (usually on Left).  This patch
+    changes this logic (for color-style):
+       If '#' is shown there, clicking on it behaves as pressing #;
+       Clicking on the next 6 chars behaves as PREV_DOC/NEXT_DOC (3+3);
+  + if you define a style for forwbackw.arrow, then suitable arrows are shown
+    in these 3+3 positions; in fact they are shown only if it makes sense to do
+    PREV_DOC/NEXT_DOC, providing additional feedback.
+  + remove the first empty line shown on any HTML document.
+  + correct an off-by-one error in the removal-of-zero-length-markup logic. 
+    Due to this bug, zero-length markup was never removed, which led to
+    accumulation of style change entries, eventually to a buffer overflow.  At
+    this moment lynx color-style engine would give up, resulting in
+    incomprehensible ocean of colors on the display.  To demonstrate, make a
+    select entry with more than 46 entries.  [My auto-display-charset logic
+    added 2 new encodings to the table of Lynx, bringing the number to 46 on
+    the 'o'ption form.  ;-]
+  + fixes a bug with incorrectly calculated width of a numeric tag [12]
+    as far as 12 is 10 or more (still fixes Debian #68542).
+  + remove unused members from HTLine struct.
+  + make variables underline_on and bold_on private.
+  + rewrote insert_blanks_in_line(), splitting out move_anchors_in_region().
+  + make split_line() easier to maintain by adding variables to represent
+    common subexpressions, e.g., s_post, s_pre.
+  + use set_style_by_embedded_chars() in split_line() to simplify/improve test
+    for whether lynx should add a bold/underline control.
+  + recode to eliminate HTLine.start
+  + recode to eliminate HTLine.chars
+  + several changes to split_line(), using pointers to HTChangeStyle structs
+    rather than array indices.
+* adjust some ifdef's to make configure --disable-trace compile -TD
+* correct allocation size in mailcap_substitute(), which did not count the
+  trailing null -TD
+* add configure --enable-vertrace option, to put __FILE__ and __LINE__ into
+  trace log -PG
+* improve description of USE_MOUSE in lynx.cfg -PW
+* fix a few warnings from antic (unreached statements due to quirks of ifdef's,
+  incorrectly-indented code) -TD
+* eliminate a few references to USE_HASH and LINKEDSTYLES in documentation -TD
+* fix a couple of compiler warnings for SCO (report by BL)
+* fix a comparison in HTChunkPutUtf8Char() to work with EBCDIC -PG
+* fix a typo in LYCharUtils.c CTRACE macro, amend tracing to avoid suppressing
+  a related user message -PG
+* change CF_TERMCAP_LIBS configure macro to warn rather than exit with an error
+  if it cannot find the libraries it is looking for.  This allows one to
+  configure with the slang library on systems without a termcap library (report
+  by Atsuhito Kohda) -TD
+
 2001-02-26 (2.8.4dev.19)
 * add experimental configure option for post-dev.16 TRST changes by IZ
   (--enable-nested-tables), ifdef'd with EXP_NESTED_TABLES -TD
@@ -77,7 +203,7 @@ Changes since Lynx 2.8 release
   clicking outside the menu -IZ
 * allow a different approach to the problem:  how to enter a keyboard
   navigation command when you are in an editing mode.  A new EDIT-time action
-  is introduced:  LYE_STOP.  I use it like this:
+  is introduced:  LYE_STOP.  Use it like this:
 	KEYMAP:^[:INTERRUPT:STOP
   The action behaves as if -tna is temporarily switched on:  your edit is
   committed, and you go into the non-edit mode - until you press Enter on an
diff --git a/INSTALLATION b/INSTALLATION
index d21b4d3c..a9bd1bcb 100644
--- a/INSTALLATION
+++ b/INSTALLATION
@@ -338,7 +338,7 @@ II. Compile instructions -- UNIX
   --enable-color-style			(define USE_COLOR_STYLE)
   	Use this option to enable optional and *experimental* color style.
 	This is implemented for curses (if it supports color), ncurses and
-	PDCurses, but not slang.  (Also defines USE_HASH, LINKEDSTYLES)
+	PDCurses, but not slang.
 
   --enable-debug			(The symbol DEBUG is always defined.)
         Use this option to compile-in support for debugging.
@@ -446,6 +446,10 @@ II. Compile instructions -- UNIX
   --enable-underlines			(define UNDERLINE_LINKS)
 	Use this option to underline links rather than using boldface.
 
+  --enable-vertrace			(define LY_TRACELINE)
+	Turn on code that prefixes trace output lines with source filename
+	and line number.
+
   --enable-warnings
 	Use this option to turn on GCC compiler warnings.
 
diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c
index 0db66cbb..519030fa 100644
--- a/WWW/Library/Implementation/HTAABrow.c
+++ b/WWW/Library/Implementation/HTAABrow.c
@@ -75,11 +75,11 @@ typedef struct {
     int		portnumber;	/* Port number			*/
     BOOL	IsProxy;	/* Is it a proxy?		*/
     HTList *	setups;		/* List of protection setups	*/
-                                /* on this server; i.e., valid	*/
-                                /* authentication schemes and	*/
-                                /* templates when to use them.	*/
-                                /* This is actually a list of	*/
-                                /* HTAASetup objects.		*/
+				/* on this server; i.e., valid	*/
+				/* authentication schemes and	*/
+				/* templates when to use them.	*/
+				/* This is actually a list of	*/
+				/* HTAASetup objects.		*/
     HTList *	realms;		/* Information about passwords	*/
 } HTAAServer;
 
@@ -90,7 +90,7 @@ typedef struct {
 typedef struct {
     HTAAServer *server;		/* Which server serves this tree	     */
     char *	template;	/* Template for this tree		     */
-    HTList *	valid_schemes;	/* Valid authentic.schemes   		     */
+    HTList *	valid_schemes;	/* Valid authentic.schemes		     */
     HTAssocList**scheme_specifics;/* Scheme specific params		     */
     BOOL	retry;		/* Failed last time -- reprompt (or whatever)*/
 } HTAASetup;
@@ -119,14 +119,14 @@ PRIVATE char *compose_auth_stringResult = NULL;	/* Uuencoded presentation */
 PRIVATE HTList *server_table	= NULL;	/* Browser's info about servers	     */
 PRIVATE char *secret_key	= NULL;	/* Browser's latest secret key       */
 PRIVATE HTAASetup *current_setup= NULL;	/* The server setup we are currently */
-                                        /* talking to			     */
+					/* talking to			     */
 PRIVATE char *current_hostname	= NULL;	/* The server's name and portnumber  */
 PRIVATE int current_portnumber	= 80;	/* where we are currently trying to  */
-                                        /* connect.			     */
-PRIVATE char *current_docname	= NULL;	/* The document's name we are        */
-                                        /* trying to access.		     */
+					/* connect.			     */
+PRIVATE char *current_docname	= NULL; /* The document's name we are	     */
+					/* trying to access.		     */
 PRIVATE char *HTAAForwardAuth	= NULL;	/* Authorization: line to forward    */
-                                        /* (used by gateway httpds)	     */
+					/* (used by gateway httpds)	     */
 PRIVATE HTAASetup *proxy_setup	= NULL;	/* Same as above, but for Proxy -AJL */
 PRIVATE char *proxy_hostname	= NULL;
 PRIVATE char *proxy_docname	= NULL;
@@ -140,10 +140,10 @@ PUBLIC void HTAAForwardAuth_set ARGS2(
 	CONST char *,	scheme_specifics)
 {
     int len = 20 + (scheme_name      ? strlen(scheme_name)      : 0)
-	         + (scheme_specifics ? strlen(scheme_specifics) : 0);
+		 + (scheme_specifics ? strlen(scheme_specifics) : 0);
 
     FREE(HTAAForwardAuth);
-    if (!(HTAAForwardAuth = (char*)calloc(1, sizeof(char) * len)))
+    if ((HTAAForwardAuth = typecallocn(char, len)) == 0)
 	outofmem(__FILE__, "HTAAForwardAuth_set");
 
     strcpy(HTAAForwardAuth, "Authorization: ");
@@ -189,7 +189,7 @@ PRIVATE HTAAServer *HTAAServer_new ARGS3(
 {
     HTAAServer *server;
 
-    if (!(server = (HTAAServer *)calloc(1, sizeof(HTAAServer))))
+    if ((server = typecalloc(HTAAServer)) == 0)
 	outofmem(__FILE__, "HTAAServer_new");
 
     server->hostname	= NULL;
@@ -199,10 +199,10 @@ PRIVATE HTAAServer *HTAAServer_new ARGS3(
     server->realms	= HTList_new();
 
     if (hostname)
-        StrAllocCopy(server->hostname, hostname);
+	StrAllocCopy(server->hostname, hostname);
 
     if (!server_table)
-        server_table = HTList_new();
+	server_table = HTList_new();
 
     HTList_addObject(server_table, (void*)server);
 
@@ -233,8 +233,8 @@ PRIVATE void HTAAServer_delete ARGS1(
 	if (killme->setups != NULL) {
 	    n = HTList_count(killme->setups);
 	    for (i = (n - 1); i >= 0; i--) {
-	        if ((setup = (HTAASetup*)HTList_objectAt(killme->setups,
-	     						 i)) != NULL) {
+		if ((setup = (HTAASetup*)HTList_objectAt(killme->setups,
+							 i)) != NULL) {
 		    HTAASetup_delete(setup);
 		    setup = NULL;
 		}
@@ -310,7 +310,7 @@ PRIVATE HTAAServer *HTAAServer_lookup ARGS3(
 **			are trying to access.
 **	IsProxy		should be TRUE if this is a proxy.
 **
-** 	This function goes through the information known about
+**	This function goes through the information known about
 **	all the setups of the server, and finds out if the given
 **	filename resides in one of the protected directories.
 **
@@ -331,7 +331,7 @@ PRIVATE HTAASetup *HTAASetup_lookup ARGS4(
     HTAASetup *setup;
 
     if (portnumber <= 0)
-        portnumber = 80;
+	portnumber = 80;
 
     if (hostname && docname && *hostname && *docname &&
 	NULL != (server = HTAAServer_lookup(hostname,
@@ -352,7 +352,7 @@ PRIVATE HTAASetup *HTAASetup_lookup ARGS4(
 			    "matched template", setup->template));
 		return setup;
 	    } else {
-	        CTRACE((tfp, "%s `%s' %s `%s'\n",
+		CTRACE((tfp, "%s `%s' %s `%s'\n",
 			    "HTAASetup_lookup:", docname,
 			    "did NOT match template", setup->template));
 	    }
@@ -395,16 +395,16 @@ PRIVATE HTAASetup *HTAASetup_new ARGS4(
     HTAASetup *setup;
 
     if (!server || !template || !*template)
-        return NULL;
+	return NULL;
 
-    if (!(setup = (HTAASetup*)calloc(1, sizeof(HTAASetup))))
+    if ((setup = typecalloc(HTAASetup)) == 0)
 	outofmem(__FILE__, "HTAASetup_new");
 
     setup->retry = NO;
     setup->server = server;
     setup->template = NULL;
     if (template)
-        StrAllocCopy(setup->template, template);
+	StrAllocCopy(setup->template, template);
     setup->valid_schemes = valid_schemes;
     setup->scheme_specifics = scheme_specifics;
 
@@ -474,7 +474,7 @@ PRIVATE void HTAASetup_updateSpecifics ARGS2(
 
 /*************************** HTAARealm **********************************/
 
-/* PRIVATE 						HTAARealm_lookup()
+/* PRIVATE						HTAARealm_lookup()
 **		LOOKUP HTAARealm STRUCTURE BY REALM NAME
 ** ON ENTRY:
 **	realm_table	a list of realm objects.
@@ -525,7 +525,7 @@ PRIVATE HTAARealm *HTAARealm_new ARGS4(
     realm = HTAARealm_lookup(realm_table, realmname);
 
     if (!realm) {
-	if (!(realm = (HTAARealm*)calloc(1, sizeof(HTAARealm))))
+	if ((realm = typecalloc(HTAARealm)) == 0)
 	    outofmem(__FILE__, "HTAARealm_new");
 	realm->realmname = NULL;
 	realm->username = NULL;
@@ -535,9 +535,9 @@ PRIVATE HTAARealm *HTAARealm_new ARGS4(
 	    HTList_addObject(realm_table, (void*)realm);
     }
     if (username)
-        StrAllocCopy(realm->username, username);
+	StrAllocCopy(realm->username, username);
     if (password)
-        StrAllocCopy(realm->password, password);
+	StrAllocCopy(realm->password, password);
 
     return realm;
 }
@@ -595,11 +595,11 @@ PRIVATE char *compose_auth_string ARGS3(
 
     realmname = HTAssocList_lookup(setup->scheme_specifics[scheme], "realm");
     if (!realmname)
-        return NULL;
+	return NULL;
 
     realm = HTAARealm_lookup(setup->server->realms, realmname);
     if (!(realm &&
-    	  realm->username && *realm->username &&
+	  realm->username && *realm->username &&
 	  realm->password) || setup->retry) {
 	if (!realm) {
 	    CTRACE((tfp, "%s `%s' %s\n",
@@ -621,7 +621,7 @@ PRIVATE char *compose_auth_string ARGS3(
 	if ((!IsProxy) && using_proxy && setup->template) {
 	    proxiedHost = HTParse(setup->template, "", PARSE_HOST);
 	    if (proxiedHost && *proxiedHost != '\0') {
-	        theHost = proxiedHost;
+		theHost = proxiedHost;
 	    }
 	}
 	/*
@@ -644,7 +644,7 @@ PRIVATE char *compose_auth_string ARGS3(
 	 */
 	len = strlen(realm->realmname) +
 	      strlen(theHost ?
-	      	     theHost : "??") + 50;
+		     theHost : "??") + 50;
 	HTSprintf0(&msg, gettext("Username for '%s' at %s '%s%s':"),
 		     realm->realmname,
 		     (IsProxy ? "proxy" : "server"),
@@ -690,18 +690,18 @@ PRIVATE char *compose_auth_string ARGS3(
 	FREE(secret_key);
     }
 
-    if (!(cleartext  = (char*)calloc(1, sizeof(char) * len)))
+    if ((cleartext = typecallocn(char, len)) == 0)
 	outofmem(__FILE__, "compose_auth_string");
 
     if (realm->username)
-        strcpy(cleartext, realm->username);
+	strcpy(cleartext, realm->username);
     else
-        *cleartext = '\0';
+	*cleartext = '\0';
 
     strcat(cleartext, ":");
 
     if (realm->password)
-        strcat(cleartext, realm->password);
+	strcat(cleartext, realm->password);
 
     if (scheme == HTAA_PUBKEY) {
 	strcat(cleartext, ":");
@@ -712,9 +712,8 @@ PRIVATE char *compose_auth_string ARGS3(
 	if (secret_key)
 	    strcat(cleartext, secret_key);
 
-	if (!((ciphertext = (char *)calloc(1, (sizeof(char) * 2) * len)) &&
-	      (compose_auth_stringResult =
-	      		    (char *)calloc(1, (sizeof(char) * 3) * len))))
+	if (!((ciphertext = typecallocn(char, 2 * len)) &&
+	      (compose_auth_stringResult = typecallocn(char, 3 * len))))
 	    outofmem(__FILE__, "compose_auth_string");
 #ifdef PUBKEY
 	HTPK_encrypt(cleartext, ciphertext, server->public_key);
@@ -726,7 +725,7 @@ PRIVATE char *compose_auth_string ARGS3(
     }
     else { /* scheme == HTAA_BASIC */
 	if (!(compose_auth_stringResult =
-				(char*)calloc(1, (4 * ((len+2)/3)) + 1)))
+				typecallocn(char, (4 * ((len+2)/3)) + 1)))
 	    outofmem(__FILE__, "compose_auth_string");
 	HTUU_encode((unsigned char *)cleartext, strlen(cleartext),
 		    compose_auth_stringResult);
@@ -781,11 +780,11 @@ PRIVATE void free_HTAAGlobals NOARGS
     int n, i;
 
     if (server_table != NULL) {
-        n = HTList_count(server_table);
+	n = HTList_count(server_table);
 	for (i = (n - 1); i >= 0; i--) {
 	    if ((server = (HTAAServer*)HTList_objectAt(server_table,
-	     						i)) != NULL) {
-	        HTAAServer_delete(server);
+							i)) != NULL) {
+		HTAAServer_delete(server);
 		server = NULL;
 	    }
 	}
@@ -839,7 +838,7 @@ PUBLIC char *HTAA_composeAuth ARGS4(
     */
     if (!free_HTAAGlobalsSet) {
 #ifdef LY_FIND_LEAKS
-        atexit(free_HTAAGlobals);
+	atexit(free_HTAAGlobals);
 #endif
 	free_HTAAGlobalsSet = TRUE;
     }
@@ -864,15 +863,15 @@ PUBLIC char *HTAA_composeAuth ARGS4(
     FREE(HTAA_composeAuthResult);	/* From previous call */
 
     if (IsProxy) {
-        /*
+	/*
 	**  Proxy Authorization required. - AJL
 	*/
 
 	CTRACE((tfp, "Composing Proxy Authorization for %s:%d/%s\n",
 		    hostname, portnumber, docname));
 
-	if (proxy_portnumber != portnumber ||
-	    !proxy_hostname || !proxy_docname ||
+	if (proxy_portnumber  != portnumber       ||
+	    !proxy_hostname   || !proxy_docname   ||
 	    !hostname         || !docname         ||
 	    0 != strcmp(proxy_hostname, hostname) ||
 	    0 != strcmp(proxy_docname, docname)) {
@@ -901,7 +900,7 @@ PUBLIC char *HTAA_composeAuth ARGS4(
 	if (!proxy_setup)
 	    return NULL;
 
-    	switch (scheme = HTAA_selectScheme(proxy_setup)) {
+	switch (scheme = HTAA_selectScheme(proxy_setup)) {
 	  case HTAA_BASIC:
 	  case HTAA_PUBKEY:
 	    auth_string = compose_auth_string(scheme, proxy_setup, IsProxy);
@@ -935,7 +934,7 @@ PUBLIC char *HTAA_composeAuth ARGS4(
 	    return(HTAA_composeAuthResult);
 	}
 	len = strlen(auth_string) + strlen((char *)HTAAScheme_name(scheme)) + 26;
-	if (!(HTAA_composeAuthResult = (char*)calloc(1, sizeof(char) * len)))
+	if ((HTAA_composeAuthResult = typecallocn(char, len)) == 0)
 	    outofmem(__FILE__, "HTAA_composeAuth");
 	strcpy(HTAA_composeAuthResult, "Proxy-Authorization: ");
 
@@ -1011,7 +1010,7 @@ PUBLIC char *HTAA_composeAuth ARGS4(
 	}
 
 	len = strlen(auth_string) + strlen((char *)HTAAScheme_name(scheme)) + 20;
-	if (!(HTAA_composeAuthResult = (char*)calloc(1, sizeof(char) * len)))
+	if ((HTAA_composeAuthResult = typecallocn(char, len)) == 0)
 	    outofmem(__FILE__, "HTAA_composeAuth");
 	strcpy(HTAA_composeAuthResult, "Authorization: ");
     }
@@ -1069,7 +1068,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
     */
     if (!free_HTAAGlobalsSet) {
 #ifdef LY_FIND_LEAKS
-        atexit(free_HTAAGlobals);
+	atexit(free_HTAAGlobals);
 #endif
 	free_HTAAGlobalsSet = TRUE;
     }
@@ -1092,9 +1091,9 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
 
 	    if ((IsProxy &&
 		 0==strcasecomp(fieldname, "Proxy-Authenticate:")) ||
-	        (!IsProxy &&
+		(!IsProxy &&
 		 0==strcasecomp(fieldname, "WWW-Authenticate:"))) {
-	        if (!(arg1 && *arg1 && args && *args)) {
+		if (!(arg1 && *arg1 && args && *args)) {
 		    HTSprintf0(&temp, gettext("Invalid header '%s%s%s%s%s'"), line,
 				  ((arg1 && *arg1) ? " "  : ""),
 				  ((arg1 && *arg1) ? arg1 : ""),
@@ -1107,8 +1106,8 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
 		    HTList_addObject(valid_schemes, (void*)scheme);
 		    if (!scheme_specifics) {
 			int i;
-			scheme_specifics = (HTAssocList**)
-			    calloc(1, HTAA_MAX_SCHEMES * sizeof(HTAssocList*));
+			scheme_specifics =
+			    typecallocn(HTAssocList *, HTAA_MAX_SCHEMES);
 			if (!scheme_specifics)
 			    outofmem(__FILE__, "HTAA_shouldRetryWithAuth");
 			for (i=0; i < HTAA_MAX_SCHEMES; i++)
@@ -1152,7 +1151,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
 	    proxy_setup = NULL;
 	    return NO;
 	}
-        /*
+	/*
 	**  Doing it for proxy.  -AJL
 	*/
 	if (proxy_setup && proxy_setup->server) {
@@ -1170,7 +1169,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
 		proxy_setup = NULL;
 		return NO;
 	    } else {
-	        /*
+		/*
 		**  Re-ask username+password (if misspelled).
 		*/
 		proxy_setup->retry = YES;
@@ -1236,7 +1235,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
 	    return YES;
 	}
     } else {
-        /*
+	/*
 	**  current_setup == NULL, i.e., we have a
 	**  first connection to a protected server or
 	**  the server serves a wider set of documents
@@ -1258,7 +1257,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4(
 				      scheme_specifics);
 	FREE(template);
 
-        HTAlert(gettext("Access without authorization denied -- retrying"));
+	HTAlert(gettext("Access without authorization denied -- retrying"));
 	return YES;
     }
     /* Never reached */
diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c
index 24907b84..1e83df8f 100644
--- a/WWW/Library/Implementation/HTAAProt.c
+++ b/WWW/Library/Implementation/HTAAProt.c
@@ -30,6 +30,7 @@
 #include <HTLex.h>	/* Lexical analysor	*/
 #include <HTAAProt.h>	/* Implemented here	*/
 
+#include <LYUtils.h>
 #include <LYLeaks.h>
 
 #define NOBODY    65534	/* -2 in 16-bit environment */
@@ -46,9 +47,9 @@ typedef struct {
 PRIVATE HTList *  prot_cache	= NULL;	/* Protection setup cache.	*/
 PRIVATE HTAAProt *default_prot	= NULL;	/* Default protection.		*/
 PRIVATE HTAAProt *current_prot	= NULL;	/* Current protection mode	*/
-                                        /* which is set up by callbacks	*/
-                                        /* from the rule system when	*/
-                                        /* a "protect" rule is matched.	*/
+					/* which is set up by callbacks */
+					/* from the rule system when	*/
+					/* a "protect" rule is matched. */
 
 #ifndef NOUSERS
 /* PRIVATE							isNumber()
@@ -86,7 +87,7 @@ PRIVATE BOOL isNumber ARGS1(CONST char *, s)
 PUBLIC char * HTAA_getUidName NOARGS
 {
     if (current_prot && current_prot->uid_name
-                  && (0 != strcmp(current_prot->uid_name,"nobody")) )
+		  && (0 != strcmp(current_prot->uid_name,"nobody")) )
        return(current_prot->uid_name);
     else
        return("");
@@ -257,8 +258,8 @@ PRIVATE void HTAA_parseProtFile ARGS2(HTAAProt *, prot,
 
 		if (LEX_FIELD_SEP != (lex_item = lex(fp)))
 		    unlex(lex_item);	/* If someone wants to use colon */
-		                        /* after field name it's ok, but */
-		                        /* not required. Here we read it.*/
+					/* after field name it's ok, but */
+					/* not required. Here we read it.*/
 
 		if (0==strncasecomp(fieldname, "Auth", 4)) {
 		    lex_item = lex(fp);
@@ -269,9 +270,9 @@ PRIVATE void HTAA_parseProtFile ARGS2(HTAAProt *, prot,
 				prot->valid_schemes = HTList_new();
 			    HTList_addObject(prot->valid_schemes,(void*)scheme);
 			    CTRACE((tfp, "%s %s `%s'\n",
-				        "HTAA_parseProtFile: valid",
-				        "authentication scheme:",
-				        HTAAScheme_name(scheme)));
+					"HTAA_parseProtFile: valid",
+					"authentication scheme:",
+					HTAAScheme_name(scheme)));
 			} else {
 			    CTRACE((tfp, "%s %s `%s'\n",
 					"HTAA_parseProtFile: unknown",
@@ -384,7 +385,7 @@ PRIVATE HTAAProt *HTAAProt_new ARGS3(CONST char *,	cur_docname,
 	CTRACE((tfp, "HTAAProt_new: Loading protection file `%s'\n",
 		    prot_filename));
 
-	if (!(prot = (HTAAProt*)calloc(1, sizeof(HTAAProt))))
+	if ((prot = typecalloc(HTAAProt)) == 0)
 	    outofmem(__FILE__, "HTAAProt_new");
 
 	prot->template	= NULL;
@@ -395,11 +396,10 @@ PRIVATE HTAAProt *HTAAProt_new ARGS3(CONST char *,	cur_docname,
 	prot->mask_group= NULL;		/* Masking disabled by defaults */
 	prot->values	= HTAssocList_new();
 
-	if (prot_filename && NULL != (fp = fopen(prot_filename, "r"))) {
+	if (prot_filename && NULL != (fp = fopen(prot_filename, TXT_R))) {
 	    HTAA_parseProtFile(prot, fp);
 	    fclose(fp);
-	    if (!(cache_item =
-	    		(HTAAProtCache*)calloc(1, sizeof(HTAAProtCache))))
+	    if ((cache_item = typecalloc(HTAAProtCache)) == 0)
 		outofmem(__FILE__, "HTAAProt_new");
 	    cache_item->prot = prot;
 	    cache_item->prot_filename = NULL;
@@ -487,14 +487,14 @@ PUBLIC void HTAA_setCurrentProtection ARGS3(CONST char *,	cur_docname,
 	    current_prot = default_prot;
 	    HTAA_setIds(current_prot, ids);
 	    CTRACE((tfp, "%s %s %s\n",
-		        "HTAA_setCurrentProtection: Protection file",
-		        "not specified for Protect rule",
-		        "-- using default protection"));
+			"HTAA_setCurrentProtection: Protection file",
+			"not specified for Protect rule",
+			"-- using default protection"));
 	} else {
 	    CTRACE((tfp, "%s %s %s\n",
-		        "HTAA_setCurrentProtection: ERROR: Protection",
-		        "file not specified for Protect rule, and",
-		        "default protection is not set!!"));
+			"HTAA_setCurrentProtection: ERROR: Protection",
+			"file not specified for Protect rule, and",
+			"default protection is not set!!"));
 	}
     }
 }
@@ -571,9 +571,9 @@ PUBLIC void HTAA_clearProtections NOARGS
 }
 
 typedef struct {
-    	char *name;
+	char *name;
 	int user;
-    	} USER_DATA;
+	} USER_DATA;
 
 PRIVATE HTList *known_grp = NULL;
 PRIVATE HTList *known_pwd = NULL;
@@ -603,7 +603,7 @@ PRIVATE void clear_uidgid_cache NOARGS
 #ifndef NOUSERS
 PRIVATE void save_gid_info ARGS2(char *, name, int, user)
 {
-    USER_DATA *data = (USER_DATA *)calloc(1, sizeof(USER_DATA));
+    USER_DATA *data = typecalloc(USER_DATA);
     if (!data)
 	return;
     if (!known_grp) {
@@ -624,7 +624,7 @@ PRIVATE void save_gid_info ARGS2(char *, name, int, user)
 #ifndef NOUSERS
 PRIVATE void save_uid_info ARGS2(char *, name, int, user)
 {
-    USER_DATA *data = (USER_DATA *)calloc(1, sizeof(USER_DATA));
+    USER_DATA *data = typecalloc(USER_DATA);
     if (!data)
 	return;
     if (!known_pwd) {
@@ -642,8 +642,8 @@ PRIVATE void save_uid_info ARGS2(char *, name, int, user)
 }
 #endif /* !NOUSERS */
 
-/* PUBLIC                                                       HTAA_UidToName
-**              GET THE USER NAME
+/* PUBLIC							HTAA_UidToName
+**		GET THE USER NAME
 ** ON ENTRY:
 **      The user-id
 **
@@ -675,8 +675,8 @@ PUBLIC char * HTAA_UidToName ARGS1(int, uid)
     return "";
 }
 
-/* PUBLIC                                                       HTAA_NameToUid
-**              GET THE USER ID
+/* PUBLIC							HTAA_NameToUid
+**		GET THE USER ID
 ** ON ENTRY:
 **      The user-name
 **
@@ -707,8 +707,8 @@ PUBLIC int HTAA_NameToUid ARGS1(char *, name)
     return NONESUCH;
 }
 
-/* PUBLIC                                                       HTAA_GidToName
-**              GET THE GROUP NAME
+/* PUBLIC							HTAA_GidToName
+**		GET THE GROUP NAME
 ** ON ENTRY:
 **      The group-id
 **
@@ -740,8 +740,8 @@ PUBLIC char * HTAA_GidToName ARGS1(int, gid)
     return "";
 }
 
-/* PUBLIC                                                       HTAA_NameToGid
-**              GET THE GROUP ID
+/* PUBLIC							HTAA_NameToGid
+**		GET THE GROUP ID
 ** ON ENTRY:
 **      The group-name
 **
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index 86a3bf9e..e1bba633 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -1244,7 +1244,7 @@ PUBLIC BOOL HTSearch ARGS2(
     CONST char * p, *s, *e;		/* Pointers into keywords */
     char * address = NULL;
     BOOL result;
-    char * escaped = (char *)calloc(1, ((strlen(keywords)*3) + 1));
+    char * escaped = typecallocn(char, (strlen(keywords)*3) + 1);
     static CONST BOOL isAcceptable[96] =
 
     /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */
@@ -1360,10 +1360,10 @@ PUBLIC HTParentAnchor * HTHomeAnchor NOARGS
 	/*
 	**  Someone telnets in, they get a special home.
 	*/
-	FILE * fp = fopen(REMOTE_POINTER, "r");
+	FILE * fp = fopen(REMOTE_POINTER, TXT_R);
 	char * status;
 	if (fp) {
-	    my_home_document = (char*)calloc(1, MAX_FILE_NAME);
+	    my_home_document = typecallocn(char, MAX_FILE_NAME);
 	    if (my_home_document == NULL)
 		outofmem(__FILE__, "HTHomeAnchor");
 	    status = fgets(my_home_document, MAX_FILE_NAME, fp);
@@ -1382,12 +1382,12 @@ PUBLIC HTParentAnchor * HTHomeAnchor NOARGS
 	CONST char * home =  (CONST char*)getenv("HOME");
 	if (home != null) {
 	    HTSprintf0(&my_home_document, "%s/%s", home, PERSONAL_DEFAULT);
-	    fp = fopen(my_home_document, "r");
+	    fp = fopen(my_home_document, TXT_R);
 	}
 
 	if (!fp) {
 	    StrAllocCopy(my_home_document, LOCAL_DEFAULT_FILE);
-	    fp = fopen(my_home_document, "r");
+	    fp = fopen(my_home_document, TXT_R);
 	}
 	if (fp) {
 	    fclose(fp);
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c
index 976679df..8656c4ac 100644
--- a/WWW/Library/Implementation/HTAnchor.c
+++ b/WWW/Library/Implementation/HTAnchor.c
@@ -67,12 +67,11 @@ PRIVATE HTList **adult_table = 0;  /* Point to table of lists of all parents */
 */
 PRIVATE HTParentAnchor * HTParentAnchor_new NOARGS
 {
-    HTParentAnchor *newAnchor =
-       (HTParentAnchor *)calloc(1, sizeof(HTParentAnchor));  /* zero-filled */
+    HTParentAnchor *newAnchor = typecalloc(HTParentAnchor);
     if (newAnchor == NULL)
 	outofmem(__FILE__, "HTParentAnchor_new");
     newAnchor->parent = newAnchor;
-    newAnchor->bookmark = NULL; 	/* Bookmark filename. - FM */
+    newAnchor->bookmark = NULL;		/* Bookmark filename. - FM */
     newAnchor->isISMAPScript = FALSE;	/* Lynx appends ?0,0 if TRUE. - FM */
     newAnchor->isHEAD = FALSE;		/* HEAD request if TRUE. - FM */
     newAnchor->safe = FALSE;		/* Safe. - FM */
@@ -81,9 +80,9 @@ PRIVATE HTParentAnchor * HTParentAnchor_new NOARGS
     newAnchor->source_cache_chunk = NULL;
 #endif
     newAnchor->FileCache = NULL;	/* Path to a disk-cached copy. - FM */
-    newAnchor->SugFname = NULL; 	/* Suggested filename. - FM */
-    newAnchor->RevTitle = NULL; 	/* TITLE for a LINK with REV. - FM */
-    newAnchor->citehost = NULL; 	/* LINK REL=citehost - RDC */
+    newAnchor->SugFname = NULL;		/* Suggested filename. - FM */
+    newAnchor->RevTitle = NULL;		/* TITLE for a LINK with REV. - FM */
+    newAnchor->citehost = NULL;		/* LINK REL=citehost - RDC */
     newAnchor->cache_control = NULL;	/* Cache-Control. - FM */
     newAnchor->no_cache = FALSE;	/* no-cache? - FM */
     newAnchor->content_type = NULL;	/* Content-Type. - FM */
@@ -106,7 +105,7 @@ PRIVATE HTChildAnchor * HTChildAnchor_new NOARGS
 {
     HTChildAnchor *p;
 
-    p = (HTChildAnchor *)calloc(1, sizeof(HTChildAnchor)); /* zero-filled */
+    p = typecalloc(HTChildAnchor);
     if (p == NULL)
 	outofmem(__FILE__, "HTChildAnchor_new");
     return p;
@@ -135,7 +134,7 @@ PRIVATE BOOL HTEquivalent ARGS2(
 	}
 	return( TOUPPER(*s) == TOUPPER(*t));
     } else {
-	return(s == t); 	/* Two NULLs are equivalent, aren't they ? */
+	return(s == t);		/* Two NULLs are equivalent, aren't they ? */
     }
 }
 
@@ -389,7 +388,7 @@ PUBLIC HTAnchor * HTAnchor_findAddress ARGS1(
 	*/
 	hash = HASH_FUNCTION(newdoc->address);
 	if (!adult_table) {
-	    adult_table = (HTList **)calloc(HASH_SIZE, sizeof(HTList *));
+	    adult_table = typecallocn(HTList *, HASH_SIZE);
 	    if (!adult_table)
 		outofmem(__FILE__, "HTAnchor_findAddress");
 #ifdef LY_FIND_LEAKS
@@ -750,7 +749,7 @@ PUBLIC BOOL HTAnchor_delete ARGS1(
 #endif
     if (me->FileCache) {
 	FILE *fd;
-	if ((fd = fopen(me->FileCache, "r")) != NULL) {
+	if ((fd = fopen(me->FileCache, TXT_R)) != NULL) {
 	    fclose(fd);
 	    remove(me->FileCache);
 	}
@@ -885,7 +884,7 @@ PUBLIC HTFormat HTAnchor_format ARGS1(
 
 PUBLIC void HTAnchor_setIndex ARGS2(
 	HTParentAnchor *,	me,
-	char *, 		address)
+	char *,			address)
 {
     if (me) {
 	me->isIndex = YES;
@@ -895,7 +894,7 @@ PUBLIC void HTAnchor_setIndex ARGS2(
 
 PUBLIC void HTAnchor_setPrompt ARGS2(
 	HTParentAnchor *,	me,
-	char *, 		prompt)
+	char *,			prompt)
 {
     if (me) {
 	StrAllocCopy(me->isIndexPrompt, prompt);
@@ -1201,7 +1200,7 @@ PUBLIC BOOL HTAnchor_link ARGS3(
 	source->mainLink.dest = destination;
 	source->mainLink.type = type;
     } else {
-	HTLink * newLink = (HTLink *)calloc (1, sizeof (HTLink));
+	HTLink * newLink = typecalloc(HTLink);
 	if (newLink == NULL)
 	    outofmem(__FILE__, "HTAnchor_link");
 	newLink->dest = destination;
@@ -1256,7 +1255,7 @@ PUBLIC BOOL HTAnchor_makeMainLink ARGS2(
 	return(NO);  /* link not found or NULL anchor */
     } else {
 	/* First push current main link onto top of links list */
-	HTLink *newLink = (HTLink *)calloc (1, sizeof (HTLink));
+	HTLink *newLink = typecalloc(HTLink);
 	if (newLink == NULL)
 	    outofmem(__FILE__, "HTAnchor_makeMainLink");
 	memcpy((void *)newLink,
@@ -1311,7 +1310,7 @@ PUBLIC char * HTAnchor_physical ARGS1(
 
 PUBLIC void HTAnchor_setPhysical ARGS2(
 	HTParentAnchor *,	me,
-	char *, 		physical)
+	char *,			physical)
 {
     if (me) {
 	StrAllocCopy(me->physical, physical);
@@ -1349,8 +1348,7 @@ PUBLIC LYUCcharset * HTAnchor_getUCInfoStage ARGS2(
     if (me && !me->UCStages) {
 	int i;
 	int chndl = UCLYhndl_for_unspec;  /* always >= 0 */
-	UCAnchorInfo * stages = (UCAnchorInfo*)calloc(1,
-						      sizeof(UCAnchorInfo));
+	UCAnchorInfo * stages = typecalloc(UCAnchorInfo);
 	if (stages == NULL)
 	    outofmem(__FILE__, "HTAnchor_getUCInfoStage");
 	for (i = 0; i < UCT_STAGEMAX; i++) {
@@ -1504,7 +1502,7 @@ PUBLIC LYUCcharset * HTAnchor_copyUCInfoStage ARGS4(
 	    if ( me->UCStages->s[to_stage].LYhndl >= 0
 		 && me->UCStages->s[to_stage].LYhndl != ohandle
 		 && to_stage == UCT_STAGE_PARSER )
-		setup_switch_display_charset(me, 
+		setup_switch_display_charset(me,
 					     me->UCStages->s[to_stage].LYhndl);
 #endif
 	    if (p_to != p_from)
diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c
index fc9288da..cce9058c 100644
--- a/WWW/Library/Implementation/HTChunk.c
+++ b/WWW/Library/Implementation/HTChunk.c
@@ -13,7 +13,7 @@
 */
 PUBLIC HTChunk * HTChunkCreate ARGS1 (int,grow)
 {
-    HTChunk * ch = (HTChunk *) calloc(1, sizeof(HTChunk));
+    HTChunk * ch = typecalloc(HTChunk);
     if (ch == NULL)
 	outofmem(__FILE__, "creation of chunk");
 
@@ -25,7 +25,7 @@ PUBLIC HTChunk * HTChunkCreate ARGS1 (int,grow)
 }
 PUBLIC HTChunk * HTChunkCreateMayFail ARGS2 (int,grow, int,failok)
 {
-    HTChunk * ch = (HTChunk *) calloc(1, sizeof(HTChunk));
+    HTChunk * ch = typecalloc(HTChunk);
     if (ch == NULL) {
 	if (!failok) {
 	    outofmem(__FILE__, "creation of chunk");
@@ -46,7 +46,7 @@ PUBLIC HTChunk * HTChunkCreateMayFail ARGS2 (int,grow, int,failok)
 */
 PUBLIC HTChunk * HTChunkCreate2 ARGS2 (int,grow, size_t, needed)
 {
-    HTChunk * ch = (HTChunk *) calloc(1, sizeof(HTChunk));
+    HTChunk * ch = typecalloc(HTChunk);
     if (ch == NULL)
 	outofmem(__FILE__, "HTChunkCreate2");
 
@@ -56,7 +56,7 @@ PUBLIC HTChunk * HTChunkCreate2 ARGS2 (int,grow, size_t, needed)
 	    + ch->growby; /* Round up */
 	CTRACE((tfp, "HTChunkCreate2: requested %d, allocate %d\n",
 	       needed, ch->allocated));
-	ch->data = (char *)calloc(1, ch->allocated);
+	ch->data = typecallocn(char, ch->allocated);
 	if (!ch->data)
 	    outofmem(__FILE__, "HTChunkCreate2 data");
     }
@@ -97,7 +97,7 @@ PUBLIC void HTChunkPutc ARGS2 (HTChunk *,ch, char,c)
 	char *data;
 	ch->allocated = ch->allocated + ch->growby;
 	data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-			: (char *)calloc(1, ch->allocated);
+			: typecallocn(char, ch->allocated);
 	if (data) {
 	    ch->data = data;
 	} else if (ch->failok) {
@@ -120,7 +120,7 @@ PUBLIC void HTChunkEnsure ARGS2 (HTChunk *,ch, int,needed)
     ch->allocated = needed-1 - ((needed-1) % ch->growby)
 			     + ch->growby; /* Round up */
     ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-			: (char *)calloc(1, ch->allocated);
+			: typecallocn(char, ch->allocated);
     if (ch->data == NULL)
 	outofmem(__FILE__, "HTChunkEnsure");
 }
@@ -134,7 +134,7 @@ PUBLIC void HTChunkPutb ARGS3 (HTChunk *,ch, CONST char *,b, int,l)
 	ch->allocated = needed-1 - ((needed-1) % ch->growby)
 	    + ch->growby; /* Round up */
 	data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-			: (char *)calloc(1, ch->allocated);
+			: typecallocn(char, ch->allocated);
 	if (data) {
 	    ch->data = data;
 	} else if (ch->failok) {
@@ -157,7 +157,7 @@ PUBLIC void HTChunkPutUtf8Char ARGS2(
 {
     int utflen;
 
-    if (code < 128)
+    if (TOASCII(code) < 128)
 	utflen = 1;
     else if   (code <     0x800L) {
 	utflen = 2;
@@ -177,7 +177,7 @@ PUBLIC void HTChunkPutUtf8Char ARGS2(
 	int growby = (ch->growby >= utflen) ? ch->growby : utflen;
 	ch->allocated = ch->allocated + growby;
 	data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-			: (char *)calloc(1, ch->allocated);
+			: typecallocn(char, ch->allocated);
 	if (data) {
 	    ch->data = data;
 	} else if (ch->failok) {
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 8f68cf6b..a580925f 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -718,7 +718,7 @@ PRIVATE int get_connection ARGS2(
 	/*
 	**  Allocate and init control struct.
 	*/
-	con = (connection *)calloc(1, sizeof(connection));
+	con = typecalloc(connection);
 	if (con == NULL)
 	    outofmem(__FILE__, "get_connection");
     }
diff --git a/WWW/Library/Implementation/HTFWriter.c b/WWW/Library/Implementation/HTFWriter.c
index b5666b44..b8b0c5d9 100644
--- a/WWW/Library/Implementation/HTFWriter.c
+++ b/WWW/Library/Implementation/HTFWriter.c
@@ -256,7 +256,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3(
     tmpnam (fnam);
     strcat(fnam, suffix);
 
-    me->fp = fopen (fnam, "wb");
+    me->fp = fopen (fnam, BIN_W);
     if (!me->fp) {
 	HTAlert(CANNOT_OPEN_TEMP);
         FREE(fnam);
@@ -333,7 +333,7 @@ PUBLIC HTStream* HTSaveLocally ARGS3(
 
     FREE(fnam);
 
-    me->fp = fopen (answer, "wb");
+    me->fp = fopen (answer, BIN_W);
     if (!me->fp) {
 	HTAlert(CANNOT_OPEN_OUTPUT);
         FREE(answer);
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 0fbbbde7..342a5882 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -472,7 +472,7 @@ PUBLIC void HTSetSuffix5 ARGS5(
 		break;
 	}
 	if (!suff) { /* Not found -- create a new node */
-	    suff = (HTSuffix *) calloc(1, sizeof(HTSuffix));
+	    suff = typecalloc(HTSuffix);
 	    if (suff == NULL)
 		outofmem(__FILE__, "HTSetSuffix");
 
@@ -1301,7 +1301,7 @@ PUBLIC HTStream * HTFileSaveStream ARGS1(
     CONST char * addr = HTAnchor_address((HTAnchor*)anchor);
     char *  localname = HTLocalName(addr);
 
-    FILE* fp = fopen(localname, "wb");
+    FILE* fp = fopen(localname, BIN_W);
     if (!fp)
 	return NULL;
 
@@ -1604,7 +1604,7 @@ PRIVATE void do_readme ARGS2(HTStructured *, target, CONST char *, localname)
 
     HTSprintf0(&readme_file_name, "%s/%s", localname, HT_DIR_README_FILE);
 
-    fp = fopen(readme_file_name,  "r");
+    fp = fopen(readme_file_name,  TXT_R);
 
     if (fp) {
 	HTStructuredClass targetClass;
@@ -1767,13 +1767,14 @@ PRIVATE int print_local_dir ARGS5(
 
 	    StrAllocCat(tmpfilename, dirbuf->d_name);
 	    stat(tmpfilename, &file_info);
-	    if (S_ISDIR(file_info.st_mode))
 #ifndef DIRED_SUPPORT
+	    if (S_ISDIR(file_info.st_mode))
 		HTSprintf0(&dirname, "D%s",dirbuf->d_name);
 	    else
 		HTSprintf0(&dirname, "F%s",dirbuf->d_name);
 		/* D & F to have first directories, then files */
 #else
+	    if (S_ISDIR(file_info.st_mode))
 	    {
 		if (dir_list_style == MIXED_STYLE)
 		    HTSprintf0(&dirname, " %s/", dirbuf->d_name);
@@ -2024,8 +2025,9 @@ PUBLIC int HTStat ARGS2(
      * directory on Windows.
      */
     if (access(temp_name, 0) == 0) {
-	if (stat(temp_name, data) == -1) data->st_mode = S_IFDIR;
-	    result = 0;
+	if (stat(temp_name, data) == -1)
+	    data->st_mode = S_IFDIR;
+	result = 0;
     }
 #else
     result = stat(temp_name, data);
@@ -2092,15 +2094,15 @@ PUBLIC int HTLoadFile ARGS4(
 	strcmp(nodename, HTHostName()) != 0
 #endif /* VMS */
     )) {
+	status = -1;
 	FREE(newname);
 	FREE(filename);
 	FREE(nodename);
 	FREE(acc_method);
 #ifndef DISABLE_FTP
-	return HTFTPLoad(addr, anchor, format_out, sink);
-#else
-	return -1;
+	status = HTFTPLoad(addr, anchor, format_out, sink);
 #endif /* DISABLE_FTP */
+	return status;
     } else {
 	FREE(newname);
 	FREE(acc_method);
@@ -2182,7 +2184,7 @@ PUBLIC int HTLoadFile ARGS4(
 	FILE * fp;
 	char * vmsname = strchr(filename + 1, '/') ?
 		    HTVMS_name(nodename, filename) : filename + 1;
-	fp = fopen(vmsname, "r", "shr=put", "shr=upd");
+	fp = fopen(vmsname, TXT_R, "shr=put", "shr=upd");
 
 	/*
 	**  If the file wasn't VMS syntax, then perhaps it is Ultrix.
@@ -2191,7 +2193,7 @@ PUBLIC int HTLoadFile ARGS4(
 	    char * ultrixname = 0;
 	    CTRACE((tfp, "HTLoadFile: Can't open as %s\n", vmsname));
 	    HTSprintf0(&ultrixname, "%s::\"%s\"", nodename, filename);
-	    fp = fopen(ultrixname, "r", "shr=put", "shr=upd");
+	    fp = fopen(ultrixname, TXT_R, "shr=put", "shr=upd");
 	    if (!fp) {
 		CTRACE((tfp, "HTLoadFile: Can't open as %s\n",
 			    ultrixname));
@@ -2231,7 +2233,7 @@ PUBLIC int HTLoadFile ARGS4(
 		    fclose(fp);
 		    if (semicolon != NULL)
 			*semicolon = ';';
-		    gzfp = gzopen(vmsname, "rb");
+		    gzfp = gzopen(vmsname, BIN_R);
 
 		    CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
 				vmsname, (void*)gzfp));
@@ -2271,7 +2273,7 @@ PUBLIC int HTLoadFile ARGS4(
 			fclose(fp);
 			if (semicolon != NULL)
 			    *semicolon = ';';
-			gzfp = gzopen(vmsname, "rb");
+			gzfp = gzopen(vmsname, BIN_R);
 
 			CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
 				    vmsname, (void*)gzfp));
@@ -2560,12 +2562,8 @@ PUBLIC int HTLoadFile ARGS4(
 */
 #endif /* HAVE_READDIR */
 	{
-#  if defined(__EMX__) || defined(WIN_EX)
 	    int bin = HTCompressFileType(localname, ".", &dot) != cftNone;
-	    FILE * fp = fopen(localname, (bin ? "rb" : "r"));
-#  else	/* !( defined __EMX__ ) */
-	    FILE * fp = fopen(localname, "r");
-#  endif
+	    FILE * fp = fopen(localname, (bin ? BIN_R : TXT_R));
 
 	    CTRACE((tfp, "HTLoadFile: Opening `%s' gives %p\n",
 				 localname, (void*)fp));
@@ -2591,7 +2589,7 @@ PUBLIC int HTLoadFile ARGS4(
 			(!strcmp(HTAtom_name(myEncoding), "gzip") ||
 			 !strcmp(HTAtom_name(myEncoding), "x-gzip"))) {
 			fclose(fp);
-			gzfp = gzopen(localname, "rb");
+			gzfp = gzopen(localname, BIN_R);
 
 			CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
 				    localname, (void*)gzfp));
@@ -2628,7 +2626,7 @@ PUBLIC int HTLoadFile ARGS4(
 #ifdef USE_ZLIB
 			if (strcmp(format_out->name, "www/download") != 0) {
 			    fclose(fp);
-			    gzfp = gzopen(localname, "rb");
+			    gzfp = gzopen(localname, BIN_R);
 
 			    CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
 					localname, (void*)gzfp));
@@ -2707,18 +2705,17 @@ PUBLIC int HTLoadFile ARGS4(
 	if (strcmp(nodename, HTHostName()) != 0)
 #endif /* VMS */
 	{
+	    status = -1;
 	    FREE(nodename);
-	    if (!strncmp(addr, "file://localhost", 16)) {
-		return -1;  /* never go to ftp site when URL
-			     * is file://localhost
-			     */
-	    } else {
+	    if (strncmp(addr, "file://localhost", 16)) {
+		/* never go to ftp site when URL
+		 * is file://localhost
+		 */
 #ifndef DISABLE_FTP
-		return HTFTPLoad(addr, anchor, format_out, sink);
-#else
-		return -1;
+		status = HTFTPLoad(addr, anchor, format_out, sink);
 #endif /* DISABLE_FTP */
 	    }
+	    return status;
 	}
 	FREE(nodename);
     }
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 33940a63..96681e66 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -1028,7 +1028,7 @@ PRIVATE int parse_cso_fields ARGS2(
 			**  Initialize new block, append to end of list
 			**  to preserve order.
 			*/
-			new = (CSOfield_info *)calloc(1, sizeof(CSOfield_info));
+			new = typecalloc(CSOfield_info);
 			if (!new) {
 			    outofmem(__FILE__, "HTLoadCSO");
 			}
diff --git a/WWW/Library/Implementation/HTGroup.c b/WWW/Library/Implementation/HTGroup.c
index 341099bf..2b16599f 100644
--- a/WWW/Library/Implementation/HTGroup.c
+++ b/WWW/Library/Implementation/HTGroup.c
@@ -48,6 +48,7 @@
 #include <HTLex.h>	/* Lexical analysor	*/
 #include <HTGroup.h>	/* Implemented here	*/
 
+#include <LYUtils.h>
 #include <LYLeaks.h>
 
 /*
@@ -107,7 +108,7 @@ PRIVATE AddressDefList *parse_address_part ARGS1(FILE *, fp)
     address_def_list = HTList_new();
 
     for(;;) {
-	Ref *ref = (Ref*)calloc(1, sizeof(Ref));
+	Ref *ref = typecalloc(Ref);
 	if (ref == NULL)
 	    outofmem(__FILE__, "parse_address_part");
 	ref->name = NULL;
@@ -163,7 +164,7 @@ PRIVATE UserDefList *parse_user_part ARGS1(FILE *, fp)
     user_def_list = HTList_new();
 
     for (;;) {
-	Ref *ref = (Ref*)calloc(1, sizeof(Ref));
+	Ref *ref = typecalloc(Ref);
 	if (ref == NULL)
 	    outofmem(__FILE__, "parse_user_part");
 	ref->name = NULL;
@@ -238,7 +239,7 @@ PRIVATE Item *parse_item ARGS1(FILE *, fp)
 	syntax_error(fp, "Empty item not allowed", lex_item);
 	return NULL;
     }
-    item = (Item*)calloc(1, sizeof(Item));
+    item = typecalloc(Item);
     if (item == NULL)
 	outofmem(__FILE__, "parse_item");
     item->user_def_list = user_def_list;
@@ -287,7 +288,7 @@ PUBLIC GroupDef *HTAA_parseGroupDef ARGS1(FILE *, fp)
     if (!(item_list = parse_item_list(fp))) {
 	return NULL;
     }
-    group_def = (GroupDef*)calloc(1, sizeof(GroupDef));
+    group_def = typecalloc(GroupDef);
     if (group_def == NULL)
 	outofmem(__FILE__, "HTAA_parseGroupDef");
     group_def->group_name = NULL;
@@ -671,14 +672,14 @@ PUBLIC GroupDefList *HTAA_readGroupFile ARGS1(CONST char *, filename)
     CTRACE((tfp, "HTAA_readGroupFile: reading group file `%s'\n",
 		filename));
 
-    if (!(fp = fopen(filename, "r"))) {
+    if (!(fp = fopen(filename, TXT_R))) {
 	CTRACE((tfp, "%s '%s'\n",
 		    "HTAA_readGroupFile: unable to open group file",
 		    filename));
 	return NULL;
     }
 
-    if (!(group_cache = (GroupCache*)calloc(1, sizeof(GroupCache))))
+    if ((group_cache = typecalloc(GroupCache)) == 0)
 	outofmem(__FILE__, "HTAA_readGroupFile");
 
     group_cache->group_filename = NULL;
diff --git a/WWW/Library/Implementation/HTList.c b/WWW/Library/Implementation/HTList.c
index b49c6e58..90871f90 100644
--- a/WWW/Library/Implementation/HTList.c
+++ b/WWW/Library/Implementation/HTList.c
@@ -17,8 +17,8 @@ PUBLIC HTList * HTList_new NOARGS
 {
     HTList *newList;
 
-    if ((newList = (HTList *)calloc(1, sizeof(HTList))) == NULL)
-        outofmem(__FILE__, "HTList_new");
+    if ((newList = typecalloc(HTList)) == NULL)
+	outofmem(__FILE__, "HTList_new");
 
     newList->object = NULL;
     newList->next = NULL;
@@ -71,9 +71,9 @@ PUBLIC HTList * HTList_appendList ARGS2(
     HTList * temp = start;
 
     if (!start) {
-        CTRACE((tfp, "HTList: Trying to append list %p to a nonexisting list\n",
+	CTRACE((tfp, "HTList: Trying to append list %p to a nonexisting list\n",
 		    tail));
-        return NULL;
+	return NULL;
     }
     if (!(tail && tail->next))
 	return start;
@@ -96,14 +96,14 @@ PUBLIC void HTList_addObject ARGS2(
     HTList *newNode;
 
     if (me) {
-        if ((newNode = (HTList *)calloc(1, sizeof(HTList))) == NULL)
+	if ((newNode = typecalloc(HTList)) == NULL)
 	    outofmem(__FILE__, "HTList_addObject");
 	newNode->object = newObject;
 	newNode->next = me->next;
 	me->next = newNode;
 
     } else {
-        CTRACE((tfp, "HTList: Trying to add object %p to a nonexisting list\n",
+	CTRACE((tfp, "HTList: Trying to add object %p to a nonexisting list\n",
 		    newObject));
     }
 
@@ -157,19 +157,19 @@ PUBLIC void HTList_insertObjectAt ARGS3(
     prevNode = temp;
     while ((temp = temp->next)) {
 	if (Pos == 0) {
-	    if ((newNode = (HTList *)calloc(1, sizeof(HTList))) == NULL)
-	        outofmem(__FILE__, "HTList_addObjectAt");
+	    if ((newNode = typecalloc(HTList)) == NULL)
+		outofmem(__FILE__, "HTList_addObjectAt");
 	    newNode->object = newObject;
 	    newNode->next = temp;
 	    if (prevNode)
-	        prevNode->next = newNode;
+		prevNode->next = newNode;
 	    return;
 	}
 	prevNode = temp;
 	Pos--;
     }
     if (Pos >= 0)
-        HTList_addObject(prevNode, newObject);
+	HTList_addObject(prevNode, newObject);
 
     return;
 }
@@ -189,7 +189,7 @@ PUBLIC BOOL HTList_removeObject ARGS2(
 	    prevNode = temp;
 	    temp = temp->next;
 	    if (temp->object == oldObject) {
-	        prevNode->next = temp->next;
+		prevNode->next = temp->next;
 		FREE (temp);
 		return YES;  /* Success */
 	    }
@@ -241,14 +241,14 @@ PUBLIC void * HTList_removeLastObject ARGS1(
     void * lastObject;
 
     if (me && me->next) {
-        lastNode = me->next;
+	lastNode = me->next;
 	lastObject = lastNode->object;
 	me->next = lastNode->next;
 	FREE (lastNode);
 	return lastObject;
 
     } else {  /* Empty list */
-        return NULL;
+	return NULL;
     }
 }
 
@@ -264,7 +264,7 @@ PUBLIC void * HTList_removeFirstObject ARGS1(
     void *firstObject;
 
     if (!temp)
-        return NULL;
+	return NULL;
 
     prevNode = temp;
     if (temp->next) {
@@ -278,7 +278,7 @@ PUBLIC void * HTList_removeFirstObject ARGS1(
 	return firstObject;
 
     } else {  /* Empty list */
-        return NULL;
+	return NULL;
     }
 }
 
@@ -293,7 +293,7 @@ PUBLIC int HTList_count ARGS1(
     int count = 0;
 
     if (temp)
-        while ((temp = temp->next))
+	while ((temp = temp->next))
 	    count++;
 
     return count;
@@ -313,7 +313,7 @@ PUBLIC int HTList_indexOf ARGS2(
     if (temp) {
 	while ((temp = temp->next)) {
 	    if (temp->object == object)
-	        return position;
+		return position;
 	    position++;
 	}
     }
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index c0b0e89b..2d0fb371 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -100,12 +100,12 @@ typedef enum _MIME_state {
 	miJUNK_LINE,		/* Ignore the rest of this folded line */
 	miNEWLINE,		/* Just found a LF .. maybe continuation */
 	miCHECK,		/* check against check_pointer */
-	MIME_NET_ASCII, 	/* Translate from net ascii */
+	MIME_NET_ASCII,		/* Translate from net ascii */
 	MIME_IGNORE		/* Ignore entire file */
 	/* TRANSPARENT and IGNORE are defined as stg else in _WINDOWS */
 } MIME_state;
 
-#define VALUE_SIZE 5120 	/* @@@@@@@ Arbitrary? */
+#define VALUE_SIZE 5120		/* @@@@@@@ Arbitrary? */
 struct _HTStream {
 	CONST HTStreamClass *	isa;
 
@@ -122,7 +122,7 @@ struct _HTStream {
 	char *			value_pointer;	/* storing values */
 	char			value[VALUE_SIZE];
 
-	HTParentAnchor *	anchor; 	/* Given on creation */
+	HTParentAnchor *	anchor;		/* Given on creation */
 	HTStream *		sink;		/* Given on creation */
 
 	char *			boundary;	/* For multipart */
@@ -132,8 +132,8 @@ struct _HTStream {
 
 	HTFormat		encoding;	/* Content-Transfer-Encoding */
 	char *			compression_encoding;
-	HTFormat		format; 	/* Content-Type */
-	HTStream *		target; 	/* While writing out */
+	HTFormat		format;		/* Content-Type */
+	HTStream *		target;		/* While writing out */
 	HTStreamClass		targetClass;
 
 	HTAtom *		targetRep;	/* Converting into? */
@@ -147,7 +147,7 @@ struct _HTStream {
 **  first and last characters are double-quotes. - FM
 */
 PUBLIC void HTMIME_TrimDoubleQuotes ARGS1(
-	char *, 	value)
+	char *,		value)
 {
     int i;
     char *cp = value;
@@ -1187,7 +1187,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 	} /* switch on character */
 	break;
 
-    case miCON: 			/* Check for 'n' or 't' */
+    case miCON:				/* Check for 'n' or 't' */
 	switch (c) {
 	case 'n':
 	case 'N':
@@ -1707,7 +1707,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 
     case miGET_VALUE:
     GET_VALUE:
-    	if (c != '\n') {			/* Not end of line */
+	if (c != '\n') {			/* Not end of line */
 	    if (me->value_pointer < me->value + VALUE_SIZE - 1) {
 		*me->value_pointer++ = c;
 		break;
@@ -1732,7 +1732,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 value_too_long:
     CTRACE((tfp, "HTMIME: *** Syntax error. (string too long)\n"));
 
-bad_field_name: 			/* Ignore it */
+bad_field_name:				/* Ignore it */
     me->state = miJUNK_LINE;
     return;
 
@@ -1841,7 +1841,7 @@ PUBLIC HTStream* HTMIMEConvert ARGS3(
 {
     HTStream* me;
 
-    me = (HTStream *)calloc(1, sizeof(*me));
+    me = typecalloc(HTStream);
     if (me == NULL)
 	outofmem(__FILE__, "HTMIMEConvert");
     me->isa	=	&HTMIME;
@@ -1983,8 +1983,8 @@ PRIVATE char HTmmquote[] = "0123456789ABCDEF";
 PRIVATE int HTmmcont = 0;
 
 PUBLIC void HTmmdec_base64 ARGS2(
-	char *, 	t,
-	char *, 	s)
+	char *,		t,
+	char *,		s)
 {
     int   d, count, j, val;
     char  buf[LINE_LENGTH], *bp, nw[4], *p;
@@ -2022,8 +2022,8 @@ PUBLIC void HTmmdec_base64 ARGS2(
 }
 
 PUBLIC void HTmmdec_quote ARGS2(
-	char *, 	t,
-	char *, 	s)
+	char *,		t,
+	char *,		s)
 {
     char  buf[LINE_LENGTH], cval, *bp, *p;
 
@@ -2059,8 +2059,8 @@ PUBLIC void HTmmdec_quote ARGS2(
 **	HTmmdecode for ISO-2022-JP - FM
 */
 PUBLIC void HTmmdecode ARGS2(
-	char *, 	trg,
-	char *, 	str)
+	char *,		trg,
+	char *,		str)
 {
     char buf[LINE_LENGTH], mmbuf[LINE_LENGTH];
     char *s, *t, *u;
@@ -2124,8 +2124,8 @@ end:
 **  (The author of this function "rjis" is S. Ichikawa.)
 */
 PUBLIC int HTrjis ARGS2(
-	char *, 	t,
-	char *, 	s)
+	char *,		t,
+	char *,		s)
 {
     char *p, buf[LINE_LENGTH];
     int kanji = 0;
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index b404733b..19be48c8 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -209,7 +209,7 @@ PRIVATE BOOL initialize NOARGS
 		    HTNewsHost));
     } else {
 	char server_name[256];
-	FILE* fp = fopen(SERVER_FILE, "r");
+	FILE* fp = fopen(SERVER_FILE, TXT_R);
 	if (fp) {
 	    if (fscanf(fp, "%s", server_name)==1) {
 		StrAllocCopy(HTNewsHost, server_name);
@@ -407,8 +407,7 @@ PRIVATE NNTPAuthResult HTHandleAuthInfo ARGS1(
 		/*
 		**  Store the accepted username and no password. - FM
 		*/
-		if ((auth =
-		    (NNTPAuth *)calloc(1, sizeof(NNTPAuth))) != NULL) {
+		if ((auth = typecalloc(NNTPAuth)) != NULL) {
 		    StrAllocCopy(auth->host, host);
 		    auth->user = UserName;
 		    HTList_appendObject(NNTP_AuthInfo, auth);
@@ -515,8 +514,7 @@ PRIVATE NNTPAuthResult HTHandleAuthInfo ARGS1(
 			auth->pass = PassWord;
 		    }
 		} else {
-		    if ((auth =
-			(NNTPAuth *)calloc(1, sizeof(NNTPAuth))) != NULL) {
+		    if ((auth = typecalloc(NNTPAuth)) != NULL) {
 			StrAllocCopy(auth->host, host);
 			auth->user = UserName;
 			auth->pass = PassWord;
@@ -847,12 +845,7 @@ PRIVATE void post_article ARGS1(
     **	Open the temporary file with the
     **	nntp headers and message body. - FM
     */
-#ifdef DOSPATH
-    if ((fd = fopen((postfile ? postfile : ""), "rt")) == NULL)
-#else
-    if ((fd = fopen((postfile ? postfile : ""), "r")) == NULL)
-#endif
-    {
+    if ((fd = fopen((postfile ? postfile : ""), TXT_R)) == NULL) {
 	HTAlert(FAILED_CANNOT_OPEN_POST);
 	return;
     }
@@ -970,12 +963,6 @@ void debug_print(unsigned char *p)
 }
 #endif
 
-#ifdef NOTUSED_CHARTRANS
-static char *decode_mime(char *str)
-{
-    return HTmmdecode(str, str);
-}
-#else
 static char *decode_mime(char *str)
 {
     char temp[LINE_LENGTH];	/* FIXME: what determines the actual size? */
@@ -1006,17 +993,12 @@ static char *decode_mime(char *str)
 
     return str;
 }
-#endif /* NOTUSED_CHARTRANS */
 #else /* !SH_EX */
 static char *decode_mime ARGS1(char *, str)
 {
-#ifdef NOTUSED_CHARTRANS
-    return HTmmdecode(str, str);
-#else
     HTmmdecode(str, str);
     HTrjis(str, str);
     return str;
-#endif
 }
 #endif
 
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index c7255995..b5112341 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -19,7 +19,7 @@ struct struct_parts {
 };
 
 
-/*	Strip white space off a string. 			HTStrip()
+/*	Strip white space off a string.				HTStrip()
 **	-------------------------------
 **
 ** On exit,
@@ -27,7 +27,7 @@ struct struct_parts {
 **	All trailing white space is OVERWRITTEN with zero.
 */
 PUBLIC char * HTStrip ARGS1(
-	char *, 	s)
+	char *,		s)
 {
 #define SPACE(c) ((c == ' ') || (c == '\t') || (c == '\n'))
     char * p = s;
@@ -55,7 +55,7 @@ PUBLIC char * HTStrip ARGS1(
 **	Any which are nonzero point to zero terminated strings.
 */
 PRIVATE void scan ARGS2(
-	char *, 		name,
+	char *,			name,
 	struct struct_parts *,	parts)
 {
     char * after_access;
@@ -178,7 +178,7 @@ PRIVATE void scan ARGS2(
 **	wanted		A mask for the bits which are wanted.
 **
 ** On exit,
-**	returns 	A pointer to a calloc'd string which MUST BE FREED
+**	returns		A pointer to a calloc'd string which MUST BE FREED
 */
 PUBLIC char * HTParse ARGS3(
 	CONST char *,	aName,
@@ -208,7 +208,7 @@ PUBLIC char * HTParse ARGS3(
     **	Allocate the output string.
     */
     len = strlen(aName) + strlen(relatedName) + 10;
-    result = (char *)calloc(1, len);	/* Lots of space: more than enough */
+    result = typecallocn(char, len);	/* Lots of space: more than enough */
     if (result == NULL) {
 	outofmem(__FILE__, "HTParse");
     }
@@ -484,7 +484,7 @@ PUBLIC char * HTParse ARGS3(
 **	or	../../albert.html
 */
 PUBLIC void HTSimplify ARGS1(
-	char *, 	filename)
+	char *,		filename)
 {
     char *p;
     char *q, *q1;
@@ -682,7 +682,7 @@ PUBLIC char * HTRelative ARGS2(
 	for (; *q && (*q != '#'); q++)
 	    if (*q == '/')
 		levels++;
-	result = (char *)calloc(1, (3*levels + strlen(last_slash) + 1));
+	result = typecallocn(char, 3*levels + strlen(last_slash) + 1);
 	if (result == NULL)
 	    outofmem(__FILE__, "HTRelative");
 	result[0] = '\0';
@@ -691,7 +691,7 @@ PUBLIC char * HTRelative ARGS2(
 	strcat(result, last_slash+1);
     }
     CTRACE((tfp,
-        "HTparse: `%s' expressed relative to\n   `%s' is\n   `%s'.\n",
+	"HTparse: `%s' expressed relative to\n	 `%s' is\n   `%s'.\n",
 		aName, relatedName, result));
     return result;
 }
@@ -709,7 +709,7 @@ PUBLIC char * HTRelative ARGS2(
 PRIVATE CONST unsigned char isAcceptable[96] =
 
 /*	Bit 0		xalpha		-- see HTFile.h
-**	Bit 1		xpalpha 	-- as xalpha but with plus.
+**	Bit 1		xpalpha		-- as xalpha but with plus.
 **	Bit 3 ...	path		-- as xpalphas but with /
 */
     /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */
@@ -734,7 +734,7 @@ PUBLIC char * HTEscape ARGS2(
     for (p = str; *p; p++)
 	if (!ACCEPTABLE(UCH(TOASCII(*p))))
 	    unacceptable++;
-    result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1));
+    result = typecallocn(char, p-str + unacceptable + unacceptable + 1);
     if (result == NULL)
 	outofmem(__FILE__, "HTEscape");
     for (q = result, p = str; *p; p++) {
@@ -772,7 +772,7 @@ PUBLIC char * HTEscapeSP ARGS2(
     for (p = str; *p; p++)
 	if (!(*p == ' ' || ACCEPTABLE(UCH(TOASCII(*p)))))
 	    unacceptable++;
-    result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1));
+    result = typecallocn(char, p-str + unacceptable + unacceptable + 1);
     if (result == NULL)
 	outofmem(__FILE__, "HTEscape");
     for (q = result, p = str; *p; p++) {
@@ -808,7 +808,7 @@ PRIVATE char from_hex ARGS1(
 }
 
 PUBLIC char * HTUnEscape ARGS1(
-	char *, 	str)
+	char *,		str)
 {
     char * p = str;
     char * q = str;
@@ -856,7 +856,7 @@ PUBLIC char * HTUnEscape ARGS1(
 **	The first string is converted in place, as it will never grow.
 */
 PUBLIC char * HTUnEscapeSome ARGS2(
-	char *, 	str,
+	char *,		str,
 	CONST char *,	do_trans)
 {
     char * p = str;
@@ -889,7 +889,7 @@ PUBLIC char * HTUnEscapeSome ARGS2(
 PRIVATE CONST unsigned char crfc[96] =
 
 /*	Bit 0		xalpha		-- need "quoting"
-**	Bit 1		xpalpha 	-- need \escape if quoted
+**	Bit 1		xpalpha		-- need \escape if quoted
 */
     /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */
     {	 1,0,3,0,0,0,0,0,1,1,0,0,1,0,1,0,	/* 2x	!"#$%&'()*+,-./  */
@@ -930,7 +930,7 @@ PUBLIC void HTMake822Word ARGS1(
     }
     if (!added)
 	return;
-    result = (char *)calloc(1, (p-(*str) + added + 1));
+    result = typecallocn(char, p-(*str) + added + 1);
     if (result == NULL)
 	outofmem(__FILE__, "HTMake822Word");
     result[0] = '"';
diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c
index def5f7dd..f2b3432e 100644
--- a/WWW/Library/Implementation/HTRules.c
+++ b/WWW/Library/Implementation/HTRules.c
@@ -69,11 +69,11 @@ PRIVATE rule * rule_tail = 0;	/* Pointer to last on list */
 **	--------------------
 **
 **  On entry,
-**	pattern 	points to 0-terminated string containing a single "*"
+**	pattern		points to 0-terminated string containing a single "*"
 **	equiv		points to the equivalent string with * for the
 **			place where the text matched by * goes.
 **  On exit,
-**	returns 	0 if success, -1 if error.
+**	returns		0 if success, -1 if error.
 */
 
 PUBLIC int HTAddRule ARGS5(
@@ -86,7 +86,7 @@ PUBLIC int HTAddRule ARGS5(
     rule *	temp;
     char *	pPattern = NULL;
 
-    temp = (rule *)calloc(1, sizeof(*temp));
+    temp = typecalloc(rule);
     if (temp==NULL)
 	outofmem(__FILE__, "HTAddRule");
     if (equiv) {		/* Two operands */
@@ -135,7 +135,7 @@ PUBLIC int HTAddRule ARGS5(
 }
 
 
-/*	Clear all rules 					HTClearRules()
+/*	Clear all rules						HTClearRules()
 **	---------------
 **
 ** On exit,
@@ -194,7 +194,7 @@ PRIVATE BOOL rule_cond_ok ARGS1(
 ** On entry,
 **	required	points to a string whose equivalent value is neeed
 ** On exit,
-**	returns 	the address of the equivalent string allocated from
+**	returns		the address of the equivalent string allocated from
 **			the heap which the CALLER MUST FREE. If no translation
 **			occured, then it is a copy of te original.
 ** NEW FEATURES:
@@ -332,11 +332,11 @@ char * HTTranslate ARGS1(
 				   r->equiv,
 				   m,
 				   q,
-				   ins + 1); 	
+				   ins + 1);
 			CTRACE((tfp, "For `%s' using `%s'\n",
 				    current, temp));
 			FREE(current);
-			current = temp; 		/* Use this */
+			current = temp;			/* Use this */
 
 		    } else {	/* No insertion point */
 			char * temp = NULL;
@@ -345,7 +345,7 @@ char * HTTranslate ARGS1(
 			CTRACE((tfp, "For `%s' using `%s'\n",
 						current, temp));
 			FREE(current);
-			current = temp; 		/* Use this */
+			current = temp;			/* Use this */
 		    } /* If no insertion point exists */
 		}
 		if (r->op == HT_Pass) {
@@ -475,7 +475,7 @@ PUBLIC int  HTSetConfiguration ARGS1(
 	HTSetPresentation(word2, word3,
 		    status >= 1 ? quality		: 1.0,
 		    status >= 2 ? secs			: 0.0,
-		    status >= 3 ? secs_per_byte 	: 0.0,
+		    status >= 3 ? secs_per_byte		: 0.0,
 		    status >= 4 ? maxbytes		: 0 );
 
     } else if (0==strncasecomp(word1, "htbin", 5) ||
@@ -619,7 +619,7 @@ PUBLIC int  HTSetConfiguration ARGS1(
 ** On exit,
 **	Any existing rules will have been kept.
 **	Any new rules will have been loaded.
-**	Returns 	0 if no error, 0 if error!
+**	Returns		0 if no error, 0 if error!
 **
 ** Bugs:
 **	The strings may not contain spaces.
@@ -628,7 +628,7 @@ PUBLIC int  HTSetConfiguration ARGS1(
 int HTLoadRules ARGS1(
     CONST char *,	filename)
 {
-    FILE * fp = fopen(filename, "r");
+    FILE * fp = fopen(filename, TXT_R);
     char line[LINE_LENGTH+1];
 
     if (!fp) {
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index 09d37f8c..fce10c6f 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -1087,7 +1087,7 @@ PUBLIC void HTSABCat ARGS3(
 	    int length = t->len;
 	    t->str = (char *)realloc(t->str, length + len);
 	} else {
-	    t = (bstring *)calloc(1, sizeof(*t));
+	    t = typecalloc(bstring);
 	    if (t == NULL)
 		outofmem(__FILE__, "HTSACat");
 	    t->str = (char *)malloc(len);
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index 93c1b18d..fca17ea5 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -126,9 +126,7 @@ static unsigned long _fork_func (void *arglist)
 **  A routine to mimic the ioctl function for UCX.
 **  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
 */
-#include <iodef.h>
-#define IOC_OUT (int)0x40000000
-extern int vaxc$get_sdc(), sys$qiow();
+#include <HTioctl.h>
 
 PUBLIC int HTioctl ARGS3(
 	int,		d,
@@ -152,9 +150,6 @@ PUBLIC int HTioctl ARGS3(
 	set_errno(EBADF);
 	return -1;
     }
-#ifndef UCX$C_IOCTL
-#define UCX$C_IOCTL TCPIP$C_IOCTL
-#endif
     ioctl_desc.opt  = UCX$C_IOCTL;
     ioctl_desc.len  = sizeof(struct comm);
     ioctl_desc.addr = &ioctl_comm;
@@ -191,6 +186,7 @@ PUBLIC int HTioctl ARGS3(
 PUBLIC int HTInetStatus ARGS1(
 	char *,		where)
 {
+    int status;
     int saved_errno = errno;
 #ifdef VMS
 #ifdef MULTINET
@@ -246,13 +242,14 @@ PUBLIC int HTInetStatus ARGS1(
     **	uerrno and errno happen to be zero if vmserrno <> 0
     */
 #ifdef MULTINET
-    return -vmserrno;
+    status = -vmserrno;
 #else
-    return -vaxc$errno;
+    status = -vaxc$errno;
 #endif /* MULTINET */
 #else
-    return -SOCKET_ERRNO;
+    status = -SOCKET_ERRNO;
 #endif /* VMS */
+    return status;
 }
 
 /*	Parse a cardinal value				       parse_cardinal()
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 51c57e9b..5e72f253 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -1,4 +1,4 @@
-/*	HyperText Tranfer Protocol	- Client implementation 	HTTP.c
+/*	HyperText Tranfer Protocol	- Client implementation		HTTP.c
 **	==========================
 ** Modified:
 ** 27 Jan 1994	PDM  Added Ari Luotonen's Fix for Reload when using proxy
@@ -350,16 +350,16 @@ PRIVATE int HTLoadHTTP ARGS4 (
 {
   int s;			/* Socket number for returned data */
   CONST char *url = arg;	/* The URL which get_physical() returned */
-  char *command = NULL; 	/* The whole command */
+  char *command = NULL;		/* The whole command */
   char *eol;			/* End of line if found */
   char *start_of_data;		/* Start of body of reply */
   int status;			/* tcp return */
   int bytes_already_read;
-  char crlf[3]; 		/* A CR LF equivalent string */
+  char crlf[3];			/* A CR LF equivalent string */
   HTStream *target;		/* Unconverted data */
   HTFormat format_in;		/* Format arriving in the message */
-  BOOL do_head = FALSE; 	/* Whether or not we should do a head */
-  BOOL do_post = FALSE; 	/* ARE WE posting ? */
+  BOOL do_head = FALSE;		/* Whether or not we should do a head */
+  BOOL do_post = FALSE;		/* ARE WE posting ? */
   char *METHOD;
 
   BOOL had_header;		/* Have we had at least one header? */
@@ -372,7 +372,7 @@ PRIVATE int HTLoadHTTP ARGS4 (
   BOOL first_Accept = TRUE;
   BOOL show_401 = FALSE;
   BOOL show_407 = FALSE;
-  BOOL auth_proxy = NO; 	/* Generate a proxy authorization. - AJL */
+  BOOL auth_proxy = NO;		/* Generate a proxy authorization. - AJL */
 
   int length, rawlength, rv;
   int server_status;
@@ -455,12 +455,13 @@ try_again:
   line_buffer = NULL;
   line_kept_clean = NULL;
 
-  if (!strncmp(url, "https", 5))
 #ifdef USE_SSL
+  if (!strncmp(url, "https", 5))
     status = HTDoConnect (url, "HTTPS", HTTPS_PORT, &s);
   else
     status = HTDoConnect (url, "HTTP", HTTP_PORT, &s);
 #else
+  if (!strncmp(url, "https", 5))
     {
       HTAlert(gettext("This client does not contain support for HTTPS URLs."));
       status = HT_NOT_LOADED;
@@ -521,7 +522,7 @@ use_tunnel:
 	      try_tls = FALSE;
 	      if (did_connect)
 		  HTTP_NETCLOSE(s, handle);
-      	      goto try_again;
+	      goto try_again;
 	  } else {
 	      unsigned long SSLerror;
 	      CTRACE((tfp,
@@ -531,11 +532,11 @@ use_tunnel:
 	      while((SSLerror=ERR_get_error())!=0) {
 		  CTRACE((tfp,"HTTP: SSL: %s\n",ERR_error_string(SSLerror,NULL)));
 	      }
-      	      HTAlert("Unable to make secure connection to remote host.");
+	      HTAlert("Unable to make secure connection to remote host.");
 	      if (did_connect)
 		  HTTP_NETCLOSE(s, handle);
-      	      status = HT_NOT_LOADED;
-      	      goto done;
+	      status = HT_NOT_LOADED;
+	      goto done;
 	  }
 #else
 	  unsigned long SSLerror;
@@ -546,11 +547,11 @@ use_tunnel:
 	  while((SSLerror=ERR_get_error())!=0) {
 	      CTRACE((tfp,"HTTP: SSL: %s\n",ERR_error_string(SSLerror,NULL)));
 	  }
-      	  HTAlert("Unable to make secure connection to remote host.");
+	  HTAlert("Unable to make secure connection to remote host.");
 	  if (did_connect)
 	      HTTP_NETCLOSE(s, handle);
-      	  status = HT_NOT_LOADED;
-      	  goto done;
+	  status = HT_NOT_LOADED;
+	  goto done;
 #endif /* SSLEAY_VERSION_NUMBER >= 0x0900 */
       }
       sprintf(SSLprogress,"Secure %d-bit %s (%s) HTTP connection",SSL_get_cipher_bits(handle,NULL),SSL_get_cipher_version(handle),SSL_get_cipher(handle));
@@ -558,13 +559,13 @@ use_tunnel:
 
 #ifdef NOTDEFINED
       if (strcmp(HTParse(url, "", PARSE_HOST),
-      		 strstr(X509_NAME_oneline(
-		 	X509_get_subject_name(
+		 strstr(X509_NAME_oneline(
+			X509_get_subject_name(
 				handle->session->peer)),"/CN=")+4)) {
 	  HTAlert("Certificate is for different host name");
 	  HTAlert(strstr(X509_NAME_oneline(
-	  		 X509_get_subject_name(
-			 	handle->session->peer)),"/CN=")+4);
+			 X509_get_subject_name(
+				handle->session->peer)),"/CN=")+4);
       }
 #endif /* NOTDEFINED */
   }
@@ -1056,7 +1057,7 @@ use_tunnel:
     BOOL end_of_file = NO;
     int buffer_length = INIT_LINE_SIZE;
 
-    line_buffer = (char *)calloc(1, (buffer_length * sizeof(char)));
+    line_buffer = typecallocn(char, buffer_length);
     if (line_buffer == NULL)
 	outofmem(__FILE__, "HTLoadHTTP");
 
@@ -1214,13 +1215,13 @@ use_tunnel:
     if (http_error_file) {     /* Make the status code externally available */
 	FILE *error_file;
 #ifdef SERVER_STATUS_ONLY
-	error_file = fopen(http_error_file, "w");
+	error_file = fopen(http_error_file, TXT_W);
 	if (error_file) {		/* Managed to open the file */
 	    fprintf(error_file, "error=%d\n", server_status);
 	    fclose(error_file);
 	}
 #else
-	error_file = fopen(http_error_file, "a");
+	error_file = fopen(http_error_file, TXT_A);
 	if (error_file) {		/* Managed to open the file */
 	    fprintf(error_file, "   URL=%s (%s)\n", url, METHOD);
 	    fprintf(error_file, "STATUS=%s\n", line_buffer);
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 9f153265..d387e2bd 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -486,6 +486,7 @@ The local equivalents of CR and LF
 #ifdef NO_LYNX_TRACE
 #define WWW_TraceFlag   0
 #define WWW_TraceMask   0
+#define LYTraceLogFP    0
 #else
 extern BOOLEAN WWW_TraceFlag;
 extern unsigned WWW_TraceMask;
@@ -496,8 +497,14 @@ extern unsigned WWW_TraceMask;
 #define TRACE_STYLE     (TRACE_bit(1))
 #define TRACE_TRST      (TRACE_bit(2))
 
-#define CTRACE(p)          if (TRACE) fprintf p
-#define CTRACE2(m,p)       if (m)     fprintf p
+#if defined(LY_TRACELINE)
+#define LY_SHOWWHERE fprintf( tfp, "%s: %d: ", __FILE__, LY_TRACELINE );
+#else
+#define LY_SHOWWHERE /* nothing */
+#endif
+
+#define CTRACE(p)          if (TRACE) { LY_SHOWWHERE fprintf p; }
+#define CTRACE2(m,p)       if (m)     { LY_SHOWWHERE fprintf p; }
 #define tfp TraceFP()
 #define CTRACE_SLEEP(secs) if (TRACE && LYTraceLogFP == 0) sleep(secs)
 #define CTRACE_FLUSH(fp)   if (TRACE) fflush(fp)
diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c
index a83bdce3..d7019411 100644
--- a/WWW/Library/Implementation/HTVMSUtils.c
+++ b/WWW/Library/Implementation/HTVMSUtils.c
@@ -871,7 +871,7 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 	if (header[strlen(header)-1] != '/')
 	    StrAllocCat(header, "/");
 	StrAllocCat(header, HT_DIR_README_FILE);
-	if ((fp = fopen(header,	 "r")) != NULL) {
+	if ((fp = fopen(header,	 TXT_R)) != NULL) {
 	    START(HTML_PRE);
 	    for(;;) {
 		char c = fgetc(fp);
diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.c b/WWW/Library/Implementation/HTVMS_WaisUI.c
index 2890841f..6f0811c0 100644
--- a/WWW/Library/Implementation/HTVMS_WaisUI.c
+++ b/WWW/Library/Implementation/HTVMS_WaisUI.c
@@ -220,7 +220,7 @@ transport_message(
 
   if( request_length + HEADER_LENGTH !=
       NETWRITE(connection,request_message,
-   		  (int)( request_length +HEADER_LENGTH)) )
+		  (int)( request_length +HEADER_LENGTH)) )
     return 0;
 
   /* read for the first '0' */
diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c
index 35277c6d..7d440e7f 100644
--- a/WWW/Library/Implementation/HTWAIS.c
+++ b/WWW/Library/Implementation/HTWAIS.c
@@ -115,9 +115,9 @@ struct _HTStream {
 /* ------------------------------------------------------------------------ */
 /* Returns 1 on success, 0 on fail, -1 on interrupt. */
 PRIVATE int fd_mosaic_connect_to_server ARGS3(
-	char *, 	host_name,
+	char *,		host_name,
 	long,		port,
-	long *, 	fd)
+	long *,		fd)
 {
     char *dummy = NULL;
     int status;
@@ -140,12 +140,12 @@ PRIVATE int fd_mosaic_connect_to_server ARGS3(
 /* Returns 1 on success, 0 on fail, -1 on interrupt. */
 #ifdef VMS
 PRIVATE int mosaic_connect_to_server ARGS3(
-	char *, 	host_name,
+	char *,		host_name,
 	long,		port,
-	long *, 	fdp)
+	long *,		fdp)
 #else
 PRIVATE int mosaic_connect_to_server ARGS3(
-	char *, 	host_name,
+	char *,		host_name,
 	long,		port,
 	FILE **,	fp)
 #endif /* VMS */
@@ -222,18 +222,18 @@ PRIVATE void init_acceptable NOARGS
 **
 **
 ** On exit,
-**	returns 	nil if error
+**	returns		nil if error
 **			pointer to malloced string (must be freed) if ok
 */
 PRIVATE char * WWW_from_archie ARGS1(
-	char *, 	file)
+	char *,		file)
 {
     char * end;
     char * result;
     char * colon;
     for(end=file; *end > ' '; end++);	/* assumes ASCII encoding*/
     result = (char *)malloc(10 + (end-file));
-    if (!result) return result; 	/* Malloc error */
+    if (!result) return result;		/* Malloc error */
     strcpy(result, "file://");
     strncat(result, file, end-file);
     colon = strchr(result+7, ':');	/* Expect colon after host */
@@ -250,7 +250,7 @@ PRIVATE char * WWW_from_archie ARGS1(
 **	The format of the docid MUST be good!
 **
 **  On exit,
-**	returns 	nil if error
+**	returns		nil if error
 **			pointer to malloced string (must be freed) if ok
 */
 PRIVATE char hex [17] = "0123456789ABCDEF";
@@ -317,7 +317,7 @@ PRIVATE char * WWW_from_WAIS ARGS1(
 **	-------------------------------------------
 **
 **  On entry,
-**	docname 	points to valid name produced originally by
+**	docname		points to valid name produced originally by
 **			WWW_from_WAIS
 **  On exit,
 **	docid->size	is valid
@@ -325,7 +325,7 @@ PRIVATE char * WWW_from_WAIS ARGS1(
 */
 PRIVATE any * WAIS_from_WWW ARGS2(
 	any *,		docid,
-	char *, 	docname)
+	char *,		docname)
 {
     char *z;	/* Output pointer */
     char *sor;	/* Start of record - points to size field. */
@@ -351,7 +351,7 @@ PRIVATE any * WAIS_from_WWW ARGS2(
     for (p = docname; *p; ) {	/* Convert of strings */
 				/* Record type */
 
-	*z = 0; 		/* Initialize record type */
+	*z = 0;			/* Initialize record type */
 	while (*p >= '0' && *p <= '9') {
 	    *z = *z*10 + (*p++ - '0');	/* Decode decimal record type */
 	}
@@ -407,8 +407,8 @@ PRIVATE any * WAIS_from_WWW ARGS2(
 **	--------------------------------------
 */
 PRIVATE void output_text_record ARGS4(
-    HTStream *, 		target,
-    WAISDocumentText *, 	record,
+    HTStream *,			target,
+    WAISDocumentText *,		record,
     boolean,			quote_string_quotes,
     boolean,			binary)
 {
@@ -432,7 +432,7 @@ PRIVATE void output_text_record ARGS4(
 	    /* if the next letter is '(' or ')', then ignore two letters */
 	    if ('(' == record->DocumentText->bytes[count + 1] ||
 		')' == record->DocumentText->bytes[count + 1])
-	    count += 1; 	    /* it is a term marker */
+	    count += 1;		    /* it is a term marker */
 	    else count += 4;		/* it is a paragraph marker */
     } else if (ch == '\n' || ch == '\r') {
 	    PUTC('\n');
@@ -442,7 +442,7 @@ PRIVATE void output_text_record ARGS4(
   }
 } /* output text record */
 
-/*	Format A Search response for the client 	display_search_response
+/*	Format A Search response for the client		display_search_response
 **	---------------------------------------
 */
 /* modified from tracy shen's version in wutil.c
@@ -491,7 +491,7 @@ PRIVATE void display_search_response ARGS4(
 		WAISDocumentHeader* head = info->DocHeaders[k];
 		char * headline = trim_junk(head->Headline);
 		any * docid = head->DocumentID;
-		char * docname; 	/* printable version of docid */
+		char * docname;		/* printable version of docid */
 
 		i++;
 		/*
@@ -615,15 +615,15 @@ PUBLIC int HTLoadWAIS ARGS4(
 {
     static CONST char * error_header =
 "<h1>Access error</h1>\nThe following error occured in accesing a WAIS server:<P>\n";
-    char * key; 		  /* pointer to keywords in URL */
+    char * key;			  /* pointer to keywords in URL */
     char* request_message = NULL; /* arbitrary message limit */
     char* response_message = NULL; /* arbitrary message limit */
     long request_buffer_length; /* how of the request is left */
     SearchResponseAPDU	*retrieval_response = 0;
     char keywords[MAX_KEYWORDS_LENGTH + 1];
     char *server_name;
-    char *wais_database = NULL; 	/* name of current database */
-    char *www_database; 		/* Same name escaped */
+    char *wais_database = NULL;		/* name of current database */
+    char *www_database;			/* Same name escaped */
     char *service;
     char *doctype;
     char *doclength;
@@ -731,11 +731,9 @@ PUBLIC int HTLoadWAIS ARGS4(
     **	This below fixed size stuff is terrible.
     */
 #ifdef VMS
-    if (!(request_message =
-	  (char*)calloc((size_t)MAX_MESSAGE_LEN*sizeof(char),1)))
+    if ((request_message = typecallocn(char, MAX_MESSAGE_LEN)) == 0)
 	outofmem(__FILE__, "HTLoadWAIS");
-    if (!(response_message =
-	  (char*)calloc((size_t)MAX_MESSAGE_LEN*sizeof(char),1)))
+    if ((response_message = typecallocn(char, MAX_MESSAGE_LEN)) == 0)
 	outofmem(__FILE__, "HTLoadWAIS");
 #else
     request_message = (char*)s_malloc((size_t)MAX_MESSAGE_LEN * sizeof(char));
@@ -747,7 +745,7 @@ PUBLIC int HTLoadWAIS ARGS4(
     **	the user has followed a link to the index itself.  It would be
     **	appropriate at this point to send him the .SRC file - how?
     */
-    if (key && !*key) { 			/* I N D E X */
+    if (key && !*key) {				/* I N D E X */
 #ifdef CACHE_FILE_PREFIX
 	char * filename = NULL;
 	FILE * fp;
@@ -790,7 +788,7 @@ PUBLIC int HTLoadWAIS ARGS4(
 		CACHE_FILE_PREFIX,
 		server_name, service, www_database);
 
-	fp = fopen(filename, "r");	/* Have we found this already? */
+	fp = fopen(filename, TXT_R);	/* Have we found this already? */
 	CTRACE((tfp, "HTWAIS: Description of server %s %s.\n",
 		    filename,
 		    fp ? "exists already" : "does NOT exist!"));
diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c
index 4fca40ca..0f7577f8 100644
--- a/WWW/Library/Implementation/HTWSRC.c
+++ b/WWW/Library/Implementation/HTWSRC.c
@@ -259,7 +259,7 @@ PRIVATE BOOL write_cache ARGS1(HTStream *, me)
 	me->par_value[PAR_TCP_PORT] ? me->par_value[PAR_TCP_PORT] : "210",
 	www_database);
 
-    if ((fp = fopen(cache_file_name, "w")) != 0) {
+    if ((fp = fopen(cache_file_name, TXT_W)) != 0) {
 	result = YES;
 	if (me->par_value[PAR_DESCRIPTION])
 	    fputs(me->par_value[PAR_DESCRIPTION], fp);
diff --git a/WWW/Library/Implementation/HTioctl.h b/WWW/Library/Implementation/HTioctl.h
new file mode 100644
index 00000000..95e914e6
--- /dev/null
+++ b/WWW/Library/Implementation/HTioctl.h
@@ -0,0 +1,11 @@
+/*
+**  A routine to mimic the ioctl function for UCX.
+**  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
+*/
+#include <iodef.h>
+#define IOC_OUT (int)0x40000000
+extern int vaxc$get_sdc(), sys$qiow();
+
+#ifndef UCX$C_IOCTL
+#define UCX$C_IOCTL TCPIP$C_IOCTL
+#endif
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index be3bdc33..fdc492b1 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -82,7 +82,7 @@ PRIVATE void fake_put_character ARGS2(
     if (ch->size >= ch->allocated) {\
 	ch->allocated = ch->allocated + ch->growby;\
 	ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)\
-			    : (char *)calloc(1, ch->allocated);\
+			    : typecallocn(char, ch->allocated);\
       if (!ch->data)\
 	  outofmem(__FILE__, "HTChunkPutc");\
     }\
diff --git a/WWW/Library/Implementation/makefile.in b/WWW/Library/Implementation/makefile.in
index 5d149785..3cea574d 100644
--- a/WWW/Library/Implementation/makefile.in
+++ b/WWW/Library/Implementation/makefile.in
@@ -19,6 +19,7 @@ LYFLAGS		= # FIXME: set in parent makefile
 CC		= @CC@
 DEFS		= @DEFS@
 CPPFLAGS	= @CPPFLAGS@
+_O		= .o
 
 INTLDIR_CPPFLAGS= @INTLDIR_CPPFLAGS@ -I$(top_srcdir)/intl
 
@@ -78,7 +79,7 @@ LOB = .
 #  uncomment these and fill in WAISINC for adding direct wais access
 #  to Lynx.
 #HTWAIS_c = $(CMN)/HTWAIS.c
-#HTWAIS_o = $(LOB)/HTWAIS.o
+#HTWAIS_o = $(LOB)/HTWAIS$(_O)
 #WAIS = YES
 #WAISINC = -I../../../../freeWAIS-0.202/ir
 #WAISCFLAGS = -DDIRECT_WAIS
@@ -91,21 +92,21 @@ CFLAGS2 = $(CFLAGS) $(LYFLAGS) $(WAISCFLAGS) -I$(CMN) -DXMOSAIC_HACK -DACCESS_AU
 
 COMPILE	= $(ECHO) $(CC) $(CFLAGS2) -c
 
-COMMON = $(LOB)/HTParse.o $(LOB)/HTAccess.o $(LOB)/HTTP.o \
-	$(LOB)/HTFile.o	$(LOB)/HTBTree.o $(LOB)/HTFTP.o $(LOB)/HTTCP.o \
-	$(LOB)/SGML.o $(LOB)/HTMLDTD.o $(LOB)/HTChunk.o \
-	$(LOB)/HTPlain.o \
-	$(LOB)/HTMLGen.o \
-	$(LOB)/HTAtom.o $(LOB)/HTAnchor.o $(LOB)/HTStyle.o \
-	$(LOB)/HTList.o $(LOB)/HTString.o \
-	$(LOB)/HTRules.o $(LOB)/HTFormat.o  $(LOB)/HTMIME.o \
-	$(LOB)/HTNews.o  $(LOB)/HTGopher.o \
-	$(LOB)/HTTelnet.o $(LOB)/HTFinger.o $(LOB)/HTWSRC.o $(HTWAIS_o) \
-	$(LOB)/HTAAUtil.o $(LOB)/HTAABrow.o \
-	$(LOB)/HTGroup.o \
-	$(LOB)/HTAAProt.o \
-	$(LOB)/HTAssoc.o  $(LOB)/HTLex.o    $(LOB)/HTUU.o \
-	$(LOB)/HTDOS.o
+COMMON = $(LOB)/HTParse$(_O) $(LOB)/HTAccess$(_O) $(LOB)/HTTP$(_O) \
+	$(LOB)/HTFile$(_O)	$(LOB)/HTBTree$(_O) $(LOB)/HTFTP$(_O) $(LOB)/HTTCP$(_O) \
+	$(LOB)/SGML$(_O) $(LOB)/HTMLDTD$(_O) $(LOB)/HTChunk$(_O) \
+	$(LOB)/HTPlain$(_O) \
+	$(LOB)/HTMLGen$(_O) \
+	$(LOB)/HTAtom$(_O) $(LOB)/HTAnchor$(_O) $(LOB)/HTStyle$(_O) \
+	$(LOB)/HTList$(_O) $(LOB)/HTString$(_O) \
+	$(LOB)/HTRules$(_O) $(LOB)/HTFormat$(_O)  $(LOB)/HTMIME$(_O) \
+	$(LOB)/HTNews$(_O)  $(LOB)/HTGopher$(_O) \
+	$(LOB)/HTTelnet$(_O) $(LOB)/HTFinger$(_O) $(LOB)/HTWSRC$(_O) $(HTWAIS_o) \
+	$(LOB)/HTAAUtil$(_O) $(LOB)/HTAABrow$(_O) \
+	$(LOB)/HTGroup$(_O) \
+	$(LOB)/HTAAProt$(_O) \
+	$(LOB)/HTAssoc$(_O)  $(LOB)/HTLex$(_O)    $(LOB)/HTUU$(_O) \
+	$(LOB)/HTDOS$(_O)
 
 CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \
 	$(CMN)HTBTree.c \
@@ -148,9 +149,9 @@ all : $(LOB)/libwww.a
 lint:
 	$(LINT) $(LINTOPTS) $(CPPOPTS) $(srcdir)/../Implementation/*.c  > ../../../lint.libwww
 
-.SUFFIXES: .i .h .html
+.SUFFIXES: $(_O) .i .h .html
 
-.c.o:
+.c$(_O):
 @RULE_CC@
 	@ECHO_CC@$(CC) $(CPPOPTS) $(CFLAGS) -c $(srcdir)/$*.c
 
@@ -172,135 +173,135 @@ $(LOB)/libwww.a : $(COMMON)
 #	Clean up everything generatable except final products
 clean :
 	rm -f core *.core *.leaks *.[oi] *.bak tags TAGS
-	rm $(LOB)/*.o
+	rm $(LOB)/*$(_O)
 
 #			Common code
 #			-----------
 
-$(LOB)/HTList.o : $(OE) $(CMN)HTList.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTList$(_O) : $(OE) $(CMN)HTList.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTList.c
 
-$(LOB)/HTAnchor.o : $(OE) $(CMN)HTAnchor.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTAnchor$(_O) : $(OE) $(CMN)HTAnchor.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTAnchor.c
 
-$(LOB)/HTFormat.o : $(OE) $(CMN)HTFormat.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTFormat$(_O) : $(OE) $(CMN)HTFormat.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTFormat.c
 
-$(LOB)/HTMIME.o : $(OE) $(CMN)HTMIME.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTMIME$(_O) : $(OE) $(CMN)HTMIME.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTMIME.c
 
-$(LOB)/HTNews.o : $(OE) $(CMN)HTNews.c $(CMN)HTUtils.h $(CMN)HTList.h\
+$(LOB)/HTNews$(_O) : $(OE) $(CMN)HTNews.c $(CMN)HTUtils.h $(CMN)HTList.h\
 	 $(CMN)HTMLDTD.h
 	$(COMPILE) $(CMN)HTNews.c
 
-$(LOB)/HTGopher.o : $(OE) $(CMN)HTGopher.c $(CMN)HTUtils.h $(CMN)HTList.h \
+$(LOB)/HTGopher$(_O) : $(OE) $(CMN)HTGopher.c $(CMN)HTUtils.h $(CMN)HTList.h \
 	 $(CMN)HTMLDTD.h
 	$(COMPILE) $(CMN)HTGopher.c
 
-$(LOB)/HTTelnet.o : $(OE) $(CMN)HTTelnet.c $(CMN)HTUtils.h $(CMN)HTTelnet.h $(CMN)../../../userdefs.h
+$(LOB)/HTTelnet$(_O) : $(OE) $(CMN)HTTelnet.c $(CMN)HTUtils.h $(CMN)HTTelnet.h $(CMN)../../../userdefs.h
 	$(COMPILE) $(CMN)HTTelnet.c
 
-$(LOB)/HTFinger.o : $(OE) $(CMN)HTFinger.c $(CMN)HTUtils.h $(CMN)HTList.h \
+$(LOB)/HTFinger$(_O) : $(OE) $(CMN)HTFinger.c $(CMN)HTUtils.h $(CMN)HTList.h \
 	$(CMN)HTMLDTD.h
 	$(COMPILE) $(CMN)HTFinger.c
 
-$(LOB)/HTStyle.o : $(OE) $(CMN)HTStyle.c $(CMN)HTUtils.h
+$(LOB)/HTStyle$(_O) : $(OE) $(CMN)HTStyle.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTStyle.c
 
-$(LOB)/HTAtom.o : $(OE) $(CMN)HTAtom.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTAtom$(_O) : $(OE) $(CMN)HTAtom.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTAtom.c
 
-$(LOB)/HTChunk.o : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h
+$(LOB)/HTChunk$(_O) : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTChunk.c
 
-$(LOB)/HTString.o : $(OE) $(CMN)HTString.c $(CMN)HTUtils.h $(CMN)Version.make
+$(LOB)/HTString$(_O) : $(OE) $(CMN)HTString.c $(CMN)HTUtils.h $(CMN)Version.make
 	$(COMPILE) -DVC=\"$(VC)\" $(CMN)HTString.c
 
-$(LOB)/HTRules.o : $(OE) $(CMN)HTRules.c $(CMN)HTUtils.h $(CMN)Version.make \
+$(LOB)/HTRules$(_O) : $(OE) $(CMN)HTRules.c $(CMN)HTUtils.h $(CMN)Version.make \
 	 $(CMN)HTAAProt.h
 	$(COMPILE) -DVC=\"$(VC)\" $(CMN)HTRules.c
 
-$(LOB)/SGML.o : $(OE) $(CMN)SGML.c $(CMN)HTUtils.h $(CMN)UCAux.h
+$(LOB)/SGML$(_O) : $(OE) $(CMN)SGML.c $(CMN)HTUtils.h $(CMN)UCAux.h
 	$(COMPILE) $(CMN)SGML.c
 
-$(LOB)/HTMLGen.o : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h
+$(LOB)/HTMLGen$(_O) : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h
 	$(COMPILE) $(CMN)HTMLGen.c
 
-$(LOB)/HTMLDTD.o : $(OE) $(CMN)HTMLDTD.c $(CMN)SGML.h
+$(LOB)/HTMLDTD$(_O) : $(OE) $(CMN)HTMLDTD.c $(CMN)SGML.h
 	$(COMPILE) $(CMN)HTMLDTD.c
 
-$(LOB)/HTPlain.o : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h \
+$(LOB)/HTPlain$(_O) : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h \
 	 $(CMN)UCAux.h
 	$(COMPILE) $(CMN)HTPlain.c
 
-$(LOB)/HTWAIS.o : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTWAIS$(_O) : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(WAISINC) $(CMN)HTWAIS.c
 
-$(LOB)/HTWSRC.o : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h
+$(LOB)/HTWSRC$(_O) : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTWSRC.c
 
 #	Access Authorization
 
-$(LOB)/HTAAUtil.o : $(OE) $(CMN)HTAAUtil.c $(CMN)HTAAUtil.h \
+$(LOB)/HTAAUtil$(_O) : $(OE) $(CMN)HTAAUtil.c $(CMN)HTAAUtil.h \
 	 $(CMN)HTUtils.h $(CMN)HTString.h
 	$(COMPILE) $(CMN)HTAAUtil.c
 
-$(LOB)/HTGroup.o : $(OE) $(CMN)HTGroup.c $(CMN)HTGroup.h \
+$(LOB)/HTGroup$(_O) : $(OE) $(CMN)HTGroup.c $(CMN)HTGroup.h \
 	 $(CMN)HTAAUtil.h \
 	 $(CMN)HTAssoc.h $(CMN)HTLex.h
 	$(COMPILE) $(CMN)HTGroup.c
 
-$(LOB)/HTAABrow.o : $(OE) $(CMN)HTAABrow.c $(CMN)HTAABrow.h \
+$(LOB)/HTAABrow$(_O) : $(OE) $(CMN)HTAABrow.c $(CMN)HTAABrow.h \
 	 $(CMN)HTAAUtil.h $(CMN)HTUU.h \
 	 $(CMN)HTUtils.h $(CMN)HTString.h \
 	 $(CMN)HTParse.h $(CMN)HTList.h \
 	 $(CMN)HTAssoc.h
 	$(COMPILE) $(CMN)HTAABrow.c
 
-$(LOB)/HTAAProt.o : $(OE) $(CMN)HTAAProt.c $(CMN)HTAAProt.h \
+$(LOB)/HTAAProt$(_O) : $(OE) $(CMN)HTAAProt.c $(CMN)HTAAProt.h \
 	 $(CMN)HTUtils.h $(CMN)HTAAUtil.h \
 	 $(CMN)HTAssoc.h $(CMN)HTLex.h
 	$(COMPILE) $(CMN)HTAAProt.c
 
-$(LOB)/HTAssoc.o : $(OE) $(CMN)HTAssoc.c $(CMN)HTAssoc.h \
+$(LOB)/HTAssoc$(_O) : $(OE) $(CMN)HTAssoc.c $(CMN)HTAssoc.h \
 	$(CMN)HTUtils.h $(CMN)HTString.h $(CMN)HTList.h
 	$(COMPILE) $(CMN)HTAssoc.c
 
-$(LOB)/HTLex.o : $(OE) $(CMN)HTLex.c $(CMN)HTLex.h $(CMN)HTUtils.h
+$(LOB)/HTLex$(_O) : $(OE) $(CMN)HTLex.c $(CMN)HTLex.h $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTLex.c
 
-$(LOB)/HTUU.o : $(OE) $(CMN)HTUU.c $(CMN)HTUU.h $(CMN)HTUtils.h
+$(LOB)/HTUU$(_O) : $(OE) $(CMN)HTUU.c $(CMN)HTUU.h $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTUU.c
 
 
 #	Communications & Files
 
-$(LOB)/HTTP.o : $(OE) $(CMN)HTTP.c $(CMN)HTUtils.h $(CMN)HTAABrow.h
+$(LOB)/HTTP$(_O) : $(OE) $(CMN)HTTP.c $(CMN)HTUtils.h $(CMN)HTAABrow.h
 	$(COMPILE) $(CMN)HTTP.c
 
-$(LOB)/HTTCP.o : $(OE) $(CMN)HTTCP.c $(CMN)HTUtils.h
+$(LOB)/HTTCP$(_O) : $(OE) $(CMN)HTTCP.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTTCP.c
 
-$(LOB)/HTFile.o : $(OE) $(CMN)HTFile.c $(CMN)HTUtils.h \
+$(LOB)/HTFile$(_O) : $(OE) $(CMN)HTFile.c $(CMN)HTUtils.h \
 	 $(CMN)HTMLDTD.h
 	$(COMPILE) $(CMN)HTFile.c
 
-$(LOB)/HTBTree.o : $(OE) $(CMN)HTBTree.c $(CMN)HTUtils.h
+$(LOB)/HTBTree$(_O) : $(OE) $(CMN)HTBTree.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTBTree.c
 
-$(LOB)/HTFTP.o : $(OE) $(CMN)HTFTP.c $(CMN)HTUtils.h
+$(LOB)/HTFTP$(_O) : $(OE) $(CMN)HTFTP.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTFTP.c
 
-$(LOB)/HTAccess.o : $(OE)  $(CMN)HTAccess.c $(CMN)HTUtils.h
+$(LOB)/HTAccess$(_O) : $(OE)  $(CMN)HTAccess.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTAccess.c
 
-$(LOB)/HTParse.o : $(OE) $(CMN)HTParse.c $(CMN)HTUtils.h
+$(LOB)/HTParse$(_O) : $(OE) $(CMN)HTParse.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTParse.c
 
-$(LOB)/HTVMS_WaisUI.o : $(OE) $(CMN)HTVMS_WaisUI.c $(CMN)HTUtils.h
+$(LOB)/HTVMS_WaisUI$(_O) : $(OE) $(CMN)HTVMS_WaisUI.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTVMS_WaisUI.c
 
-$(LOB)/HTDOS.o : $(OE) $(CMN)HTDOS.c $(CMN)HTUtils.h
+$(LOB)/HTDOS$(_O) : $(OE) $(CMN)HTDOS.c $(CMN)HTUtils.h
 	$(COMPILE) $(CMN)HTDOS.c
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/aclocal.m4 b/aclocal.m4
index b7b32f39..322b8ef7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -2825,7 +2825,7 @@ if test "$cf_cv_termlib" = none; then
 fi
 ])
 if test "$cf_cv_termlib" = none; then
-	AC_ERROR([Can't find -ltermlib, -lcurses, or -ltermcap])
+	AC_MSG_WARN([Cannot find -ltermlib, -lcurses, or -ltermcap])
 fi
 ])])dnl
 dnl ---------------------------------------------------------------------------
diff --git a/config.hin b/config.hin
index 9b87f94e..fb375c08 100644
--- a/config.hin
+++ b/config.hin
@@ -151,7 +151,6 @@
 #undef INCLUDE_PROTOTYPES	/* CF_SOCKS5 */
 #undef INSTALL_ARGS		/* CF_PATH_PROG(install) */
 #undef INSTALL_PATH		/* CF_PATH_PROG(install) */
-#undef LINKEDSTYLES		/* see USE_COLOR_STYLE */
 #undef LINUX			/* FIXME: make tests? */
 #undef LOCALE			/* for locale support */
 #undef LONG_LIST		/* CF_ARG_DISABLE(long-list) */
@@ -159,7 +158,8 @@
 #undef LYNX_CFG_FILE		/* $libdir/lynx.cfg */
 #undef LYNX_LSS_FILE		/* $libdir/lynx.lss */
 #undef LYNX_RAND_MAX		/* CF_SRAND */
-#undef LY_FIND_LEAKS		/* configure --disable-leaks */
+#undef LY_FIND_LEAKS		/* CF_ARG_ENABLE(find-leaks) */
+#undef LY_TRACELINE		/* CF_ARG_ENABLE(vertrace) */
 #undef MKDIR_PATH		/* CF_PATH_PROG(mkdir) */
 #undef MV_PATH			/* CF_PATH_PROG(mv) */
 #undef NCURSES			/* defined for ncurses support */
@@ -173,7 +173,7 @@
 #undef NO_LYNX_TRACE		/* CF_ARG_DISABLE(trace) */
 #undef NO_OPTION_FORMS		/* CF_ARG_DISABLE(forms-options) */
 #undef NO_OPTION_MENU		/* CF_ARG_DISABLE(option-menu) */
-#undef NO_PARENT_DIR_REFERENCE	/* configure --disable-parent-dir */
+#undef NO_PARENT_DIR_REFERENCE	/* CF_ARG_DISABLE(parent-dir-refs) */
 #undef NSL_FORK			/* CF_ARG_ENABLE(nsl-fork) */
 #undef OK_GZIP			/* CF_ARG_DISABLE(dired-gzip) */
 #undef OK_INSTALL
@@ -210,7 +210,6 @@
 #undef USE_OPENSSL_INCL		/* CF_SSL */
 #undef USE_PRETTYSRC		/* CF_ARG_ENABLE(prettysrc) */
 #undef USE_SCROLLBAR		/* CF_ARG_ENABLE(scrollbar) */
-#undef USE_SIZECHANGEHACK	/* FIXME: find a case where this works! */
 #undef USE_SLANG		/* AC_ARG_WITH(screen=slang) */
 #undef USE_SOCKS4_PREFIX	/* CF_SOCKS5 */
 #undef USE_SOCKS5		/* CF_SOCKS5 */
@@ -244,14 +243,19 @@
 #undef const
 #endif
 
-/* FIXME:DECLARE_WAIS_LOGFILES */
-/* FIXME:DGUX */
+/*
+ * The configure script generates LYHelp.h (handcrafted makefiles may not do
+ * this, so we set a definition):
+ */
+#define HAVE_LYHELP_H 1
+
+/* FIXME:DGUX (done in $host_os case-statement) */
 /* FIXME:DGUX_OLD */
 /* FIXME:HP_TERMINAL */
 /* FIXME:REVERSE_CLEAR_SCREEN_PROBLEM */
 /* FIXME:SHORTENED_RBIND */
 /* FIXME:SNAKE */
-/* FIXME:SVR4_BSDSELECT */
+/* FIXME:SVR4_BSDSELECT (done in $host_os case-statement) */
 
 /* Some older socks libraries, especially AIX need special definitions */
 #if defined(_AIX) && !defined(USE_SOCKS5)
diff --git a/configure b/configure
index d5fb7d41..8c1aa071 100755
--- a/configure
+++ b/configure
@@ -189,6 +189,7 @@ Development Options:
   --enable-find-leaks     logic for testing memory leaks
   --enable-debug          compile w/ debugging (if \$CFLAGS is set, add -g there, too)
   --disable-trace         disable logic for trace code
+  --enable-vertrace       verbose trace code
   --enable-warnings       GCC compiler warnings
 Basic Configuration Options:
   --enable-nls            use Native Language Support
@@ -196,9 +197,9 @@ Basic Configuration Options:
   --with-catgets          use catgets functions if available
   --enable-included-msgs  use included messages, for i18n support
   --with-nls-datadir=DIR  NLS data, parent of locale (default: PREFIX/DATADIR)
-  --disable-full-paths    control whether full utility pathnames are used
 EOF
 cat <<EOF
+  --disable-full-paths    control whether full utility pathnames are used
   --with-ssl[=path]       link with ssl library if available
   --with-socks[=path]     link with socks library if available
   --with-socks5[=path]    link with socks5 library if available
@@ -211,9 +212,9 @@ Experimental Options:
   --disable-forms-options disable experimental forms-based options
   --disable-menu-options  disable old-style option menu
   --enable-addrlist-page  use experimental address-list page
-  --enable-charset-choice use experimental charset-selection logic
 EOF
 cat <<EOF
+  --enable-charset-choice use experimental charset-selection logic
   --enable-cjk            use experimental CJK logic
   --enable-color-style    use optional/experimental color style (ncurses/curses)
   --enable-default-colors enable use of default-colors (ncurses/slang)
@@ -225,9 +226,9 @@ cat <<EOF
   --enable-libjs          use experimental JavaScript support (Mozilla libjs)
   --enable-nested-tables  use experimental nested-table support
   --enable-prettysrc      colorize HTML source
-  --enable-read-eta       experimental read-progress message shows ETA
 EOF
 cat <<EOF
+  --enable-read-eta       experimental read-progress message shows ETA
   --enable-scrollbar      use experimental scrollbar, with mouse
   --enable-source-cache   cache HTML source for parse mode changes
 Miscellaneous Options:
@@ -239,9 +240,9 @@ Miscellaneous Options:
   --enable-cgi-links      support cgi links w/o a http daemon
   --enable-change-exec    allow users to change exec options
   --enable-exec-links     allow lynx to execute programs accessed via a link
-  --enable-exec-scripts   allow lynx to execute programs inferred from a link
 EOF
 cat <<EOF
+  --enable-exec-scripts   allow lynx to execute programs inferred from a link
   --enable-internal-links handle following links to same doc differently
   --enable-nsl-fork       fork NSL requests, allowing them to be aborted
   --enable-syslog         log URL requests via syslog
@@ -253,9 +254,9 @@ cat <<EOF
   --disable-gopher        disable GOPHER logic
   --disable-news          disable NEWS logic
   --disable-ftp           disable FTP logic
-Directory Editor Options:
 EOF
 cat <<EOF
+Directory Editor Options:
   --disable-dired          disable optional directory-editor, DirEd
   --disable-dired-archive  disable dearchiving commands
   --disable-dired-override disable DirEd override keymap
@@ -268,9 +269,9 @@ cat <<EOF
   --disable-long-list     disable long "ls -l" directory listings
   --disable-parent-dir-refs
                           disable "Up-to" links in directory listings
-Special Libraries for PDCurses X11:
 EOF
 cat <<EOF
+Special Libraries for PDCurses X11:
   --with-x                use the X Window System
   --with-Xaw3d            link with Xaw 3d library
   --with-neXtaw           link with neXT Athena library
@@ -643,7 +644,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:647: checking host system type" >&5
+echo "configure:648: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -713,7 +714,7 @@ esac
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:717: checking for $ac_word" >&5
+echo "configure:718: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -743,7 +744,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:747: checking for $ac_word" >&5
+echo "configure:748: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -794,7 +795,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:798: checking for $ac_word" >&5
+echo "configure:799: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -826,7 +827,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:830: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:831: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -837,12 +838,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 841 "configure"
+#line 842 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -868,12 +869,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:872: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:873: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:877: checking whether we are using GNU C" >&5
+echo "configure:878: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -882,7 +883,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -901,7 +902,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:905: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:906: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -933,7 +934,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:937: checking how to run the C preprocessor" >&5
+echo "configure:938: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -948,13 +949,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 952 "configure"
+#line 953 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -965,13 +966,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 969 "configure"
+#line 970 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -982,13 +983,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 986 "configure"
+#line 987 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1013,7 +1014,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1017: checking whether ln -s works" >&5
+echo "configure:1018: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1036,7 +1037,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1040: checking for $ac_word" >&5
+echo "configure:1041: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1064,7 +1065,7 @@ else
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1068: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1069: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1102,7 +1103,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1106: checking for a BSD compatible install" >&5
+echo "configure:1107: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1159,7 +1160,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1163: checking for $ac_word" >&5
+echo "configure:1164: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1190,9 +1191,9 @@ done
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1194: checking for AIX" >&5
+echo "configure:1195: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1196 "configure"
+#line 1197 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -1214,7 +1215,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1218: checking for POSIXized ISC" >&5
+echo "configure:1219: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -1240,7 +1241,7 @@ fi
 
 
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:1244: checking if you want to see long compiling messages" >&5
+echo "configure:1245: checking if you want to see long compiling messages" >&5
 
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
@@ -1288,7 +1289,7 @@ fi
 
 
 echo $ac_n "checking if you want to check memory-leaks""... $ac_c" 1>&6
-echo "configure:1292: checking if you want to check memory-leaks" >&5
+echo "configure:1293: checking if you want to check memory-leaks" >&5
 
 # Check whether --enable-find-leaks or --disable-find-leaks was given.
 if test "${enable_find_leaks+set}" = set; then
@@ -1312,7 +1313,7 @@ EOF
 
 
 echo $ac_n "checking if you want to enable debug-code""... $ac_c" 1>&6
-echo "configure:1316: checking if you want to enable debug-code" >&5
+echo "configure:1317: checking if you want to enable debug-code" >&5
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
@@ -1354,7 +1355,7 @@ else
 fi
 
 echo $ac_n "checking if you want to enable lynx trace code *recommended* ""... $ac_c" 1>&6
-echo "configure:1358: checking if you want to enable lynx trace code *recommended* " >&5
+echo "configure:1359: checking if you want to enable lynx trace code *recommended* " >&5
 
 # Check whether --enable-trace or --disable-trace was given.
 if test "${enable_trace+set}" = set; then
@@ -1377,10 +1378,34 @@ test $with_trace = no && cat >> confdefs.h <<\EOF
 EOF
 
 
+echo $ac_n "checking if you want verbose trace code""... $ac_c" 1>&6
+echo "configure:1383: checking if you want verbose trace code" >&5
+
+# Check whether --enable-vertrace or --disable-vertrace was given.
+if test "${enable_vertrace+set}" = set; then
+  enableval="$enable_vertrace"
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    with_vertrace=yes 
+  else
+    with_vertrace=no
+  fi
+else
+  enableval=no 
+  with_vertrace=no
+  
+fi
+
+echo "$ac_t""$with_vertrace" 1>&6
+test $with_vertrace = yes && cat >> confdefs.h <<\EOF
+#define LY_TRACELINE __LINE__
+EOF
+
+
 if test -n "$GCC"
 then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:1384: checking if you want to turn on gcc warnings" >&5
+echo "configure:1409: checking if you want to turn on gcc warnings" >&5
 
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
@@ -1420,9 +1445,9 @@ EOF
 if test "$GCC" = yes
 then
 	echo "checking for $CC __attribute__ directives" 1>&6
-echo "configure:1424: checking for $CC __attribute__ directives" >&5
+echo "configure:1449: checking for $CC __attribute__ directives" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1426 "configure"
+#line 1451 "configure"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -1460,7 +1485,7 @@ EOF
 EOF
 			;;
 		esac
-		if { (eval echo configure:1464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+		if { (eval echo configure:1489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 			test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
 			cat conftest.h >>confdefs.h
 #		else
@@ -1477,11 +1502,11 @@ fi
 if test "$GCC" = yes
 then
 	cat > conftest.$ac_ext <<EOF
-#line 1481 "configure"
+#line 1506 "configure"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 	echo "checking for $CC warning options" 1>&6
-echo "configure:1485: checking for $CC warning options" >&5
+echo "configure:1510: checking for $CC warning options" >&5
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-W -Wall"
 	cf_warn_CONST=""
@@ -1499,7 +1524,7 @@ echo "configure:1485: checking for $CC warning options" >&5
 		Wstrict-prototypes $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo configure:1503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+		if { (eval echo configure:1528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 			test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
@@ -1520,12 +1545,12 @@ EOF
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1524: checking for working const" >&5
+echo "configure:1549: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
+#line 1554 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1574,7 +1599,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1616,7 +1641,7 @@ clix*)
 	# contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also
 	# references -lmalloc and -lbsd.
 	echo $ac_n "checking for strcmp in -lc_s""... $ac_c" 1>&6
-echo "configure:1620: checking for strcmp in -lc_s" >&5
+echo "configure:1645: checking for strcmp in -lc_s" >&5
 ac_lib_var=`echo c_s'_'strcmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1624,7 +1649,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1628 "configure"
+#line 1653 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1635,7 +1660,7 @@ int main() {
 strcmp()
 ; return 0; }
 EOF
-if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1729,7 +1754,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1733: checking for $ac_word" >&5
+echo "configure:1758: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1774,17 +1799,17 @@ sony-newsos*)
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1778: checking for $ac_hdr" >&5
+echo "configure:1803: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1783 "configure"
+#line 1808 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1828,17 +1853,17 @@ ultrix*)
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1832: checking for $ac_hdr" >&5
+echo "configure:1857: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1837 "configure"
+#line 1862 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1875,7 +1900,7 @@ esac
 if test -z "$GCC" ; then
 	
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1879: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:1904: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1918,7 +1943,7 @@ do
 done
 
 	cat > conftest.$ac_ext <<EOF
-#line 1922 "configure"
+#line 1947 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -1934,7 +1959,7 @@ int main() {
 	struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:1938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -1985,12 +2010,12 @@ fi
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1989: checking for ANSI C header files" >&5
+echo "configure:2014: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1994 "configure"
+#line 2019 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1998,7 +2023,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2015,7 +2040,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2019 "configure"
+#line 2044 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2033,7 +2058,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2037 "configure"
+#line 2062 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2054,7 +2079,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2058 "configure"
+#line 2083 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2065,7 +2090,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2089,21 +2114,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2093: checking for inline" >&5
+echo "configure:2118: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2100 "configure"
+#line 2125 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2129,12 +2154,12 @@ EOF
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2133: checking for off_t" >&5
+echo "configure:2158: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2138 "configure"
+#line 2163 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2162,12 +2187,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2166: checking for size_t" >&5
+echo "configure:2191: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2171 "configure"
+#line 2196 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2197,19 +2222,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2201: checking for working alloca.h" >&5
+echo "configure:2226: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2206 "configure"
+#line 2231 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2230,12 +2255,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2234: checking for alloca" >&5
+echo "configure:2259: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2239 "configure"
+#line 2264 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -2263,7 +2288,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2295,12 +2320,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2299: checking whether alloca needs Cray hooks" >&5
+echo "configure:2324: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2304 "configure"
+#line 2329 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2325,12 +2350,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2329: checking for $ac_func" >&5
+echo "configure:2354: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2334 "configure"
+#line 2359 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2353,7 +2378,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2380,7 +2405,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2384: checking stack direction for C alloca" >&5
+echo "configure:2409: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2388,7 +2413,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2392 "configure"
+#line 2417 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2407,7 +2432,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2432,17 +2457,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2436: checking for $ac_hdr" >&5
+echo "configure:2461: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2441 "configure"
+#line 2466 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2471,12 +2496,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2475: checking for $ac_func" >&5
+echo "configure:2500: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2480 "configure"
+#line 2505 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2499,7 +2524,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2524,7 +2549,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2528: checking for working mmap" >&5
+echo "configure:2553: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2532,7 +2557,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2536 "configure"
+#line 2561 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2672,7 +2697,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2713,17 +2738,17 @@ unistd.h sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2717: checking for $ac_hdr" >&5
+echo "configure:2742: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2722 "configure"
+#line 2747 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2753,12 +2778,12 @@ done
 strdup __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2757: checking for $ac_func" >&5
+echo "configure:2782: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2762 "configure"
+#line 2787 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2781,7 +2806,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2810,12 +2835,12 @@ done
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2814: checking for $ac_func" >&5
+echo "configure:2839: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2819 "configure"
+#line 2844 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2838,7 +2863,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2872,19 +2897,19 @@ EOF
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2876: checking for LC_MESSAGES" >&5
+echo "configure:2901: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2881 "configure"
+#line 2906 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:2888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -2905,7 +2930,7 @@ EOF
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2909: checking whether NLS is requested" >&5
+echo "configure:2934: checking whether NLS is requested" >&5
         
 # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
@@ -2926,7 +2951,7 @@ fi
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2930: checking whether included gettext is requested" >&5
+echo "configure:2955: checking whether included gettext is requested" >&5
       
 # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
@@ -2946,17 +2971,17 @@ fi
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2950: checking for libintl.h" >&5
+echo "configure:2975: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2955 "configure"
+#line 2980 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2973,19 +2998,19 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2977: checking for gettext in libc" >&5
+echo "configure:3002: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2982 "configure"
+#line 3007 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:2989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3001,7 +3026,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3005: checking for bindtextdomain in -lintl" >&5
+echo "configure:3030: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3009,7 +3034,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3013 "configure"
+#line 3038 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3020,7 +3045,7 @@ int main() {
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3038,19 +3063,19 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    gt_save_LIBS="$LIBS"
 		 LIBS="$gt_save_LIBS -lintl"
 	         echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3042: checking for gettext in libintl" >&5
+echo "configure:3067: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3047 "configure"
+#line 3072 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3084,7 +3109,7 @@ EOF
 
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3088: checking for $ac_word" >&5
+echo "configure:3113: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3118,12 +3143,12 @@ fi
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3122: checking for $ac_func" >&5
+echo "configure:3147: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3127 "configure"
+#line 3152 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3146,7 +3171,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3173,7 +3198,7 @@ done
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3177: checking for $ac_word" >&5
+echo "configure:3202: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3210,7 +3235,7 @@ fi
 
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3214: checking for $ac_word" >&5
+echo "configure:3239: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3242,7 +3267,7 @@ else
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 3246 "configure"
+#line 3271 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3250,7 +3275,7 @@ extern int _nl_msg_cat_cntr;
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -3273,7 +3298,7 @@ fi
 
         if test "$CATOBJEXT" = "NONE"; then
 	  echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:3277: checking whether catgets can be used" >&5
+echo "configure:3302: checking whether catgets can be used" >&5
 	  
 # Check whether --with-catgets or --without-catgets was given.
 if test "${with_catgets+set}" = set; then
@@ -3287,7 +3312,7 @@ fi
 
 	  if test "$nls_cv_use_catgets" = "yes"; then
 	    	    echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:3291: checking for main in -li" >&5
+echo "configure:3316: checking for main in -li" >&5
 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3295,14 +3320,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-li  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3299 "configure"
+#line 3324 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3330,12 +3355,12 @@ else
 fi
 
 	    echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:3334: checking for catgets" >&5
+echo "configure:3359: checking for catgets" >&5
 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3339 "configure"
+#line 3364 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char catgets(); below.  */
@@ -3358,7 +3383,7 @@ catgets();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_catgets=yes"
 else
@@ -3380,7 +3405,7 @@ EOF
 	       # Extract the first word of "gencat", so it can be a program name with args.
 set dummy gencat; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3384: checking for $ac_word" >&5
+echo "configure:3409: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3416,7 +3441,7 @@ fi
 		 # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3420: checking for $ac_word" >&5
+echo "configure:3445: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3454,7 +3479,7 @@ fi
 
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3458: checking for $ac_word" >&5
+echo "configure:3483: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3490,7 +3515,7 @@ fi
 
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3494: checking for $ac_word" >&5
+echo "configure:3519: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3549,7 +3574,7 @@ fi
 
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3553: checking for $ac_word" >&5
+echo "configure:3578: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3583,7 +3608,7 @@ fi
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3587: checking for $ac_word" >&5
+echo "configure:3612: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3620,7 +3645,7 @@ fi
 
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3624: checking for $ac_word" >&5
+echo "configure:3649: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3720,7 +3745,7 @@ fi
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3724: checking for catalogs to be installed" >&5
+echo "configure:3749: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -3749,17 +3774,17 @@ echo "configure:3724: checking for catalogs to be installed" >&5
      if test "$CATOBJEXT" = ".cat"; then
        ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3753: checking for linux/version.h" >&5
+echo "configure:3778: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3758 "configure"
+#line 3783 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3840,7 +3865,7 @@ use_our_messages=no
 if test "$USE_NLS" = yes ; then
 if test -d $srcdir/po ; then
 echo $ac_n "checking if we should use included message-library""... $ac_c" 1>&6
-echo "configure:3844: checking if we should use included message-library" >&5
+echo "configure:3869: checking if we should use included message-library" >&5
 	
 # Check whether --enable-included-msgs or --disable-included-msgs was given.
 if test "${enable_included_msgs+set}" = set; then
@@ -3878,17 +3903,17 @@ elif test "$USE_NLS" = yes ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3882: checking for $ac_hdr" >&5
+echo "configure:3907: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3887 "configure"
+#line 3912 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3998,7 +4023,7 @@ eval NLS_DATADIR="$withval"
 
 
 echo $ac_n "checking if you want full utility pathnames""... $ac_c" 1>&6
-echo "configure:4002: checking if you want full utility pathnames" >&5
+echo "configure:4027: checking if you want full utility pathnames" >&5
 
 # Check whether --enable-full-paths or --disable-full-paths was given.
 if test "${enable_full_paths+set}" = set; then
@@ -4023,7 +4048,7 @@ EOF
 
 
 echo $ac_n "checking for system mailer""... $ac_c" 1>&6
-echo "configure:4027: checking for system mailer" >&5
+echo "configure:4052: checking for system mailer" >&5
 if eval "test \"`echo '$''{'cf_cv_SYSTEM_MAIL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4050,7 +4075,7 @@ EOF
 
 
 echo $ac_n "checking system mail flags""... $ac_c" 1>&6
-echo "configure:4054: checking system mail flags" >&5
+echo "configure:4079: checking system mail flags" >&5
 if eval "test \"`echo '$''{'cf_cv_system_mail_flags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4078,7 +4103,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "chmod", so it can be a program name with args.
 set dummy chmod; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4082: checking for $ac_word" >&5
+echo "configure:4107: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4113,7 +4138,7 @@ fi
 
 else
 	echo $ac_n "checking for chmod""... $ac_c" 1>&6
-echo "configure:4117: checking for chmod" >&5
+echo "configure:4142: checking for chmod" >&5
 	echo "$ac_t""$CHMOD" 1>&6
 	eval 'ac_cv_path_'CHMOD'="'chmod'"'
 fi
@@ -4155,7 +4180,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "compress", so it can be a program name with args.
 set dummy compress; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4159: checking for $ac_word" >&5
+echo "configure:4184: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4190,7 +4215,7 @@ fi
 
 else
 	echo $ac_n "checking for compress""... $ac_c" 1>&6
-echo "configure:4194: checking for compress" >&5
+echo "configure:4219: checking for compress" >&5
 	echo "$ac_t""$COMPRESS" 1>&6
 	eval 'ac_cv_path_'COMPRESS'="'compress'"'
 fi
@@ -4232,7 +4257,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4236: checking for $ac_word" >&5
+echo "configure:4261: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4267,7 +4292,7 @@ fi
 
 else
 	echo $ac_n "checking for cp""... $ac_c" 1>&6
-echo "configure:4271: checking for cp" >&5
+echo "configure:4296: checking for cp" >&5
 	echo "$ac_t""$COPY" 1>&6
 	eval 'ac_cv_path_'COPY'="'cp'"'
 fi
@@ -4309,7 +4334,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4313: checking for $ac_word" >&5
+echo "configure:4338: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4344,7 +4369,7 @@ fi
 
 else
 	echo $ac_n "checking for gzip""... $ac_c" 1>&6
-echo "configure:4348: checking for gzip" >&5
+echo "configure:4373: checking for gzip" >&5
 	echo "$ac_t""$GZIP" 1>&6
 	eval 'ac_cv_path_'GZIP'="'gzip'"'
 fi
@@ -4386,7 +4411,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "mkdir", so it can be a program name with args.
 set dummy mkdir; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4390: checking for $ac_word" >&5
+echo "configure:4415: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4421,7 +4446,7 @@ fi
 
 else
 	echo $ac_n "checking for mkdir""... $ac_c" 1>&6
-echo "configure:4425: checking for mkdir" >&5
+echo "configure:4450: checking for mkdir" >&5
 	echo "$ac_t""$MKDIR" 1>&6
 	eval 'ac_cv_path_'MKDIR'="'mkdir'"'
 fi
@@ -4463,7 +4488,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4467: checking for $ac_word" >&5
+echo "configure:4492: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4498,7 +4523,7 @@ fi
 
 else
 	echo $ac_n "checking for mv""... $ac_c" 1>&6
-echo "configure:4502: checking for mv" >&5
+echo "configure:4527: checking for mv" >&5
 	echo "$ac_t""$MV" 1>&6
 	eval 'ac_cv_path_'MV'="'mv'"'
 fi
@@ -4540,7 +4565,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "rm", so it can be a program name with args.
 set dummy rm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4544: checking for $ac_word" >&5
+echo "configure:4569: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4575,7 +4600,7 @@ fi
 
 else
 	echo $ac_n "checking for rm""... $ac_c" 1>&6
-echo "configure:4579: checking for rm" >&5
+echo "configure:4604: checking for rm" >&5
 	echo "$ac_t""$RM" 1>&6
 	eval 'ac_cv_path_'RM'="'rm'"'
 fi
@@ -4617,7 +4642,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "tar", so it can be a program name with args.
 set dummy tar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4621: checking for $ac_word" >&5
+echo "configure:4646: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4652,7 +4677,7 @@ fi
 
 else
 	echo $ac_n "checking for tar""... $ac_c" 1>&6
-echo "configure:4656: checking for tar" >&5
+echo "configure:4681: checking for tar" >&5
 	echo "$ac_t""$TAR" 1>&6
 	eval 'ac_cv_path_'TAR'="'tar'"'
 fi
@@ -4694,7 +4719,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "touch", so it can be a program name with args.
 set dummy touch; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4698: checking for $ac_word" >&5
+echo "configure:4723: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4729,7 +4754,7 @@ fi
 
 else
 	echo $ac_n "checking for touch""... $ac_c" 1>&6
-echo "configure:4733: checking for touch" >&5
+echo "configure:4758: checking for touch" >&5
 	echo "$ac_t""$TOUCH" 1>&6
 	eval 'ac_cv_path_'TOUCH'="'touch'"'
 fi
@@ -4771,7 +4796,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "gunzip", so it can be a program name with args.
 set dummy gunzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4775: checking for $ac_word" >&5
+echo "configure:4800: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNCOMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4806,7 +4831,7 @@ fi
 
 else
 	echo $ac_n "checking for gunzip""... $ac_c" 1>&6
-echo "configure:4810: checking for gunzip" >&5
+echo "configure:4835: checking for gunzip" >&5
 	echo "$ac_t""$UNCOMPRESS" 1>&6
 	eval 'ac_cv_path_'UNCOMPRESS'="'gunzip'"'
 fi
@@ -4848,7 +4873,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "unzip", so it can be a program name with args.
 set dummy unzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4852: checking for $ac_word" >&5
+echo "configure:4877: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4883,7 +4908,7 @@ fi
 
 else
 	echo $ac_n "checking for unzip""... $ac_c" 1>&6
-echo "configure:4887: checking for unzip" >&5
+echo "configure:4912: checking for unzip" >&5
 	echo "$ac_t""$UNZIP" 1>&6
 	eval 'ac_cv_path_'UNZIP'="'unzip'"'
 fi
@@ -4925,7 +4950,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "bzip2", so it can be a program name with args.
 set dummy bzip2; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4929: checking for $ac_word" >&5
+echo "configure:4954: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_BZIP2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4960,7 +4985,7 @@ fi
 
 else
 	echo $ac_n "checking for bzip2""... $ac_c" 1>&6
-echo "configure:4964: checking for bzip2" >&5
+echo "configure:4989: checking for bzip2" >&5
 	echo "$ac_t""$BZIP2" 1>&6
 	eval 'ac_cv_path_'BZIP2'="'bzip2'"'
 fi
@@ -5002,7 +5027,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "uudecode", so it can be a program name with args.
 set dummy uudecode; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5006: checking for $ac_word" >&5
+echo "configure:5031: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UUDECODE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5037,7 +5062,7 @@ fi
 
 else
 	echo $ac_n "checking for uudecode""... $ac_c" 1>&6
-echo "configure:5041: checking for uudecode" >&5
+echo "configure:5066: checking for uudecode" >&5
 	echo "$ac_t""$UUDECODE" 1>&6
 	eval 'ac_cv_path_'UUDECODE'="'uudecode'"'
 fi
@@ -5079,7 +5104,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "zcat", so it can be a program name with args.
 set dummy zcat; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5083: checking for $ac_word" >&5
+echo "configure:5108: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZCAT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5114,7 +5139,7 @@ fi
 
 else
 	echo $ac_n "checking for zcat""... $ac_c" 1>&6
-echo "configure:5118: checking for zcat" >&5
+echo "configure:5143: checking for zcat" >&5
 	echo "$ac_t""$ZCAT" 1>&6
 	eval 'ac_cv_path_'ZCAT'="'zcat'"'
 fi
@@ -5156,7 +5181,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "zip", so it can be a program name with args.
 set dummy zip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5160: checking for $ac_word" >&5
+echo "configure:5185: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5191,7 +5216,7 @@ fi
 
 else
 	echo $ac_n "checking for zip""... $ac_c" 1>&6
-echo "configure:5195: checking for zip" >&5
+echo "configure:5220: checking for zip" >&5
 	echo "$ac_t""$ZIP" 1>&6
 	eval 'ac_cv_path_'ZIP'="'zip'"'
 fi
@@ -5233,7 +5258,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "telnet", so it can be a program name with args.
 set dummy telnet; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5237: checking for $ac_word" >&5
+echo "configure:5262: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TELNET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5268,7 +5293,7 @@ fi
 
 else
 	echo $ac_n "checking for telnet""... $ac_c" 1>&6
-echo "configure:5272: checking for telnet" >&5
+echo "configure:5297: checking for telnet" >&5
 	echo "$ac_t""$TELNET" 1>&6
 	eval 'ac_cv_path_'TELNET'="'telnet'"'
 fi
@@ -5310,7 +5335,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "tn3270", so it can be a program name with args.
 set dummy tn3270; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5314: checking for $ac_word" >&5
+echo "configure:5339: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TN3270'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5345,7 +5370,7 @@ fi
 
 else
 	echo $ac_n "checking for tn3270""... $ac_c" 1>&6
-echo "configure:5349: checking for tn3270" >&5
+echo "configure:5374: checking for tn3270" >&5
 	echo "$ac_t""$TN3270" 1>&6
 	eval 'ac_cv_path_'TN3270'="'tn3270'"'
 fi
@@ -5387,7 +5412,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "rlogin", so it can be a program name with args.
 set dummy rlogin; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5391: checking for $ac_word" >&5
+echo "configure:5416: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RLOGIN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5422,7 +5447,7 @@ fi
 
 else
 	echo $ac_n "checking for rlogin""... $ac_c" 1>&6
-echo "configure:5426: checking for rlogin" >&5
+echo "configure:5451: checking for rlogin" >&5
 	echo "$ac_t""$RLOGIN" 1>&6
 	eval 'ac_cv_path_'RLOGIN'="'rlogin'"'
 fi
@@ -5474,7 +5499,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "install", so it can be a program name with args.
 set dummy install; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5478: checking for $ac_word" >&5
+echo "configure:5503: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_INSTALL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5509,7 +5534,7 @@ fi
 
 else
 	echo $ac_n "checking for install""... $ac_c" 1>&6
-echo "configure:5513: checking for install" >&5
+echo "configure:5538: checking for install" >&5
 	echo "$ac_t""$INSTALL" 1>&6
 	eval 'ac_cv_path_'INSTALL'="'install'"'
 fi
@@ -5551,13 +5576,13 @@ esac
 
 
 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
-echo "configure:5555: checking if we must define _GNU_SOURCE" >&5
+echo "configure:5580: checking if we must define _GNU_SOURCE" >&5
 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 5561 "configure"
+#line 5586 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -5567,7 +5592,7 @@ make an error
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:5571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
@@ -5577,7 +5602,7 @@ else
   cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 	 cat > conftest.$ac_ext <<EOF
-#line 5581 "configure"
+#line 5606 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -5587,7 +5612,7 @@ make an error
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:5591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
@@ -5612,16 +5637,16 @@ if test -n "$TRY_CFLAGS" ; then
 	cf_save_CFLAGS="$CFLAGS"
 	CFLAGS="$CFLAGS $TRY_CFLAGS"
 	echo $ac_n "checking if we should use compile options $TRY_CFLAGS""... $ac_c" 1>&6
-echo "configure:5616: checking if we should use compile options $TRY_CFLAGS" >&5
+echo "configure:5641: checking if we should use compile options $TRY_CFLAGS" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 5618 "configure"
+#line 5643 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 FILE *fp = stdin
 ; return 0; }
 EOF
-if { (eval echo configure:5625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -5639,7 +5664,7 @@ fi
 ### Look for network libraries first, since some functions (such as gethostname)
 ### are used in a lot of places.
 echo $ac_n "checking if you want ssl library""... $ac_c" 1>&6
-echo "configure:5643: checking if you want ssl library" >&5
+echo "configure:5668: checking if you want ssl library" >&5
 if eval "test \"`echo '$''{'cf_cv_use_libssl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5659,7 +5684,7 @@ fi
 echo "$ac_t""$cf_cv_use_libssl" 1>&6
 
 echo $ac_n "checking if you want socks library""... $ac_c" 1>&6
-echo "configure:5663: checking if you want socks library" >&5
+echo "configure:5688: checking if you want socks library" >&5
 if eval "test \"`echo '$''{'cf_cv_use_libsocks'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5679,7 +5704,7 @@ fi
 echo "$ac_t""$cf_cv_use_libsocks" 1>&6
 
 echo $ac_n "checking if you want socks5 library""... $ac_c" 1>&6
-echo "configure:5683: checking if you want socks5 library" >&5
+echo "configure:5708: checking if you want socks5 library" >&5
 if eval "test \"`echo '$''{'cf_cv_use_libsocks5'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5755,7 +5780,7 @@ cat >> confdefs.h <<\EOF
 EOF
 
 cat > conftest.$ac_ext <<EOF
-#line 5759 "configure"
+#line 5784 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5764,7 +5789,7 @@ int main() {
 	accept((char *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:5768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -5803,10 +5828,10 @@ cat >> confdefs.h <<\EOF
 EOF
 
 echo $ac_n "checking if the socks library uses socks4 prefix""... $ac_c" 1>&6
-echo "configure:5807: checking if the socks library uses socks4 prefix" >&5
+echo "configure:5832: checking if the socks library uses socks4 prefix" >&5
 cf_use_socks4=error
 cat > conftest.$ac_ext <<EOF
-#line 5810 "configure"
+#line 5835 "configure"
 #include "confdefs.h"
 
 #include <socks.h>
@@ -5815,7 +5840,7 @@ int main() {
 	Rinit((char *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:5819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define USE_SOCKS4_PREFIX 1
@@ -5827,14 +5852,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 5831 "configure"
+#line 5856 "configure"
 #include "confdefs.h"
 #include <socks.h>
 int main() {
 SOCKSinit((char *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:5838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_use_socks4=no
 else
@@ -5899,9 +5924,9 @@ EOF
 
 fi
 echo $ac_n "checking if socks5p.h is available""... $ac_c" 1>&6
-echo "configure:5903: checking if socks5p.h is available" >&5
+echo "configure:5928: checking if socks5p.h is available" >&5
 cat > conftest.$ac_ext <<EOF
-#line 5905 "configure"
+#line 5930 "configure"
 #include "confdefs.h"
 
 #define INCLUDE_PROTOTYPES
@@ -5911,7 +5936,7 @@ int main() {
 	init((char *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:5915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_use_socks5p_h=yes
 else
@@ -5931,7 +5956,7 @@ else
 	
 cf_test_netlibs=no
 echo $ac_n "checking for network libraries""... $ac_c" 1>&6
-echo "configure:5935: checking for network libraries" >&5
+echo "configure:5960: checking for network libraries" >&5
 if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5942,12 +5967,12 @@ cf_test_netlibs=yes
 for ac_func in gethostname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5946: checking for $ac_func" >&5
+echo "configure:5971: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5951 "configure"
+#line 5976 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5970,7 +5995,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5993,7 +6018,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:5997: checking for gethostname in -lnsl" >&5
+echo "configure:6022: checking for gethostname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6001,7 +6026,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6005 "configure"
+#line 6030 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6012,7 +6037,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6045,7 +6070,7 @@ else
 	
 		
 echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:6049: checking for gethostname in -lsocket" >&5
+echo "configure:6074: checking for gethostname in -lsocket" >&5
 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6053,7 +6078,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6057 "configure"
+#line 6082 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6064,7 +6089,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:6068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6109,7 +6134,7 @@ done
 # I don't know the entrypoints - 97/7/22 TD
 # AC_HAVE_LIBRARY(inet,cf_cv_netlibs="-linet $cf_cv_netlibs")
 echo $ac_n "checking for main in -linet""... $ac_c" 1>&6
-echo "configure:6113: checking for main in -linet" >&5
+echo "configure:6138: checking for main in -linet" >&5
 ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6117,14 +6142,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6121 "configure"
+#line 6146 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6149,12 +6174,12 @@ if test "$ac_cv_func_lsocket" != no ; then
 for ac_func in socket
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6153: checking for $ac_func" >&5
+echo "configure:6178: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6158 "configure"
+#line 6183 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6177,7 +6202,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6200,7 +6225,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:6204: checking for socket in -lsocket" >&5
+echo "configure:6229: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6208,7 +6233,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6212 "configure"
+#line 6237 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6219,7 +6244,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:6223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6252,7 +6277,7 @@ else
 	
 		
 echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
-echo "configure:6256: checking for socket in -lbsd" >&5
+echo "configure:6281: checking for socket in -lbsd" >&5
 ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6260,7 +6285,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6264 "configure"
+#line 6289 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6271,7 +6296,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:6275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6316,12 +6341,12 @@ fi
 for ac_func in gethostbyname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6320: checking for $ac_func" >&5
+echo "configure:6345: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6325 "configure"
+#line 6350 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6344,7 +6369,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6367,7 +6392,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6371: checking for gethostbyname in -lnsl" >&5
+echo "configure:6396: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6375,7 +6400,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6379 "configure"
+#line 6404 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6386,7 +6411,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:6390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6427,12 +6452,12 @@ done
 for ac_func in strcasecmp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6431: checking for $ac_func" >&5
+echo "configure:6456: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6436 "configure"
+#line 6461 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6455,7 +6480,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6478,7 +6503,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:6482: checking for strcasecmp in -lresolv" >&5
+echo "configure:6507: checking for strcasecmp in -lresolv" >&5
 ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6486,7 +6511,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6490 "configure"
+#line 6515 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6497,7 +6522,7 @@ int main() {
 strcasecmp()
 ; return 0; }
 EOF
-if { (eval echo configure:6501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6543,13 +6568,13 @@ test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6
 fi
 
 echo $ac_n "checking for inet_aton function""... $ac_c" 1>&6
-echo "configure:6547: checking for inet_aton function" >&5
+echo "configure:6572: checking for inet_aton function" >&5
 if eval "test \"`echo '$''{'cf_cv_have_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6553 "configure"
+#line 6578 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6560,7 +6585,7 @@ int main() {
 inet_aton(0, (struct in_addr *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:6564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_have_inet_aton=yes
 else
@@ -6580,13 +6605,13 @@ EOF
 
 else
     echo $ac_n "checking for inet_addr function""... $ac_c" 1>&6
-echo "configure:6584: checking for inet_addr function" >&5
+echo "configure:6609: checking for inet_addr function" >&5
 if eval "test \"`echo '$''{'cf_cv_have_inet_addr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6590 "configure"
+#line 6615 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6597,7 +6622,7 @@ int main() {
 inet_addr(0)
 ; return 0; }
 EOF
-if { (eval echo configure:6601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_have_inet_addr=yes
 else
@@ -6612,7 +6637,7 @@ fi
 echo "$ac_t""$cf_cv_have_inet_addr" 1>&6
     if test "$cf_cv_have_inet_addr" = no ; then
 	echo $ac_n "checking for library with inet_addr""... $ac_c" 1>&6
-echo "configure:6616: checking for library with inet_addr" >&5
+echo "configure:6641: checking for library with inet_addr" >&5
 if eval "test \"`echo '$''{'cf_cv_lib_inet_addr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6622,7 +6647,7 @@ else
 	    do
 		LIBS="$cf_save_LIBS $cf_inetlib"
 		cat > conftest.$ac_ext <<EOF
-#line 6626 "configure"
+#line 6651 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6633,7 +6658,7 @@ int main() {
 inet_addr(0)
 ; return 0; }
 EOF
-if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_lib_inet_addr=$cf_inetlib
 else
@@ -6666,7 +6691,7 @@ no) #(vi
   ;;
 yes) #(vi
   echo $ac_n "checking for SSL_get_version in -lssl""... $ac_c" 1>&6
-echo "configure:6670: checking for SSL_get_version in -lssl" >&5
+echo "configure:6695: checking for SSL_get_version in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSL_get_version | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6674,7 +6699,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6678 "configure"
+#line 6703 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6685,7 +6710,7 @@ int main() {
 SSL_get_version()
 ; return 0; }
 EOF
-if { (eval echo configure:6689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6740,9 +6765,9 @@ esac
 LIBS="$cf_ssl_library $LIBS"
 
 echo $ac_n "checking for openssl include directory""... $ac_c" 1>&6
-echo "configure:6744: checking for openssl include directory" >&5
+echo "configure:6769: checking for openssl include directory" >&5
 cat > conftest.$ac_ext <<EOF
-#line 6746 "configure"
+#line 6771 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6751,7 +6776,7 @@ int main() {
 SSL_shutdown((SSL *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:6755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_openssl_incl=yes
 else
@@ -6768,9 +6793,9 @@ EOF
 
 
 echo $ac_n "checking if we can link to ssl library""... $ac_c" 1>&6
-echo "configure:6772: checking if we can link to ssl library" >&5
+echo "configure:6797: checking if we can link to ssl library" >&5
 cat > conftest.$ac_ext <<EOF
-#line 6774 "configure"
+#line 6799 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6784,7 +6809,7 @@ int main() {
 SSL_shutdown((SSL *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:6788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_ssl_library=yes
 else
@@ -6807,7 +6832,7 @@ fi
 fi
 
 echo $ac_n "checking for screen type""... $ac_c" 1>&6
-echo "configure:6811: checking for screen type" >&5
+echo "configure:6836: checking for screen type" >&5
 if eval "test \"`echo '$''{'cf_cv_screen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6848,7 +6873,7 @@ esac
 case $cf_cv_screen in
 curses)
 	echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:6852: checking for ncurses version" >&5
+echo "configure:6877: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6873,7 +6898,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:6877: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:6902: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -6882,7 +6907,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 6886 "configure"
+#line 6911 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6905,7 +6930,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:6909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6924,16 +6949,16 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 	
 
 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
-echo "configure:6928: checking if we have identified curses libraries" >&5
+echo "configure:6953: checking if we have identified curses libraries" >&5
 cat > conftest.$ac_ext <<EOF
-#line 6930 "configure"
+#line 6955 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto("?", 0,0)
 ; return 0; }
 EOF
-if { (eval echo configure:6937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -6949,7 +6974,7 @@ if test "$cf_result" = no ; then
 case $host_os in #(vi
 freebsd*) #(vi
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:6953: checking for tgoto in -lmytinfo" >&5
+echo "configure:6978: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6957,7 +6982,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6961 "configure"
+#line 6986 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6968,7 +6993,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:6972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6991,7 +7016,7 @@ fi
 	;;
 hpux10.*|hpux11.*) #(vi
 	echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
-echo "configure:6995: checking for initscr in -lcur_colr" >&5
+echo "configure:7020: checking for initscr in -lcur_colr" >&5
 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6999,7 +7024,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_colr  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7003 "configure"
+#line 7028 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7010,7 +7035,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7034,7 +7059,7 @@ else
   echo "$ac_t""no" 1>&6
 
 	echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:7038: checking for initscr in -lHcurses" >&5
+echo "configure:7063: checking for initscr in -lHcurses" >&5
 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7042,7 +7067,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7046 "configure"
+#line 7071 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7053,7 +7078,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7109,12 +7134,12 @@ if test ".$ac_cv_func_initscr" != .yes ; then
 	# Check for library containing tgoto.  Do this before curses library
 	# because it may be needed to link the test-case for initscr.
 	echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:7113: checking for tgoto" >&5
+echo "configure:7138: checking for tgoto" >&5
 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7118 "configure"
+#line 7143 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
@@ -7137,7 +7162,7 @@ tgoto();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
@@ -7158,7 +7183,7 @@ else
 		for cf_term_lib in $cf_check_list termcap termlib unknown
 		do
 			echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
-echo "configure:7162: checking for tgoto in -l$cf_term_lib" >&5
+echo "configure:7187: checking for tgoto in -l$cf_term_lib" >&5
 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7166,7 +7191,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_term_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7170 "configure"
+#line 7195 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7177,7 +7202,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:7181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7207,7 +7232,7 @@ fi
 	for cf_curs_lib in $cf_check_list xcurses jcurses unknown
 	do
 		echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
-echo "configure:7211: checking for initscr in -l$cf_curs_lib" >&5
+echo "configure:7236: checking for initscr in -l$cf_curs_lib" >&5
 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7215,7 +7240,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_curs_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7219 "configure"
+#line 7244 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7226,7 +7251,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7252,16 +7277,16 @@ fi
 	LIBS="-l$cf_curs_lib $cf_save_LIBS"
 	if test "$cf_term_lib" = unknown ; then
 		echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
-echo "configure:7256: checking if we can link with $cf_curs_lib library" >&5
+echo "configure:7281: checking if we can link with $cf_curs_lib library" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 7258 "configure"
+#line 7283 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -7277,16 +7302,16 @@ rm -f conftest*
 		:
 	elif test "$cf_term_lib" != predefined ; then
 		echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
-echo "configure:7281: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo "configure:7306: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 7283 "configure"
+#line 7308 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:7290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=no
 else
@@ -7296,14 +7321,14 @@ else
   
 			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
 			cat > conftest.$ac_ext <<EOF
-#line 7300 "configure"
+#line 7325 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -7324,14 +7349,14 @@ fi
 
 	
 echo $ac_n "checking for curses performance tradeoff""... $ac_c" 1>&6
-echo "configure:7328: checking for curses performance tradeoff" >&5
+echo "configure:7353: checking for curses performance tradeoff" >&5
 if eval "test \"`echo '$''{'cf_cv_curs_performance'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cf_cv_curs_performance=no
     cat > conftest.$ac_ext <<EOF
-#line 7335 "configure"
+#line 7360 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7345,11 +7370,11 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:7349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 7353 "configure"
+#line 7378 "configure"
 #include "confdefs.h"
 
 #define CURS_PERFORMANCE
@@ -7364,7 +7389,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:7368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_curs_performance=yes
 else
@@ -7389,13 +7414,13 @@ EOF
 ncurses)
 	
 echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6
-echo "configure:7393: checking for ncurses header file" >&5
+echo "configure:7418: checking for ncurses header file" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7399 "configure"
+#line 7424 "configure"
 #include "confdefs.h"
 #include <curses.h>
 int main() {
@@ -7412,7 +7437,7 @@ make an error
 	
 ; return 0; }
 EOF
-if { (eval echo configure:7416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_header=predefined
 else
@@ -7512,7 +7537,7 @@ done
 	;;
 esac
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:7516: checking for ncurses version" >&5
+echo "configure:7541: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7537,7 +7562,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:7541: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:7566: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -7546,7 +7571,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 7550 "configure"
+#line 7575 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7569,7 +7594,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:7573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -7594,7 +7619,7 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:7598: checking for Gpm_Open in -lgpm" >&5
+echo "configure:7623: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7602,7 +7627,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7606 "configure"
+#line 7631 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7613,7 +7638,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:7617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7629,7 +7654,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:7633: checking for initscr in -lgpm" >&5
+echo "configure:7658: checking for initscr in -lgpm" >&5
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7637,7 +7662,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7641 "configure"
+#line 7666 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7648,7 +7673,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7679,7 +7704,7 @@ freebsd*)
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:7683: checking for tgoto in -lmytinfo" >&5
+echo "configure:7708: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7687,7 +7712,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7691 "configure"
+#line 7716 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7698,7 +7723,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:7702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7726,12 +7751,12 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 	eval 'cf_cv_have_lib_'ncurses'=no'
 	cf_libdir=""
 	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:7730: checking for initscr" >&5
+echo "configure:7755: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7735 "configure"
+#line 7760 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -7754,7 +7779,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -7774,17 +7799,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:7778: checking for initscr in -lncurses" >&5
+echo "configure:7803: checking for initscr in -lncurses" >&5
 		LIBS="-lncurses $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 7781 "configure"
+#line 7806 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 eval 'cf_cv_have_lib_'ncurses'=yes'
@@ -7828,17 +7853,17 @@ cf_search="$cf_search $HOME/lib $HOME/lib/ncurses $HOME/ncurses/lib"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6
-echo "configure:7832: checking for -lncurses in $cf_libdir" >&5
+echo "configure:7857: checking for -lncurses in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 7835 "configure"
+#line 7860 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 eval 'cf_cv_have_lib_'ncurses'=yes'
@@ -7868,7 +7893,7 @@ fi
 
 if test -n "$cf_ncurses_LIBS" ; then
 	echo $ac_n "checking if we can link ncurses without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:7872: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
+echo "configure:7897: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
 		q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'`
@@ -7877,14 +7902,14 @@ echo "configure:7872: checking if we can link ncurses without $cf_ncurses_LIBS"
 		fi
 	done
 	cat > conftest.$ac_ext <<EOF
-#line 7881 "configure"
+#line 7906 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:7888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -7898,7 +7923,7 @@ rm -f conftest*
 fi
 
 	echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:7902: checking for ncurses version" >&5
+echo "configure:7927: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7923,7 +7948,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:7927: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:7952: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -7932,7 +7957,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 7936 "configure"
+#line 7961 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7955,7 +7980,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:7959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -7978,20 +8003,20 @@ pdcurses)
 slang)
 	
 echo $ac_n "checking for slang header file""... $ac_c" 1>&6
-echo "configure:7982: checking for slang header file" >&5
+echo "configure:8007: checking for slang header file" >&5
 if eval "test \"`echo '$''{'cf_cv_slang_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7988 "configure"
+#line 8013 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 printf("%s\n", SLANG_VERSION)
 ; return 0; }
 EOF
-if { (eval echo configure:7995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_slang_header=predefined
 else
@@ -8087,24 +8112,24 @@ else
   
 cf_cv_termlib=none
 cat > conftest.$ac_ext <<EOF
-#line 8091 "configure"
+#line 8116 "configure"
 #include "confdefs.h"
 
 int main() {
 char *x=(char*)tgoto("",0,0)
 ; return 0; }
 EOF
-if { (eval echo configure:8098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 8101 "configure"
+#line 8126 "configure"
 #include "confdefs.h"
 
 int main() {
 int x=tigetstr("")
 ; return 0; }
 EOF
-if { (eval echo configure:8108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_termlib=terminfo
 else
@@ -8133,16 +8158,16 @@ if test "$cf_cv_termlib" = none; then
 	for cf_func in tigetstr tgetstr
 	do
 		echo $ac_n "checking for $cf_func in -l$cf_lib""... $ac_c" 1>&6
-echo "configure:8137: checking for $cf_func in -l$cf_lib" >&5
+echo "configure:8162: checking for $cf_func in -l$cf_lib" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 8139 "configure"
+#line 8164 "configure"
 #include "confdefs.h"
 
 int main() {
 int x=$cf_func("")
 ; return 0; }
 EOF
-if { (eval echo configure:8146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -8169,7 +8194,7 @@ fi
 if test "$cf_cv_termlib" = none; then
 	# allow curses library for broken AIX system.
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:8173: checking for initscr in -lcurses" >&5
+echo "configure:8198: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8177,7 +8202,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8181 "configure"
+#line 8206 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8188,7 +8213,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:8192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8209,7 +8234,7 @@ else
 fi
 
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:8213: checking for tgoto in -ltermcap" >&5
+echo "configure:8238: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8217,7 +8242,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8221 "configure"
+#line 8246 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8228,7 +8253,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:8232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8253,19 +8278,19 @@ fi
 fi
 rm -f conftest*
 if test "$cf_cv_termlib" = none; then
-	{ echo "configure: error: Can't find -ltermlib, -lcurses, or -ltermcap" 1>&2; exit 1; }
+	echo "configure: warning: Cannot find -ltermlib, -lcurses, or -ltermcap" 1>&2
 fi
 
 fi
 
 cf_slang_LIBS2="$LIBS"
 echo $ac_n "checking for acos""... $ac_c" 1>&6
-echo "configure:8264: checking for acos" >&5
+echo "configure:8289: checking for acos" >&5
 if eval "test \"`echo '$''{'ac_cv_func_acos'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8269 "configure"
+#line 8294 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char acos(); below.  */
@@ -8288,7 +8313,7 @@ acos();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_acos=yes"
 else
@@ -8307,7 +8332,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for acos in -lm""... $ac_c" 1>&6
-echo "configure:8311: checking for acos in -lm" >&5
+echo "configure:8336: checking for acos in -lm" >&5
 ac_lib_var=`echo m'_'acos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8315,7 +8340,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm $LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8319 "configure"
+#line 8344 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8326,7 +8351,7 @@ int main() {
 acos()
 ; return 0; }
 EOF
-if { (eval echo configure:8330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8368,12 +8393,12 @@ os2*)
 	eval 'cf_cv_have_lib_'video'=no'
 	cf_libdir=""
 	echo $ac_n "checking for v_init""... $ac_c" 1>&6
-echo "configure:8372: checking for v_init" >&5
+echo "configure:8397: checking for v_init" >&5
 if eval "test \"`echo '$''{'ac_cv_func_v_init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8377 "configure"
+#line 8402 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char v_init(); below.  */
@@ -8396,7 +8421,7 @@ v_init();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_v_init=yes"
 else
@@ -8416,17 +8441,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for v_init in -lvideo""... $ac_c" 1>&6
-echo "configure:8420: checking for v_init in -lvideo" >&5
+echo "configure:8445: checking for v_init in -lvideo" >&5
 		LIBS="-lvideo $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 8423 "configure"
+#line 8448 "configure"
 #include "confdefs.h"
 #include <sys/video.h>
 int main() {
 v_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 eval 'cf_cv_have_lib_'video'=yes'
@@ -8470,17 +8495,17 @@ cf_search="$cf_search $HOME/lib $HOME/lib/video $HOME/video/lib"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lvideo in $cf_libdir""... $ac_c" 1>&6
-echo "configure:8474: checking for -lvideo in $cf_libdir" >&5
+echo "configure:8499: checking for -lvideo in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lvideo $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 8477 "configure"
+#line 8502 "configure"
 #include "confdefs.h"
 #include <sys/video.h>
 int main() {
 v_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 eval 'cf_cv_have_lib_'video'=yes'
@@ -8513,12 +8538,12 @@ esac
 	eval 'cf_cv_have_lib_'slang'=no'
 	cf_libdir=""
 	echo $ac_n "checking for SLtt_get_screen_size""... $ac_c" 1>&6
-echo "configure:8517: checking for SLtt_get_screen_size" >&5
+echo "configure:8542: checking for SLtt_get_screen_size" >&5
 if eval "test \"`echo '$''{'ac_cv_func_SLtt_get_screen_size'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8522 "configure"
+#line 8547 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char SLtt_get_screen_size(); below.  */
@@ -8541,7 +8566,7 @@ SLtt_get_screen_size();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_SLtt_get_screen_size=yes"
 else
@@ -8561,17 +8586,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for SLtt_get_screen_size in -lslang""... $ac_c" 1>&6
-echo "configure:8565: checking for SLtt_get_screen_size in -lslang" >&5
+echo "configure:8590: checking for SLtt_get_screen_size in -lslang" >&5
 		LIBS="-lslang $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 8568 "configure"
+#line 8593 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:8575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 eval 'cf_cv_have_lib_'slang'=yes'
@@ -8615,17 +8640,17 @@ cf_search="$cf_search $HOME/lib $HOME/lib/slang $HOME/slang/lib"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lslang in $cf_libdir""... $ac_c" 1>&6
-echo "configure:8619: checking for -lslang in $cf_libdir" >&5
+echo "configure:8644: checking for -lslang in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lslang $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 8622 "configure"
+#line 8647 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:8629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 eval 'cf_cv_have_lib_'slang'=yes'
@@ -8654,7 +8679,7 @@ fi
 
 cf_slang_LIBS3="$LIBS"
 echo $ac_n "checking if we can link slang without termcap""... $ac_c" 1>&6
-echo "configure:8658: checking if we can link slang without termcap" >&5
+echo "configure:8683: checking if we can link slang without termcap" >&5
 if test -n "`echo $cf_slang_LIBS1 | sed -e 's/ //g'`" ; then
 	cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s@$cf_slang_LIBS1@@" -e 's@^.@@'`
 else
@@ -8662,14 +8687,14 @@ else
 fi
 LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s@$cf_exclude@@" -e 's@^.@@'`
 cat > conftest.$ac_ext <<EOF
-#line 8666 "configure"
+#line 8691 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -8686,13 +8711,13 @@ test $cf_result = no && LIBS="$cf_slang_LIBS3"
 
 
 echo $ac_n "checking if we must tell slang this is UNIX""... $ac_c" 1>&6
-echo "configure:8690: checking if we must tell slang this is UNIX" >&5
+echo "configure:8715: checking if we must tell slang this is UNIX" >&5
 if eval "test \"`echo '$''{'cf_cv_slang_unix'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8696 "configure"
+#line 8721 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
@@ -8706,7 +8731,7 @@ SLang_TT_Baud_Rate = 1
 
 ; return 0; }
 EOF
-if { (eval echo configure:8710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_slang_unix=yes
 else
@@ -8732,7 +8757,7 @@ eval cf_libdir=$libdir
 cf_libdir=`echo $cf_libdir | sed -e s@'^NONE/'@$prefix/@ -e s@'^NONE/'@$ac_default_prefix/@`
 
 echo $ac_n "checking for location of config-file""... $ac_c" 1>&6
-echo "configure:8736: checking for location of config-file" >&5
+echo "configure:8761: checking for location of config-file" >&5
 LYNX_CFG_FILE=$cf_libdir/lynx.cfg
 cat >> confdefs.h <<EOF
 #define LYNX_CFG_FILE "$LYNX_CFG_FILE"
@@ -8744,7 +8769,7 @@ CHARSET_DEFS=
 
 
 echo $ac_n "checking if you want only a few charsets""... $ac_c" 1>&6
-echo "configure:8748: checking if you want only a few charsets" >&5
+echo "configure:8773: checking if you want only a few charsets" >&5
 
 # Check whether --with-charsets or --without-charsets was given.
 if test "${with_charsets+set}" = set; then
@@ -8805,12 +8830,12 @@ fi
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:8809: checking for ANSI C header files" >&5
+echo "configure:8834: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8814 "configure"
+#line 8839 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -8818,7 +8843,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8835,7 +8860,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 8839 "configure"
+#line 8864 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -8853,7 +8878,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 8857 "configure"
+#line 8882 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -8874,7 +8899,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 8878 "configure"
+#line 8903 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -8885,7 +8910,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:8889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -8909,12 +8934,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:8913: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:8938: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8918 "configure"
+#line 8943 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -8923,7 +8948,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:8927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -8948,12 +8973,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:8952: checking for $ac_hdr that defines DIR" >&5
+echo "configure:8977: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8957 "configure"
+#line 8982 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -8961,7 +8986,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -8986,7 +9011,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:8990: checking for opendir in -ldir" >&5
+echo "configure:9015: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8994,7 +9019,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8998 "configure"
+#line 9023 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9005,7 +9030,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:9009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9027,7 +9052,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:9031: checking for opendir in -lx" >&5
+echo "configure:9056: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9035,7 +9060,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9039 "configure"
+#line 9064 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9046,7 +9071,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:9050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9088,17 +9113,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9092: checking for $ac_hdr" >&5
+echo "configure:9117: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9097 "configure"
+#line 9122 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9126,13 +9151,13 @@ done
 
 
 echo $ac_n "checking termio.h and termios.h""... $ac_c" 1>&6
-echo "configure:9130: checking termio.h and termios.h" >&5
+echo "configure:9155: checking termio.h and termios.h" >&5
 if eval "test \"`echo '$''{'cf_cv_termio_and_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 9136 "configure"
+#line 9161 "configure"
 #include "confdefs.h"
 
 #if HAVE_TERMIO_H
@@ -9145,7 +9170,7 @@ int main() {
 putchar (0x0a)
 ; return 0; }
 EOF
-if { (eval echo configure:9149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_termio_and_termios=yes
 else
@@ -9165,13 +9190,13 @@ EOF
 
 
 echo $ac_n "checking for sigaction and structs""... $ac_c" 1>&6
-echo "configure:9169: checking for sigaction and structs" >&5
+echo "configure:9194: checking for sigaction and structs" >&5
 if eval "test \"`echo '$''{'cf_cv_func_sigaction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9175 "configure"
+#line 9200 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9186,7 +9211,7 @@ struct sigaction act;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:9190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_func_sigaction=yes
 else
@@ -9210,17 +9235,17 @@ for ac_hdr in sys/wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9214: checking for $ac_hdr" >&5
+echo "configure:9239: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9219 "configure"
+#line 9244 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9257,17 +9282,17 @@ for ac_hdr in wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9261: checking for $ac_hdr" >&5
+echo "configure:9286: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9266 "configure"
+#line 9291 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9297,17 +9322,17 @@ for ac_hdr in waitstatus.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9301: checking for $ac_hdr" >&5
+echo "configure:9326: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9306 "configure"
+#line 9331 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9348,13 +9373,13 @@ fi
 
 
 echo $ac_n "checking for union wait""... $ac_c" 1>&6
-echo "configure:9352: checking for union wait" >&5
+echo "configure:9377: checking for union wait" >&5
 if eval "test \"`echo '$''{'cf_cv_type_unionwait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 9358 "configure"
+#line 9383 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -9365,7 +9390,7 @@ int x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:9369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_type_unionwait=no
 	 echo compiles ok w/o union wait 1>&5
@@ -9376,7 +9401,7 @@ else
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 9380 "configure"
+#line 9405 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -9391,7 +9416,7 @@ union wait x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:9395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_type_unionwait=yes
 	 echo compiles ok with union wait and possibly macros too 1>&5
@@ -9418,20 +9443,20 @@ EOF
 if test $cf_cv_type_unionwait = yes; then
 
 	echo $ac_n "checking if union wait can be used as wait-arg""... $ac_c" 1>&6
-echo "configure:9422: checking if union wait can be used as wait-arg" >&5
+echo "configure:9447: checking if union wait can be used as wait-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_wait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 9428 "configure"
+#line 9453 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; wait(&x)
 ; return 0; }
 EOF
-if { (eval echo configure:9435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_wait=yes
 else
@@ -9451,20 +9476,20 @@ EOF
 
 
 	echo $ac_n "checking if union wait can be used as waitpid-arg""... $ac_c" 1>&6
-echo "configure:9455: checking if union wait can be used as waitpid-arg" >&5
+echo "configure:9480: checking if union wait can be used as waitpid-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_waitpid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 9461 "configure"
+#line 9486 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; waitpid(0, &x, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:9468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_waitpid=yes
 else
@@ -9490,17 +9515,17 @@ for ac_hdr in stdarg.h varargs.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9494: checking for $ac_hdr" >&5
+echo "configure:9519: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9499 "configure"
+#line 9524 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9527,13 +9552,13 @@ fi
 done
 
 echo $ac_n "checking for standard varargs""... $ac_c" 1>&6
-echo "configure:9531: checking for standard varargs" >&5
+echo "configure:9556: checking for standard varargs" >&5
 if eval "test \"`echo '$''{'cf_cv_ansi_varargs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 9537 "configure"
+#line 9562 "configure"
 #include "confdefs.h"
 
 #if HAVE_STDARG_H
@@ -9548,7 +9573,7 @@ int main() {
 return 0;} int foo(char *fmt,...){va_list args;va_start(args,fmt);va_end(args)
 ; return 0; }
 EOF
-if { (eval echo configure:9552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_varargs=yes
 else
@@ -9568,12 +9593,12 @@ EOF
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:9572: checking for uid_t in sys/types.h" >&5
+echo "configure:9597: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9577 "configure"
+#line 9602 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -9602,7 +9627,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:9606: checking type of array argument to getgroups" >&5
+echo "configure:9631: checking type of array argument to getgroups" >&5
 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9610,7 +9635,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9614 "configure"
+#line 9639 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -9635,7 +9660,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:9639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -9649,7 +9674,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 9653 "configure"
+#line 9678 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -9673,12 +9698,12 @@ EOF
 
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:9677: checking for pid_t" >&5
+echo "configure:9702: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9682 "configure"
+#line 9707 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -9706,12 +9731,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:9710: checking for uid_t in sys/types.h" >&5
+echo "configure:9735: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9715 "configure"
+#line 9740 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -9740,12 +9765,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:9744: checking for mode_t" >&5
+echo "configure:9769: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9749 "configure"
+#line 9774 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -9776,17 +9801,17 @@ fi
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:9780: checking for vfork.h" >&5
+echo "configure:9805: checking for vfork.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9785 "configure"
+#line 9810 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9811,18 +9836,18 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:9815: checking for working vfork" >&5
+echo "configure:9840: checking for working vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:9821: checking for vfork" >&5
+echo "configure:9846: checking for vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9826 "configure"
+#line 9851 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -9845,7 +9870,7 @@ vfork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vfork=yes"
 else
@@ -9867,7 +9892,7 @@ fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 else
   cat > conftest.$ac_ext <<EOF
-#line 9871 "configure"
+#line 9896 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -9962,7 +9987,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:9966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_vfork_works=yes
 else
@@ -9986,13 +10011,13 @@ fi
 
 
 echo $ac_n "checking if we should use fcntl or ioctl""... $ac_c" 1>&6
-echo "configure:9990: checking if we should use fcntl or ioctl" >&5
+echo "configure:10015: checking if we should use fcntl or ioctl" >&5
 if eval "test \"`echo '$''{'cf_cv_fionbio'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9996 "configure"
+#line 10021 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10004,7 +10029,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:10008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_fionbio=ioctl
 else
@@ -10013,7 +10038,7 @@ else
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 10017 "configure"
+#line 10042 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10030,7 +10055,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:10034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_fionbio=fcntl
 else
@@ -10053,20 +10078,20 @@ EOF
 
 
 echo $ac_n "checking for broken/missing definition of remove""... $ac_c" 1>&6
-echo "configure:10057: checking for broken/missing definition of remove" >&5
+echo "configure:10082: checking for broken/missing definition of remove" >&5
 if eval "test \"`echo '$''{'cf_cv_baddef_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 10063 "configure"
+#line 10088 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:10070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_baddef_remove=no
 else
@@ -10074,7 +10099,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 10078 "configure"
+#line 10103 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 		int __unlink(name) { return unlink(name); } 
@@ -10082,7 +10107,7 @@ int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:10086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_baddef_remove=yes
 else
@@ -10106,13 +10131,13 @@ EOF
 
 
 echo $ac_n "checking for lstat""... $ac_c" 1>&6
-echo "configure:10110: checking for lstat" >&5
+echo "configure:10135: checking for lstat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_lstat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 10116 "configure"
+#line 10141 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10121,7 +10146,7 @@ int main() {
 lstat(".", (struct stat *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:10125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_lstat=yes
 else
@@ -10164,12 +10189,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10168: checking for $ac_func" >&5
+echo "configure:10193: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10173 "configure"
+#line 10198 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10192,7 +10217,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10222,12 +10247,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10226: checking for $ac_func" >&5
+echo "configure:10251: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10231 "configure"
+#line 10256 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10250,7 +10275,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10279,7 +10304,7 @@ done
 
 
 echo $ac_n "checking for random-integer functions""... $ac_c" 1>&6
-echo "configure:10283: checking for random-integer functions" >&5
+echo "configure:10308: checking for random-integer functions" >&5
 if eval "test \"`echo '$''{'cf_cv_srand_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10290,7 +10315,7 @@ do
 	cf_srand_func=`echo $cf_func | sed -e 's@/.*@@'`
 	cf_rand_func=`echo  $cf_func | sed -e 's@.*/@@'`
 cat > conftest.$ac_ext <<EOF
-#line 10294 "configure"
+#line 10319 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -10304,7 +10329,7 @@ int main() {
 long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func()
 ; return 0; }
 EOF
-if { (eval echo configure:10308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_srand_func=$cf_func
  break
@@ -10320,7 +10345,7 @@ fi
 echo "$ac_t""$cf_cv_srand_func" 1>&6
 if test "$cf_cv_srand_func" != unknown ; then
 	echo $ac_n "checking for range of random-integers""... $ac_c" 1>&6
-echo "configure:10324: checking for range of random-integers" >&5
+echo "configure:10349: checking for range of random-integers" >&5
 if eval "test \"`echo '$''{'cf_cv_rand_max'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10336,7 +10361,7 @@ else
 			;;
 		esac
 		cat > conftest.$ac_ext <<EOF
-#line 10340 "configure"
+#line 10365 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -10350,7 +10375,7 @@ int main() {
 long x = $cf_cv_rand_max
 ; return 0; }
 EOF
-if { (eval echo configure:10354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -10386,12 +10411,12 @@ for ac_func in strstr
 do
 
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:10390: checking for $ac_func declaration" >&5
+echo "configure:10415: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10395 "configure"
+#line 10420 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -10400,11 +10425,11 @@ extern	int	${ac_func}();
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:10404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 10408 "configure"
+#line 10433 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -10413,7 +10438,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:10417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 eval "ac_cv_func_decl_$ac_func=yes"
@@ -10455,12 +10480,12 @@ for ac_func in getgrgid getgrnam
 do
 
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:10459: checking for $ac_func declaration" >&5
+echo "configure:10484: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10464 "configure"
+#line 10489 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -10471,11 +10496,11 @@ extern	int	${ac_func}();
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:10475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 10479 "configure"
+#line 10504 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -10486,7 +10511,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:10490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 eval "ac_cv_func_decl_$ac_func=yes"
@@ -10528,13 +10553,13 @@ done
 
 
 echo $ac_n "checking if TRUE/FALSE are defined""... $ac_c" 1>&6
-echo "configure:10532: checking if TRUE/FALSE are defined" >&5
+echo "configure:10557: checking if TRUE/FALSE are defined" >&5
 if eval "test \"`echo '$''{'cf_cv_bool_defs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 10538 "configure"
+#line 10563 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -10543,7 +10568,7 @@ int main() {
 int x = TRUE, y = FALSE
 ; return 0; }
 EOF
-if { (eval echo configure:10547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_bool_defs=yes
 else
@@ -10570,13 +10595,13 @@ fi
 
 
 echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6
-echo "configure:10574: checking if external errno is declared" >&5
+echo "configure:10599: checking if external errno is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 10580 "configure"
+#line 10605 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -10589,7 +10614,7 @@ int main() {
 long x = (long) errno
 ; return 0; }
 EOF
-if { (eval echo configure:10593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'errno'=yes'
 else
@@ -10620,13 +10645,13 @@ fi
 # It's possible (for near-UNIX clones) that the data doesn't exist
 
 echo $ac_n "checking if external errno exists""... $ac_c" 1>&6
-echo "configure:10624: checking if external errno exists" >&5
+echo "configure:10649: checking if external errno exists" >&5
 if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 10630 "configure"
+#line 10655 "configure"
 #include "confdefs.h"
 
 #undef errno
@@ -10636,7 +10661,7 @@ int main() {
 errno = 2
 ; return 0; }
 EOF
-if { (eval echo configure:10640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval 'cf_cv_have_'errno'=yes'
 else
@@ -10668,21 +10693,21 @@ fi
 
 
 echo $ac_n "checking if we can set errno""... $ac_c" 1>&6
-echo "configure:10672: checking if we can set errno" >&5
+echo "configure:10697: checking if we can set errno" >&5
 if eval "test \"`echo '$''{'cf_cv_set_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 10679 "configure"
+#line 10704 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 255
 ; return 0; }
 EOF
-if { (eval echo configure:10686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_set_errno=maybe
 else
@@ -10694,7 +10719,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 10698 "configure"
+#line 10723 "configure"
 #include "confdefs.h"
 
 #include <errno.h>
@@ -10704,7 +10729,7 @@ int main()
 	exit(errno != 255);
 }
 EOF
-if { (eval echo configure:10708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   cf_cv_set_errno=yes
 else
@@ -10727,20 +10752,20 @@ EOF
 
 
 echo $ac_n "checking for setlocale()""... $ac_c" 1>&6
-echo "configure:10731: checking for setlocale()" >&5
+echo "configure:10756: checking for setlocale()" >&5
 if eval "test \"`echo '$''{'cf_cv_locale'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 10737 "configure"
+#line 10762 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 setlocale(LC_ALL, "")
 ; return 0; }
 EOF
-if { (eval echo configure:10744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_locale=yes
 else
@@ -10761,13 +10786,13 @@ EOF
 
 
 echo $ac_n "checking if NGROUPS is defined""... $ac_c" 1>&6
-echo "configure:10765: checking if NGROUPS is defined" >&5
+echo "configure:10790: checking if NGROUPS is defined" >&5
 if eval "test \"`echo '$''{'cf_cv_ngroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 10771 "configure"
+#line 10796 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -10781,7 +10806,7 @@ int main() {
 int x = NGROUPS
 ; return 0; }
 EOF
-if { (eval echo configure:10785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=yes
 else
@@ -10789,7 +10814,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 10793 "configure"
+#line 10818 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -10803,7 +10828,7 @@ int main() {
 int x = NGROUPS_MAX
 ; return 0; }
 EOF
-if { (eval echo configure:10807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=NGROUPS_MAX
 else
@@ -10837,13 +10862,13 @@ for cf_name in sys_nerr sys_errlist
 do
     
 echo $ac_n "checking if external $cf_name is declared""... $ac_c" 1>&6
-echo "configure:10841: checking if external $cf_name is declared" >&5
+echo "configure:10866: checking if external $cf_name is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 10847 "configure"
+#line 10872 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -10856,7 +10881,7 @@ int main() {
 long x = (long) $cf_name
 ; return 0; }
 EOF
-if { (eval echo configure:10860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'$cf_name'=yes'
 else
@@ -10887,13 +10912,13 @@ fi
 # It's possible (for near-UNIX clones) that the data doesn't exist
 
 echo $ac_n "checking if external $cf_name exists""... $ac_c" 1>&6
-echo "configure:10891: checking if external $cf_name exists" >&5
+echo "configure:10916: checking if external $cf_name exists" >&5
 if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 10897 "configure"
+#line 10922 "configure"
 #include "confdefs.h"
 
 #undef $cf_name
@@ -10903,7 +10928,7 @@ int main() {
 $cf_name = 2
 ; return 0; }
 EOF
-if { (eval echo configure:10907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval 'cf_cv_have_'$cf_name'=yes'
 else
@@ -10939,17 +10964,17 @@ for ac_hdr in lastlog.h paths.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10943: checking for $ac_hdr" >&5
+echo "configure:10968: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10948 "configure"
+#line 10973 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10976,13 +11001,13 @@ fi
 done
 
 echo $ac_n "checking for lastlog path""... $ac_c" 1>&6
-echo "configure:10980: checking for lastlog path" >&5
+echo "configure:11005: checking for lastlog path" >&5
 if eval "test \"`echo '$''{'cf_cv_path_lastlog'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 10986 "configure"
+#line 11011 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10997,7 +11022,7 @@ int main() {
 char *path = _PATH_LASTLOG
 ; return 0; }
 EOF
-if { (eval echo configure:11001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_path_lastlog="_PATH_LASTLOG"
 else
@@ -11024,7 +11049,7 @@ EOF
 
 
 echo $ac_n "checking for utmp implementation""... $ac_c" 1>&6
-echo "configure:11028: checking for utmp implementation" >&5
+echo "configure:11053: checking for utmp implementation" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11032,7 +11057,7 @@ else
 	cf_cv_have_utmp=no
 for cf_header in utmpx utmp ; do
 	cat > conftest.$ac_ext <<EOF
-#line 11036 "configure"
+#line 11061 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11048,7 +11073,7 @@ struct $cf_header x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:11052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=$cf_header
 	 break
@@ -11058,7 +11083,7 @@ else
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 11062 "configure"
+#line 11087 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11074,7 +11099,7 @@ struct $cf_header x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:11078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=$cf_header
 	 cat >> confdefs.h <<\EOF
@@ -11109,13 +11134,13 @@ EOF
 
 if test $cf_cv_have_utmp != no ; then
 echo $ac_n "checking if utmp.ut_host is declared""... $ac_c" 1>&6
-echo "configure:11113: checking if utmp.ut_host is declared" >&5
+echo "configure:11138: checking if utmp.ut_host is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_host'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 11119 "configure"
+#line 11144 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11124,7 +11149,7 @@ int main() {
 struct $cf_cv_have_utmp x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:11128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp_ut_host=yes
 else
@@ -11148,7 +11173,7 @@ fi
 
 if test $cf_cv_have_utmp != no ; then
 echo $ac_n "checking for exit-status in $cf_cv_have_utmp""... $ac_c" 1>&6
-echo "configure:11152: checking for exit-status in $cf_cv_have_utmp" >&5
+echo "configure:11177: checking for exit-status in $cf_cv_have_utmp" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_xstatus'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11160,7 +11185,7 @@ for cf_result in \
 	ut_exit.ut_exit
 do
 cat > conftest.$ac_ext <<EOF
-#line 11164 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11169,7 +11194,7 @@ int main() {
 struct $cf_cv_have_utmp x; long y = x.$cf_result = 0
 ; return 0; }
 EOF
-if { (eval echo configure:11173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp_ut_xstatus=$cf_result
 	 break
@@ -11201,13 +11226,13 @@ fi
 
 if test $cf_cv_have_utmp != no ; then
 echo $ac_n "checking if utmp.ut_xtime is declared""... $ac_c" 1>&6
-echo "configure:11205: checking if utmp.ut_xtime is declared" >&5
+echo "configure:11230: checking if utmp.ut_xtime is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_xtime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 11211 "configure"
+#line 11236 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11216,7 +11241,7 @@ int main() {
 struct $cf_cv_have_utmp x; long y = x.ut_xtime = 0
 ; return 0; }
 EOF
-if { (eval echo configure:11220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp_ut_xtime=yes
 else
@@ -11224,7 +11249,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 11228 "configure"
+#line 11253 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11233,7 +11258,7 @@ int main() {
 struct $cf_cv_have_utmp x; long y = x.ut_tv.tv_sec
 ; return 0; }
 EOF
-if { (eval echo configure:11237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp_ut_xtime=define
 else
@@ -11268,13 +11293,13 @@ fi
 
 if test $cf_cv_have_utmp != no ; then
 echo $ac_n "checking if utmp.ut_session is declared""... $ac_c" 1>&6
-echo "configure:11272: checking if utmp.ut_session is declared" >&5
+echo "configure:11297: checking if utmp.ut_session is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_session'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 11278 "configure"
+#line 11303 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11283,7 +11308,7 @@ int main() {
 struct $cf_cv_have_utmp x; long y = x.ut_session
 ; return 0; }
 EOF
-if { (eval echo configure:11287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp_ut_session=yes
 else
@@ -11308,14 +11333,14 @@ fi
 	
 
 echo $ac_n "checking if $cf_cv_have_utmp is SYSV flavor""... $ac_c" 1>&6
-echo "configure:11312: checking if $cf_cv_have_utmp is SYSV flavor" >&5
+echo "configure:11337: checking if $cf_cv_have_utmp is SYSV flavor" >&5
 if eval "test \"`echo '$''{'cf_cv_sysv_utmp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 test "$cf_cv_have_utmp" = "utmp" && cf_prefix="ut" || cf_prefix="utx"
 cat > conftest.$ac_ext <<EOF
-#line 11319 "configure"
+#line 11344 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11329,7 +11354,7 @@ struct $cf_cv_have_utmp x;
 	end${cf_prefix}ent();
 ; return 0; }
 EOF
-if { (eval echo configure:11333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_sysv_utmp=yes
 else
@@ -11352,13 +11377,13 @@ fi
 
 
 echo $ac_n "checking if external h_errno exists""... $ac_c" 1>&6
-echo "configure:11356: checking if external h_errno exists" >&5
+echo "configure:11381: checking if external h_errno exists" >&5
 if eval "test \"`echo '$''{'cf_cv_have_h_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 11362 "configure"
+#line 11387 "configure"
 #include "confdefs.h"
 
 #undef h_errno
@@ -11368,7 +11393,7 @@ int main() {
 h_errno = 2
 ; return 0; }
 EOF
-if { (eval echo configure:11372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval 'cf_cv_have_'h_errno'=yes'
 else
@@ -11401,7 +11426,7 @@ fi
 if test $cf_cv_screen != slang ; then
 	
 echo $ac_n "checking if curses supports alternate-character set""... $ac_c" 1>&6
-echo "configure:11405: checking if curses supports alternate-character set" >&5
+echo "configure:11430: checking if curses supports alternate-character set" >&5
 if eval "test \"`echo '$''{'cf_cv_alt_char_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11409,7 +11434,7 @@ else
 for mapname in acs_map _acs_map
 do
 	cat > conftest.$ac_ext <<EOF
-#line 11413 "configure"
+#line 11438 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -11418,7 +11443,7 @@ int main() {
 chtype x = $mapname['l']; $mapname['m'] = 0
 ; return 0; }
 EOF
-if { (eval echo configure:11422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_alt_char_set=$mapname
 	 break
@@ -11441,13 +11466,13 @@ EOF
 
 	
 echo $ac_n "checking if curses supports fancy attributes""... $ac_c" 1>&6
-echo "configure:11445: checking if curses supports fancy attributes" >&5
+echo "configure:11470: checking if curses supports fancy attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_fancy_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 11451 "configure"
+#line 11476 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -11460,7 +11485,7 @@ attrset(A_UNDERLINE|A_BOLD|A_REVERSE);
 	
 ; return 0; }
 EOF
-if { (eval echo configure:11464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_fancy_curses=yes
 else
@@ -11483,13 +11508,13 @@ EOF
 
 if test "$cf_cv_ncurses_version" != no ; then
 echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6
-echo "configure:11487: checking for obsolete/broken version of ncurses" >&5
+echo "configure:11512: checking for obsolete/broken version of ncurses" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 11493 "configure"
+#line 11518 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -11503,7 +11528,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_broken=no
 else
@@ -11528,13 +11553,13 @@ fi
 
 	
 echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6
-echo "configure:11532: checking if curses supports color attributes" >&5
+echo "configure:11557: checking if curses supports color attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_color_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 11538 "configure"
+#line 11563 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -11549,7 +11574,7 @@ chtype x = COLOR_BLUE;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:11553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_color_curses=yes
 else
@@ -11583,17 +11608,17 @@ unistd.h \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11587: checking for $ac_hdr" >&5
+echo "configure:11612: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11592 "configure"
+#line 11617 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11624,17 +11649,17 @@ if test "$ISC" = yes ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11628: checking for $ac_hdr" >&5
+echo "configure:11653: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11633 "configure"
+#line 11658 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11669,16 +11694,16 @@ if test "$ac_cv_header_termios_h" = yes ; then
 	esac
 	if test "$termios_bad" = maybe ; then
 	echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6
-echo "configure:11673: checking whether termios.h needs _POSIX_SOURCE" >&5
+echo "configure:11698: checking whether termios.h needs _POSIX_SOURCE" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 11675 "configure"
+#line 11700 "configure"
 #include "confdefs.h"
 #include <termios.h>
 int main() {
 struct termios foo; int x = foo.c_iflag
 ; return 0; }
 EOF
-if { (eval echo configure:11682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   termios_bad=no
 else
@@ -11687,7 +11712,7 @@ else
   rm -rf conftest*
   
 		cat > conftest.$ac_ext <<EOF
-#line 11691 "configure"
+#line 11716 "configure"
 #include "confdefs.h"
 
 #define _POSIX_SOURCE
@@ -11696,7 +11721,7 @@ int main() {
 struct termios foo; int x = foo.c_iflag
 ; return 0; }
 EOF
-if { (eval echo configure:11700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   termios_bad=unknown
 else
@@ -11719,7 +11744,7 @@ fi
 
 
 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
-echo "configure:11723: checking declaration of size-change" >&5
+echo "configure:11748: checking declaration of size-change" >&5
 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11733,7 +11758,7 @@ do
     CPPFLAGS="$cf_save_CPPFLAGS"
     test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts"
     cat > conftest.$ac_ext <<EOF
-#line 11737 "configure"
+#line 11762 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_TERMIOS_H
@@ -11772,7 +11797,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:11776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sizechange=yes
 else
@@ -11811,20 +11836,20 @@ fi
 
 	
 echo $ac_n "checking if ttytype is declared in curses library""... $ac_c" 1>&6
-echo "configure:11815: checking if ttytype is declared in curses library" >&5
+echo "configure:11840: checking if ttytype is declared in curses library" >&5
 if eval "test \"`echo '$''{'cf_cv_have_ttytype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 11821 "configure"
+#line 11846 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 char *x = &ttytype[1]; *x = 1
 ; return 0; }
 EOF
-if { (eval echo configure:11828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_have_ttytype=yes
 else
@@ -11845,13 +11870,13 @@ EOF
 
 	
 echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
-echo "configure:11849: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+echo "configure:11874: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
 if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 11855 "configure"
+#line 11880 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -11861,7 +11886,7 @@ int main() {
 	long x = winnstr(stdscr, "", 0)
 ; return 0; }
 EOF
-if { (eval echo configure:11865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_need_xopen_extension=no
 else
@@ -11869,7 +11894,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 11873 "configure"
+#line 11898 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE_EXTENDED
@@ -11880,7 +11905,7 @@ int main() {
 	long x = winnstr(stdscr, "", 0)
 ; return 0; }
 EOF
-if { (eval echo configure:11884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_need_xopen_extension=yes
 else
@@ -11922,9 +11947,9 @@ do
 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 	echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6
-echo "configure:11926: checking for ${cf_func}" >&5
+echo "configure:11951: checking for ${cf_func}" >&5
 	
-echo "(line 11928) testing ${cf_func} ..." 1>&5
+echo "(line 11953) testing ${cf_func} ..." 1>&5
 
 	if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11933,7 +11958,7 @@ else
 		eval cf_result='$ac_cv_func_'$cf_func
 		if test ".$cf_result" != ".no"; then
 			cat > conftest.$ac_ext <<EOF
-#line 11937 "configure"
+#line 11962 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -11954,7 +11979,7 @@ exit(foo == 0);
 			
 ; return 0; }
 EOF
-if { (eval echo configure:11958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -11986,7 +12011,7 @@ fi
 
 
 echo $ac_n "checking if bibp: URLs should be supported""... $ac_c" 1>&6
-echo "configure:11990: checking if bibp: URLs should be supported" >&5
+echo "configure:12015: checking if bibp: URLs should be supported" >&5
 
 # Check whether --enable-bibp-urls or --disable-bibp-urls was given.
 if test "${enable_bibp_urls+set}" = set; then
@@ -12010,7 +12035,7 @@ EOF
 
 
 echo $ac_n "checking if configuration info should be browsable""... $ac_c" 1>&6
-echo "configure:12014: checking if configuration info should be browsable" >&5
+echo "configure:12039: checking if configuration info should be browsable" >&5
 
 # Check whether --enable-config-info or --disable-config-info was given.
 if test "${enable_config_info+set}" = set; then
@@ -12034,7 +12059,7 @@ EOF
 
 
 echo $ac_n "checking if new-style forms-based options screen should be used""... $ac_c" 1>&6
-echo "configure:12038: checking if new-style forms-based options screen should be used" >&5
+echo "configure:12063: checking if new-style forms-based options screen should be used" >&5
 
 # Check whether --enable-forms-options or --disable-forms-options was given.
 if test "${enable_forms_options+set}" = set; then
@@ -12058,7 +12083,7 @@ EOF
 
 
 echo $ac_n "checking if old-style options menu should be used""... $ac_c" 1>&6
-echo "configure:12062: checking if old-style options menu should be used" >&5
+echo "configure:12087: checking if old-style options menu should be used" >&5
 
 # Check whether --enable-menu-options or --disable-menu-options was given.
 if test "${enable_menu_options+set}" = set; then
@@ -12082,7 +12107,7 @@ EOF
 
 
 echo $ac_n "checking if experimental address-list page should be used""... $ac_c" 1>&6
-echo "configure:12086: checking if experimental address-list page should be used" >&5
+echo "configure:12111: checking if experimental address-list page should be used" >&5
 
 # Check whether --enable-addrlist-page or --disable-addrlist-page was given.
 if test "${enable_addrlist_page+set}" = set; then
@@ -12106,7 +12131,7 @@ EOF
 
 
 echo $ac_n "checking if experimental charset-selection logic should be used""... $ac_c" 1>&6
-echo "configure:12110: checking if experimental charset-selection logic should be used" >&5
+echo "configure:12135: checking if experimental charset-selection logic should be used" >&5
 
 # Check whether --enable-charset-choice or --disable-charset-choice was given.
 if test "${enable_charset_choice+set}" = set; then
@@ -12130,7 +12155,7 @@ EOF
 
 
 echo $ac_n "checking if experimental CJK logic should be used""... $ac_c" 1>&6
-echo "configure:12134: checking if experimental CJK logic should be used" >&5
+echo "configure:12159: checking if experimental CJK logic should be used" >&5
 
 # Check whether --enable-cjk or --disable-cjk was given.
 if test "${enable_cjk+set}" = set; then
@@ -12154,7 +12179,7 @@ EOF
 
 
 echo $ac_n "checking if color-style code should be used""... $ac_c" 1>&6
-echo "configure:12158: checking if color-style code should be used" >&5
+echo "configure:12183: checking if color-style code should be used" >&5
 
 # Check whether --enable-color-style or --disable-color-style was given.
 if test "${enable_color_style+set}" = set; then
@@ -12194,7 +12219,7 @@ EOF
 	echo "$ac_t""yes" 1>&6
 
 	echo $ac_n "checking for location of style-sheet file""... $ac_c" 1>&6
-echo "configure:12198: checking for location of style-sheet file" >&5
+echo "configure:12223: checking for location of style-sheet file" >&5
 	LYNX_LSS_FILE=$cf_libdir/lynx.lss
 	cat >> confdefs.h <<EOF
 #define LYNX_LSS_FILE "$LYNX_LSS_FILE"
@@ -12212,7 +12237,7 @@ test ".$cf_cv_func_use_default_colors" = ".yes" && use_dft_colors=maybe
 
 if test "$use_dft_colors" != no ; then
 echo $ac_n "checking if you want to use default-colors""... $ac_c" 1>&6
-echo "configure:12216: checking if you want to use default-colors" >&5
+echo "configure:12241: checking if you want to use default-colors" >&5
 
 # Check whether --enable-default-colors or --disable-default-colors was given.
 if test "${enable_default_colors+set}" = set; then
@@ -12237,7 +12262,7 @@ EOF
 fi
 
 echo $ac_n "checking if experimental file-upload logic should be used""... $ac_c" 1>&6
-echo "configure:12241: checking if experimental file-upload logic should be used" >&5
+echo "configure:12266: checking if experimental file-upload logic should be used" >&5
 
 # Check whether --enable-file-upload or --disable-file-upload was given.
 if test "${enable_file_upload+set}" = set; then
@@ -12261,7 +12286,7 @@ EOF
 
 
 echo $ac_n "checking if experimental htmlized lynx.cfg should be built""... $ac_c" 1>&6
-echo "configure:12265: checking if experimental htmlized lynx.cfg should be built" >&5
+echo "configure:12290: checking if experimental htmlized lynx.cfg should be built" >&5
 
 # Check whether --enable-htmlized-cfg or --disable-htmlized-cfg was given.
 if test "${enable_htmlized_cfg+set}" = set; then
@@ -12291,7 +12316,7 @@ fi
 
 ### check for ipv6 support
 echo $ac_n "checking whether to enable ipv6""... $ac_c" 1>&6
-echo "configure:12295: checking whether to enable ipv6" >&5
+echo "configure:12320: checking whether to enable ipv6" >&5
 
 # Check whether --enable-ipv6 or --disable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then
@@ -12312,7 +12337,7 @@ if test "$enableval" = "yes"; then
 	
 
 echo $ac_n "checking ipv6 stack type""... $ac_c" 1>&6
-echo "configure:12316: checking ipv6 stack type" >&5
+echo "configure:12341: checking ipv6 stack type" >&5
 if eval "test \"`echo '$''{'cf_cv_ipv6type'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12332,7 +12357,7 @@ do
 		;;
 	inria) #(vi
 				cat > conftest.$ac_ext <<EOF
-#line 12336 "configure"
+#line 12361 "configure"
 #include "confdefs.h"
 dnl
 #include <netinet/in.h>
@@ -12350,7 +12375,7 @@ rm -f conftest*
 		;;
 	kame) #(vi
 				cat > conftest.$ac_ext <<EOF
-#line 12354 "configure"
+#line 12379 "configure"
 #include "confdefs.h"
 dnl
 #include <netinet/in.h>
@@ -12368,7 +12393,7 @@ rm -f conftest*
 		;;
 	linux-glibc) #(vi
 				cat > conftest.$ac_ext <<EOF
-#line 12372 "configure"
+#line 12397 "configure"
 #include "confdefs.h"
 dnl
 #include <features.h>
@@ -12395,7 +12420,7 @@ rm -f conftest*
 		;;
 	toshiba) #(vi
 		cat > conftest.$ac_ext <<EOF
-#line 12399 "configure"
+#line 12424 "configure"
 #include "confdefs.h"
 dnl
 #include <sys/param.h>
@@ -12413,7 +12438,7 @@ rm -f conftest*
 		;;
 	v6d) #(vi
 		cat > conftest.$ac_ext <<EOF
-#line 12417 "configure"
+#line 12442 "configure"
 #include "confdefs.h"
 dnl
 #include </usr/local/v6/include/sys/v6config.h>
@@ -12431,7 +12456,7 @@ rm -f conftest*
 		;;
 	zeta)
 		cat > conftest.$ac_ext <<EOF
-#line 12435 "configure"
+#line 12460 "configure"
 #include "confdefs.h"
 dnl
 #include <sys/param.h>
@@ -12464,7 +12489,7 @@ cf_ipv6lib=none
 cf_ipv6dir=none
 
 echo $ac_n "checking for ipv6 library if required""... $ac_c" 1>&6
-echo "configure:12468: checking for ipv6 library if required" >&5
+echo "configure:12493: checking for ipv6 library if required" >&5
 case $cf_cv_ipv6type in #(vi
 solaris) #(vi
 	;;
@@ -12498,7 +12523,7 @@ echo "$ac_t""$cf_ipv6lib" 1>&6
 if test "$cf_ipv6lib" != "none"; then
 
 	cat > conftest.$ac_ext <<EOF
-#line 12502 "configure"
+#line 12527 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12509,7 +12534,7 @@ int main() {
 getaddrinfo(0, 0, 0, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:12513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -12562,12 +12587,12 @@ rm -f conftest*
 	eval 'cf_cv_have_lib_'$cf_ipv6lib'=no'
 	cf_libdir=""
 	echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
-echo "configure:12566: checking for getaddrinfo" >&5
+echo "configure:12591: checking for getaddrinfo" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12571 "configure"
+#line 12596 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getaddrinfo(); below.  */
@@ -12590,7 +12615,7 @@ getaddrinfo();
 
 ; return 0; }
 EOF
-if { (eval echo configure:12594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getaddrinfo=yes"
 else
@@ -12610,10 +12635,10 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for getaddrinfo in -l$cf_ipv6lib""... $ac_c" 1>&6
-echo "configure:12614: checking for getaddrinfo in -l$cf_ipv6lib" >&5
+echo "configure:12639: checking for getaddrinfo in -l$cf_ipv6lib" >&5
 		LIBS="-l$cf_ipv6lib $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 12617 "configure"
+#line 12642 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12624,7 +12649,7 @@ int main() {
 getaddrinfo(0, 0, 0, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:12628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 eval 'cf_cv_have_lib_'$cf_ipv6lib'=yes'
@@ -12668,10 +12693,10 @@ cf_search="$cf_search $HOME/lib $HOME/lib/$cf_ipv6dir $HOME/$cf_ipv6dir/lib"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -l$cf_ipv6lib in $cf_libdir""... $ac_c" 1>&6
-echo "configure:12672: checking for -l$cf_ipv6lib in $cf_libdir" >&5
+echo "configure:12697: checking for -l$cf_ipv6lib in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -l$cf_ipv6lib $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 12675 "configure"
+#line 12700 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12682,7 +12707,7 @@ int main() {
 getaddrinfo(0, 0, 0, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:12686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 eval 'cf_cv_have_lib_'$cf_ipv6lib'=yes'
@@ -12715,7 +12740,7 @@ fi
 
 
 echo $ac_n "checking working getaddrinfo""... $ac_c" 1>&6
-echo "configure:12719: checking working getaddrinfo" >&5
+echo "configure:12744: checking working getaddrinfo" >&5
 if eval "test \"`echo '$''{'cf_cv_getaddrinfo'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12724,7 +12749,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_getaddrinfo=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 12728 "configure"
+#line 12753 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12803,7 +12828,7 @@ int main()
 }
 
 EOF
-if { (eval echo configure:12807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   cf_cv_getaddrinfo=yes
 else
@@ -12846,7 +12871,7 @@ fi
 fi
 
 echo $ac_n "checking if experimental element-justification logic should be used""... $ac_c" 1>&6
-echo "configure:12850: checking if experimental element-justification logic should be used" >&5
+echo "configure:12875: checking if experimental element-justification logic should be used" >&5
 
 # Check whether --enable-justify-elts or --disable-justify-elts was given.
 if test "${enable_justify_elts+set}" = set; then
@@ -12870,7 +12895,7 @@ EOF
 
 
 echo $ac_n "checking if experimental keyboard-layout logic should be used""... $ac_c" 1>&6
-echo "configure:12874: checking if experimental keyboard-layout logic should be used" >&5
+echo "configure:12899: checking if experimental keyboard-layout logic should be used" >&5
 
 # Check whether --enable-kbd-layout or --disable-kbd-layout was given.
 if test "${enable_kbd_layout+set}" = set; then
@@ -12894,7 +12919,7 @@ EOF
 
 
 echo $ac_n "checking if experimental JavaScript support should be used""... $ac_c" 1>&6
-echo "configure:12898: checking if experimental JavaScript support should be used" >&5
+echo "configure:12923: checking if experimental JavaScript support should be used" >&5
 
 # Check whether --enable-libjs or --disable-libjs was given.
 if test "${enable_libjs+set}" = set; then
@@ -12918,7 +12943,7 @@ EOF
 
 
 echo $ac_n "checking if experimental nested-table logic should be used""... $ac_c" 1>&6
-echo "configure:12922: checking if experimental nested-table logic should be used" >&5
+echo "configure:12947: checking if experimental nested-table logic should be used" >&5
 
 # Check whether --enable-nested-tables or --disable-nested-tables was given.
 if test "${enable_nested_tables+set}" = set; then
@@ -12942,7 +12967,7 @@ EOF
 
 
 echo $ac_n "checking if html source should be colorized""... $ac_c" 1>&6
-echo "configure:12946: checking if html source should be colorized" >&5
+echo "configure:12971: checking if html source should be colorized" >&5
 
 # Check whether --enable-prettysrc or --disable-prettysrc was given.
 if test "${enable_prettysrc+set}" = set; then
@@ -12966,7 +12991,7 @@ EOF
 
 
 echo $ac_n "checking if read-progress message should show ETA""... $ac_c" 1>&6
-echo "configure:12970: checking if read-progress message should show ETA" >&5
+echo "configure:12995: checking if read-progress message should show ETA" >&5
 
 # Check whether --enable-read-eta or --disable-read-eta was given.
 if test "${enable_read_eta+set}" = set; then
@@ -12990,7 +13015,7 @@ EOF
 
 
 echo $ac_n "checking if scrollbar code should be used""... $ac_c" 1>&6
-echo "configure:12994: checking if scrollbar code should be used" >&5
+echo "configure:13019: checking if scrollbar code should be used" >&5
 
 # Check whether --enable-scrollbar or --disable-scrollbar was given.
 if test "${enable_scrollbar+set}" = set; then
@@ -13021,7 +13046,7 @@ EOF
 fi
 
 echo $ac_n "checking if source caching should be used""... $ac_c" 1>&6
-echo "configure:13025: checking if source caching should be used" >&5
+echo "configure:13050: checking if source caching should be used" >&5
 
 # Check whether --enable-source-cache or --disable-source-cache was given.
 if test "${enable_source_cache+set}" = set; then
@@ -13048,7 +13073,7 @@ EOF
 
 
 echo $ac_n "checking if alternative line-edit bindings should be used""... $ac_c" 1>&6
-echo "configure:13052: checking if alternative line-edit bindings should be used" >&5
+echo "configure:13077: checking if alternative line-edit bindings should be used" >&5
 
 # Check whether --enable-alt-bindings or --disable-alt-bindings was given.
 if test "${enable_alt_bindings+set}" = set; then
@@ -13072,7 +13097,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use extended HTML DTD logic""... $ac_c" 1>&6
-echo "configure:13076: checking if you want to use extended HTML DTD logic" >&5
+echo "configure:13101: checking if you want to use extended HTML DTD logic" >&5
 
 # Check whether --enable-extended-dtd or --disable-extended-dtd was given.
 if test "${enable_extended_dtd+set}" = set; then
@@ -13096,7 +13121,7 @@ EOF
 
 
 echo $ac_n "checking if partial-display should be used""... $ac_c" 1>&6
-echo "configure:13100: checking if partial-display should be used" >&5
+echo "configure:13125: checking if partial-display should be used" >&5
 
 # Check whether --enable-partial or --disable-partial was given.
 if test "${enable_partial+set}" = set; then
@@ -13120,7 +13145,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use external commands""... $ac_c" 1>&6
-echo "configure:13124: checking if you want to use external commands" >&5
+echo "configure:13149: checking if you want to use external commands" >&5
 
 # Check whether --enable-externs or --disable-externs was given.
 if test "${enable_externs+set}" = set; then
@@ -13147,7 +13172,7 @@ EOF
 fi
 
 echo $ac_n "checking if you want to use setfont support""... $ac_c" 1>&6
-echo "configure:13151: checking if you want to use setfont support" >&5
+echo "configure:13176: checking if you want to use setfont support" >&5
 
 # Check whether --enable-font-switch or --disable-font-switch was given.
 if test "${enable_font_switch+set}" = set; then
@@ -13171,7 +13196,7 @@ EOF
 
 
 echo $ac_n "checking if you want cgi-link support""... $ac_c" 1>&6
-echo "configure:13175: checking if you want cgi-link support" >&5
+echo "configure:13200: checking if you want cgi-link support" >&5
 
 # Check whether --enable-cgi-links or --disable-cgi-links was given.
 if test "${enable_cgi_links+set}" = set; then
@@ -13190,7 +13215,7 @@ fi
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking if you want change-exec support""... $ac_c" 1>&6
-echo "configure:13194: checking if you want change-exec support" >&5
+echo "configure:13219: checking if you want change-exec support" >&5
 
 # Check whether --enable-change-exec or --disable-change-exec was given.
 if test "${enable_change_exec+set}" = set; then
@@ -13214,7 +13239,7 @@ EOF
 
 
 echo $ac_n "checking if you want exec-links support""... $ac_c" 1>&6
-echo "configure:13218: checking if you want exec-links support" >&5
+echo "configure:13243: checking if you want exec-links support" >&5
 
 # Check whether --enable-exec-links or --disable-exec-links was given.
 if test "${enable_exec_links+set}" = set; then
@@ -13238,7 +13263,7 @@ EOF
 
 
 echo $ac_n "checking if you want exec-scripts support""... $ac_c" 1>&6
-echo "configure:13242: checking if you want exec-scripts support" >&5
+echo "configure:13267: checking if you want exec-scripts support" >&5
 
 # Check whether --enable-exec-scripts or --disable-exec-scripts was given.
 if test "${enable_exec_scripts+set}" = set; then
@@ -13262,7 +13287,7 @@ EOF
 
 
 echo $ac_n "checking if you want internal-links feature""... $ac_c" 1>&6
-echo "configure:13266: checking if you want internal-links feature" >&5
+echo "configure:13291: checking if you want internal-links feature" >&5
 
 # Check whether --enable-internal-links or --disable-internal-links was given.
 if test "${enable_internal_links+set}" = set; then
@@ -13286,7 +13311,7 @@ EOF
 
 
 echo $ac_n "checking if you want to fork NSL requests""... $ac_c" 1>&6
-echo "configure:13290: checking if you want to fork NSL requests" >&5
+echo "configure:13315: checking if you want to fork NSL requests" >&5
 
 # Check whether --enable-nsl-fork or --disable-nsl-fork was given.
 if test "${enable_nsl_fork+set}" = set; then
@@ -13310,7 +13335,7 @@ EOF
 
 
 echo $ac_n "checking if you want to log URL requests via syslog""... $ac_c" 1>&6
-echo "configure:13314: checking if you want to log URL requests via syslog" >&5
+echo "configure:13339: checking if you want to log URL requests via syslog" >&5
 
 # Check whether --enable-syslog or --disable-syslog was given.
 if test "${enable_syslog+set}" = set; then
@@ -13334,7 +13359,7 @@ EOF
 
 
 echo $ac_n "checking if persistent-cookie logic should be used""... $ac_c" 1>&6
-echo "configure:13338: checking if persistent-cookie logic should be used" >&5
+echo "configure:13363: checking if persistent-cookie logic should be used" >&5
 
 # Check whether --enable-persistent-cookies or --disable-persistent-cookies was given.
 if test "${enable_persistent_cookies+set}" = set; then
@@ -13358,7 +13383,7 @@ EOF
 
 
 echo $ac_n "checking if you want to underline links""... $ac_c" 1>&6
-echo "configure:13362: checking if you want to underline links" >&5
+echo "configure:13387: checking if you want to underline links" >&5
 
 # Check whether --enable-underlines or --disable-underlines was given.
 if test "${enable_underlines+set}" = set; then
@@ -13382,7 +13407,7 @@ EOF
 
 
 echo $ac_n "checking if help files should be gzip'ed""... $ac_c" 1>&6
-echo "configure:13386: checking if help files should be gzip'ed" >&5
+echo "configure:13411: checking if help files should be gzip'ed" >&5
 
 # Check whether --enable-gzip-help or --disable-gzip-help was given.
 if test "${enable_gzip_help+set}" = set; then
@@ -13411,7 +13436,7 @@ fi
 
 
 echo $ac_n "checking if you want to use zlib for decompression of some gzip files""... $ac_c" 1>&6
-echo "configure:13415: checking if you want to use zlib for decompression of some gzip files" >&5
+echo "configure:13440: checking if you want to use zlib for decompression of some gzip files" >&5
 
 # Check whether --with-zlib or --without-zlib was given.
 if test "${with_zlib+set}" = set; then
@@ -13425,16 +13450,16 @@ echo "$ac_t""$use_zlib" 1>&6
 
 if test ".$use_zlib" != ".no" ; then
 	echo $ac_n "checking if we need to add -I option to get zlib.h""... $ac_c" 1>&6
-echo "configure:13429: checking if we need to add -I option to get zlib.h" >&5
+echo "configure:13454: checking if we need to add -I option to get zlib.h" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 13431 "configure"
+#line 13456 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
 else
@@ -13488,12 +13513,12 @@ rm -f conftest*
 	eval 'cf_cv_have_lib_'z'=no'
 	cf_libdir=""
 	echo $ac_n "checking for gzopen""... $ac_c" 1>&6
-echo "configure:13492: checking for gzopen" >&5
+echo "configure:13517: checking for gzopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gzopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13497 "configure"
+#line 13522 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gzopen(); below.  */
@@ -13516,7 +13541,7 @@ gzopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:13520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gzopen=yes"
 else
@@ -13536,17 +13561,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6
-echo "configure:13540: checking for gzopen in -lz" >&5
+echo "configure:13565: checking for gzopen in -lz" >&5
 		LIBS="-lz $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 13543 "configure"
+#line 13568 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:13550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 eval 'cf_cv_have_lib_'z'=yes'
@@ -13590,17 +13615,17 @@ cf_search="$cf_search $HOME/lib $HOME/lib/z $HOME/z/lib"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lz in $cf_libdir""... $ac_c" 1>&6
-echo "configure:13594: checking for -lz in $cf_libdir" >&5
+echo "configure:13619: checking for -lz in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lz $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 13597 "configure"
+#line 13622 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:13604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 eval 'cf_cv_have_lib_'z'=yes'
@@ -13634,7 +13659,7 @@ EOF
 fi
 
 echo $ac_n "checking if you want to exclude FINGER code""... $ac_c" 1>&6
-echo "configure:13638: checking if you want to exclude FINGER code" >&5
+echo "configure:13663: checking if you want to exclude FINGER code" >&5
 
 # Check whether --enable-finger or --disable-finger was given.
 if test "${enable_finger+set}" = set; then
@@ -13658,7 +13683,7 @@ EOF
 
 
 echo $ac_n "checking if you want to exclude GOPHER code""... $ac_c" 1>&6
-echo "configure:13662: checking if you want to exclude GOPHER code" >&5
+echo "configure:13687: checking if you want to exclude GOPHER code" >&5
 
 # Check whether --enable-gopher or --disable-gopher was given.
 if test "${enable_gopher+set}" = set; then
@@ -13682,7 +13707,7 @@ EOF
 
 
 echo $ac_n "checking if you want to exclude NEWS code""... $ac_c" 1>&6
-echo "configure:13686: checking if you want to exclude NEWS code" >&5
+echo "configure:13711: checking if you want to exclude NEWS code" >&5
 
 # Check whether --enable-news or --disable-news was given.
 if test "${enable_news+set}" = set; then
@@ -13706,7 +13731,7 @@ EOF
 
 
 echo $ac_n "checking if you want to exclude FTP code""... $ac_c" 1>&6
-echo "configure:13710: checking if you want to exclude FTP code" >&5
+echo "configure:13735: checking if you want to exclude FTP code" >&5
 
 # Check whether --enable-ftp or --disable-ftp was given.
 if test "${enable_ftp+set}" = set; then
@@ -13735,7 +13760,7 @@ EOF
 # All DirEd functions that were enabled on compilation can be disabled
 # or modified at run time via DIRED_MENU symbols in lynx.cfg.
 echo $ac_n "checking if directory-editor code should be used""... $ac_c" 1>&6
-echo "configure:13739: checking if directory-editor code should be used" >&5
+echo "configure:13764: checking if directory-editor code should be used" >&5
 
 # Check whether --enable-dired or --disable-dired was given.
 if test "${enable_dired+set}" = set; then
@@ -13762,7 +13787,7 @@ EOF
 
 
 	echo $ac_n "checking if you wish to allow extracting from archives via DirEd""... $ac_c" 1>&6
-echo "configure:13766: checking if you wish to allow extracting from archives via DirEd" >&5
+echo "configure:13791: checking if you wish to allow extracting from archives via DirEd" >&5
 	
 # Check whether --enable-dired-dearchive or --disable-dired-dearchive was given.
 if test "${enable_dired_dearchive+set}" = set; then
@@ -13781,7 +13806,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if DirEd mode should override keys""... $ac_c" 1>&6
-echo "configure:13785: checking if DirEd mode should override keys" >&5
+echo "configure:13810: checking if DirEd mode should override keys" >&5
 	
 # Check whether --enable-dired-override or --disable-dired-override was given.
 if test "${enable_dired_override+set}" = set; then
@@ -13807,7 +13832,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow permissions commands via DirEd""... $ac_c" 1>&6
-echo "configure:13811: checking if you wish to allow permissions commands via DirEd" >&5
+echo "configure:13836: checking if you wish to allow permissions commands via DirEd" >&5
 	
 # Check whether --enable-dired-permit or --disable-dired-permit was given.
 if test "${enable_dired_permit+set}" = set; then
@@ -13833,7 +13858,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow executable-permission commands via DirEd""... $ac_c" 1>&6
-echo "configure:13837: checking if you wish to allow executable-permission commands via DirEd" >&5
+echo "configure:13862: checking if you wish to allow executable-permission commands via DirEd" >&5
 	
 # Check whether --enable-dired-xpermit or --disable-dired-xpermit was given.
 if test "${enable_dired_xpermit+set}" = set; then
@@ -13852,7 +13877,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "tar" commands from DirEd""... $ac_c" 1>&6
-echo "configure:13856: checking if you wish to allow "tar" commands from DirEd" >&5
+echo "configure:13881: checking if you wish to allow "tar" commands from DirEd" >&5
 	
 # Check whether --enable-dired-tar or --disable-dired-tar was given.
 if test "${enable_dired_tar+set}" = set; then
@@ -13878,7 +13903,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "uudecode" commands from DirEd""... $ac_c" 1>&6
-echo "configure:13882: checking if you wish to allow "uudecode" commands from DirEd" >&5
+echo "configure:13907: checking if you wish to allow "uudecode" commands from DirEd" >&5
 	
 # Check whether --enable-dired-uudecode or --disable-dired-uudecode was given.
 if test "${enable_dired_uudecode+set}" = set; then
@@ -13904,7 +13929,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "zip" and "unzip" commands from DirEd""... $ac_c" 1>&6
-echo "configure:13908: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5
+echo "configure:13933: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5
 	
 # Check whether --enable-dired-zip or --disable-dired-zip was given.
 if test "${enable_dired_zip+set}" = set; then
@@ -13930,7 +13955,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "gzip" and "gunzip" commands from DirEd""... $ac_c" 1>&6
-echo "configure:13934: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5
+echo "configure:13959: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5
 	
 # Check whether --enable-dired-gzip or --disable-dired-gzip was given.
 if test "${enable_dired_gzip+set}" = set; then
@@ -13957,7 +13982,7 @@ fi
 fi
 
 echo $ac_n "checking if you want long-directory listings""... $ac_c" 1>&6
-echo "configure:13961: checking if you want long-directory listings" >&5
+echo "configure:13986: checking if you want long-directory listings" >&5
 
 # Check whether --enable-long-list or --disable-long-list was given.
 if test "${enable_long_list+set}" = set; then
@@ -13983,7 +14008,7 @@ fi
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking if parent-directory references are permitted""... $ac_c" 1>&6
-echo "configure:13987: checking if parent-directory references are permitted" >&5
+echo "configure:14012: checking if parent-directory references are permitted" >&5
 
 # Check whether --enable-parent-dir-refs or --disable-parent-dir-refs was given.
 if test "${enable_parent_dir_refs+set}" = set; then
@@ -14008,7 +14033,7 @@ if test $cf_cv_screen = pdcurses ; then
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:14012: checking for X" >&5
+echo "configure:14037: checking for X" >&5
 
 
 # Check whether --with-x or --without-x was given.
@@ -14071,12 +14096,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 14075 "configure"
+#line 14100 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:14080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -14145,14 +14170,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14149 "configure"
+#line 14174 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:14156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -14252,7 +14277,7 @@ clix*)
 	# FIXME: modify the library lookup in autoconf to
 	# allow _s.a suffix ahead of .a
 	echo $ac_n "checking for open in -lc_s""... $ac_c" 1>&6
-echo "configure:14256: checking for open in -lc_s" >&5
+echo "configure:14281: checking for open in -lc_s" >&5
 ac_lib_var=`echo c_s'_'open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14260,7 +14285,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14264 "configure"
+#line 14289 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14271,7 +14296,7 @@ int main() {
 open()
 ; return 0; }
 EOF
-if { (eval echo configure:14275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14288,7 +14313,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   LIBS="-lc_s $LIBS"
 	echo $ac_n "checking for gethostname in -lbsd""... $ac_c" 1>&6
-echo "configure:14292: checking for gethostname in -lbsd" >&5
+echo "configure:14317: checking for gethostname in -lbsd" >&5
 ac_lib_var=`echo bsd'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14296,7 +14321,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14300 "configure"
+#line 14325 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14307,7 +14332,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:14311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14324,7 +14349,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   LIBS="-lbsd $LIBS"
 	echo $ac_n "checking for gethostname in -lnsl_s""... $ac_c" 1>&6
-echo "configure:14328: checking for gethostname in -lnsl_s" >&5
+echo "configure:14353: checking for gethostname in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14332,7 +14357,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14336 "configure"
+#line 14361 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14343,7 +14368,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:14347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14360,7 +14385,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   LIBS="-lnsl_s $LIBS"
 	echo $ac_n "checking for XOpenDisplay in -lX11_s""... $ac_c" 1>&6
-echo "configure:14364: checking for XOpenDisplay in -lX11_s" >&5
+echo "configure:14389: checking for XOpenDisplay in -lX11_s" >&5
 ac_lib_var=`echo X11_s'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14368,7 +14393,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lX11_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14372 "configure"
+#line 14397 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14379,7 +14404,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:14383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14396,7 +14421,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   LIBS="-lX11_s $LIBS"
 	echo $ac_n "checking for XtAppInitialize in -lXt_s""... $ac_c" 1>&6
-echo "configure:14400: checking for XtAppInitialize in -lXt_s" >&5
+echo "configure:14425: checking for XtAppInitialize in -lXt_s" >&5
 ac_lib_var=`echo Xt_s'_'XtAppInitialize | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14404,7 +14429,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14408 "configure"
+#line 14433 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14415,7 +14440,7 @@ int main() {
 XtAppInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:14419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14456,7 +14481,7 @@ fi
 	;;
 *)
 	echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:14460: checking for socket in -lsocket" >&5
+echo "configure:14485: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14464,7 +14489,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14468 "configure"
+#line 14493 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14475,7 +14500,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:14479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14503,7 +14528,7 @@ else
 fi
 
 	echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:14507: checking for gethostname in -lnsl" >&5
+echo "configure:14532: checking for gethostname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14511,7 +14536,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14515 "configure"
+#line 14540 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14522,7 +14547,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:14526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14573,17 +14598,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:14577: checking whether -R must be followed by a space" >&5
+echo "configure:14602: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 14580 "configure"
+#line 14605 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -14599,14 +14624,14 @@ rm -f conftest*
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 14603 "configure"
+#line 14628 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -14638,7 +14663,7 @@ rm -f conftest*
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:14642: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:14667: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14646,7 +14671,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14650 "configure"
+#line 14675 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14657,7 +14682,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:14661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14679,7 +14704,7 @@ fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:14683: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:14708: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14687,7 +14712,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14691 "configure"
+#line 14716 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14698,7 +14723,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:14702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14727,12 +14752,12 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:14731: checking for gethostbyname" >&5
+echo "configure:14756: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14736 "configure"
+#line 14761 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -14755,7 +14780,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:14759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -14776,7 +14801,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:14780: checking for gethostbyname in -lnsl" >&5
+echo "configure:14805: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14784,7 +14809,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14788 "configure"
+#line 14813 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14795,7 +14820,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:14799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14825,12 +14850,12 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:14829: checking for connect" >&5
+echo "configure:14854: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14834 "configure"
+#line 14859 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -14853,7 +14878,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:14857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -14874,7 +14899,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:14878: checking for connect in -lsocket" >&5
+echo "configure:14903: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14882,7 +14907,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14886 "configure"
+#line 14911 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14893,7 +14918,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:14897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14917,12 +14942,12 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:14921: checking for remove" >&5
+echo "configure:14946: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14926 "configure"
+#line 14951 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -14945,7 +14970,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:14949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -14966,7 +14991,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:14970: checking for remove in -lposix" >&5
+echo "configure:14995: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14974,7 +14999,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14978 "configure"
+#line 15003 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -14985,7 +15010,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:14989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15009,12 +15034,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:15013: checking for shmat" >&5
+echo "configure:15038: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15018 "configure"
+#line 15043 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -15037,7 +15062,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:15041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -15058,7 +15083,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:15062: checking for shmat in -lipc" >&5
+echo "configure:15087: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15066,7 +15091,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15070 "configure"
+#line 15095 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15077,7 +15102,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:15081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15110,7 +15135,7 @@ fi
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:15114: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:15139: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15118,7 +15143,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15122 "configure"
+#line 15147 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15129,7 +15154,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:15133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15174,7 +15199,7 @@ do
 done
 
 	echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:15178: checking for XOpenDisplay in -lX11" >&5
+echo "configure:15203: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15182,7 +15207,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15186 "configure"
+#line 15211 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15193,7 +15218,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:15197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15214,7 +15239,7 @@ else
 fi
 
 	echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
-echo "configure:15218: checking for XtAppInitialize in -lXt" >&5
+echo "configure:15243: checking for XtAppInitialize in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15222,7 +15247,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15226 "configure"
+#line 15251 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15233,7 +15258,7 @@ int main() {
 XtAppInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:15237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15308,7 +15333,7 @@ fi
 
 
 echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
-echo "configure:15312: checking for XextCreateExtension in -lXext" >&5
+echo "configure:15337: checking for XextCreateExtension in -lXext" >&5
 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15316,7 +15341,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15320 "configure"
+#line 15345 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15327,7 +15352,7 @@ int main() {
 XextCreateExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:15331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15364,13 +15389,13 @@ do
 		if test $cf_path != default ; then
 			CPPFLAGS="-I$cf_path/include $cf_save"
 			echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
-echo "configure:15368: checking for $cf_test in $cf_path" >&5
+echo "configure:15393: checking for $cf_test in $cf_path" >&5
 		else
 			echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
-echo "configure:15371: checking for $cf_test" >&5
+echo "configure:15396: checking for $cf_test" >&5
 		fi
 		cat > conftest.$ac_ext <<EOF
-#line 15374 "configure"
+#line 15399 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -15379,7 +15404,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:15383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -15405,21 +15430,21 @@ rm -f conftest*
 			if test $cf_path != default ; then
 				LIBS="-L$cf_path/lib $cf_lib $LIBS"
 				echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
-echo "configure:15409: checking for $cf_lib in $cf_path" >&5
+echo "configure:15434: checking for $cf_lib in $cf_path" >&5
 			else
 				LIBS="$cf_lib $LIBS"
 				echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
-echo "configure:15413: checking for $cf_test in $cf_lib" >&5
+echo "configure:15438: checking for $cf_test in $cf_lib" >&5
 			fi
 			cat > conftest.$ac_ext <<EOF
-#line 15416 "configure"
+#line 15441 "configure"
 #include "confdefs.h"
 
 int main() {
 $cf_test()
 ; return 0; }
 EOF
-if { (eval echo configure:15423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -15478,7 +15503,7 @@ do
 done
 
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:15482: checking for XOpenDisplay in -lX11" >&5
+echo "configure:15507: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15486,7 +15511,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15490 "configure"
+#line 15515 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15497,7 +15522,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:15501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15518,14 +15543,14 @@ else
 fi
 
 echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
-echo "configure:15522: checking for XCurses library" >&5
+echo "configure:15547: checking for XCurses library" >&5
 if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 LIBS="-lXCurses $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15529 "configure"
+#line 15554 "configure"
 #include "confdefs.h"
 
 #include <xcurses.h>
@@ -15535,7 +15560,7 @@ int main() {
 XCursesExit();
 ; return 0; }
 EOF
-if { (eval echo configure:15539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_lib_XCurses=yes
 else
@@ -15569,7 +15594,7 @@ fi
 else
 	
 echo $ac_n "checking if we can include termio.h with curses""... $ac_c" 1>&6
-echo "configure:15573: checking if we can include termio.h with curses" >&5
+echo "configure:15598: checking if we can include termio.h with curses" >&5
 if eval "test \"`echo '$''{'cf_cv_termio_and_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15578,7 +15603,7 @@ else
     CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -I. -I${srcdir-.} -I${srcdir-.}/src -I${srcdir-.}/WWW/Library/Implementation"
     touch lynx_cfg.h
     cat > conftest.$ac_ext <<EOF
-#line 15582 "configure"
+#line 15607 "configure"
 #include "confdefs.h"
 
 #include <LYCurses.h>
@@ -15587,7 +15612,7 @@ int main() {
 putchar(0x0a)
 ; return 0; }
 EOF
-if { (eval echo configure:15591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_termio_and_curses=yes
 else
diff --git a/configure.in b/configure.in
index 541291d8..b5d146fa 100644
--- a/configure.in
+++ b/configure.in
@@ -109,6 +109,14 @@ CF_ARG_DISABLE(trace,
 AC_MSG_RESULT($with_trace)
 test $with_trace = no && AC_DEFINE(NO_LYNX_TRACE)
 
+AC_MSG_CHECKING(if you want verbose trace code)
+CF_ARG_ENABLE(vertrace,
+	[  --enable-vertrace       verbose trace code],
+	[with_vertrace=yes],
+	[with_vertrace=no])
+AC_MSG_RESULT($with_vertrace)
+test $with_vertrace = yes && AC_DEFINE(LY_TRACELINE,__LINE__)
+
 if test -n "$GCC"
 then
 AC_MSG_CHECKING(if you want to turn on gcc warnings)
diff --git a/docs/README.defines b/docs/README.defines
index 8eac15ee..2ec2ac46 100644
--- a/docs/README.defines
+++ b/docs/README.defines
@@ -106,8 +106,6 @@ Both:
 Related to experimental (unsupported) character style code
 ------------------------------------------------------------
 # -DUSE_COLOR_STYLE (see INSTALLATION, Section II-1c) needs SVr4 curses
-# -DUSE_HASH       (see INSTALLATION, Section II-1c)  probably needs the above
-# -DLINKEDSTYLES   (see INSTALLATION, Section II-1c)  probably needs the above
 
 Other general
 -------------
diff --git a/lynx.cfg b/lynx.cfg
index 852658f1..69f58b6b 100644
--- a/lynx.cfg
+++ b/lynx.cfg
@@ -1104,7 +1104,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #LYNX_SIG_FILE:.lynxsig
 
 .h1 Bibliographic Protocol (bibp scheme)
-     
+
 .h2 BIBP_GLOBAL_SERVER
 # BIBP_GLOBAL_SERVER is the default global server for bibp: links, used
 # when a local bibhost or document-specified citehost is unavailable.
@@ -1140,11 +1140,15 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 
 
 .h2 USE_MOUSE
-# If USE_MOUSE is set TRUE, Lynx (when configured with ncurses, PDcurses or
-# slang) will allow the user to click with button-1 on links to select them. 
-# Other mouse-usable operations include:  clicking on the top or bottom of a
-# page to make it scroll up or down, clicking on the left edge to pop the
-# history stack, to move to a text entry field, or manipulate a popup menu.
+# If Lynx is configured with ncurses, PDcurses or slang & USE_MOUSE is TRUE,
+# users can perform commands by left-clicking certain parts of the screen:
+#   on a link = `g'oto + ACTIVATE (ie move highlight & follow the link);
+#   on the top/bottom lines = PREV/NEXT_PAGE (ie go up/down 1 page);
+#   on the top/bottom left corners = PREV_DOC (ie go to the previous document);
+#   on the top/bottom right corners = HISTORY (ie call up the history page).
+# NB if the mouse is defined in this way, it will not be available
+# for copy/paste operations using the clipboard of a desktop manager:
+# for flexibility instead, use the command-line switch  -use_mouse .
 #
 # ncurses and slang have built-in support for the xterm mouse protocol.  In
 # addition, ncurses can be linked with the gpm mouse library, to automatically
@@ -2351,8 +2355,9 @@ MINIMAL_COMMENTS:TRUE
 #KEYMAP:*:IMAGE_TOGGLE		# Toggle inclusion of links for all images
 #KEYMAP:[:INLINE_TOGGLE		# Toggle pseudo-ALTs for inlines with no ALT string
 #KEYMAP:]:HEAD			# Send a HEAD request for current document or link
-#*** Must be compiled with USE_EXTERNALS to enable EXTERN ***
-#KEYMAP:.:EXTERN		# Run external program with url
+#*** Must be compiled with USE_EXTERNALS to enable EXTERN_LINK, EXTERN_PAGE ***
+#KEYMAP:,:EXTERN_PAGE		# Run external program with current page
+#KEYMAP:.:EXTERN_LINK		# Run external program with current link
 #*** Escaping from text input fields with ^V is independent from this: ***
 #KEYMAP:^V:SWITCH_DTD		# Toggle between SortaSGML and TagSoup HTML parsing
 #KEYMAP:0x00:DO_NOTHING		# Does nothing (ignore this key)
@@ -2524,16 +2529,16 @@ MINIMAL_COMMENTS:TRUE
 
 .h2 AUTO_UNCACHE_DIRLISTS
 # AUTO_UNCACHE_DIRLISTS determines when local file directory listings are
-# automatically regenerated (by re-reading the actual directory from disk). 
+# automatically regenerated (by re-reading the actual directory from disk).
 # Set the value to 0 to avoid automatic regeneration in most cases.  This is
-# useful for browsing large directories that take some time to read and format. 
+# useful for browsing large directories that take some time to read and format.
 # An update can still always be forced with the RELOAD key, and specific DIRED
 # actions may cause a refresh anyway.  Set the value to 1 to force regeneration
 # after commands that usually change the directory or some files and would make
 # the displayed info stale, like EDIT and REMOVE.  Set it to 2 (the default) or
 # greater to force regeneration even after leaving the displayed directory
 # listing by some action that usually causes no change, like GOTO or entering a
-# file with the ACTIVATE key.  This option is only honored in DIRED mode (i.e. 
+# file with the ACTIVATE key.  This option is only honored in DIRED mode (i.e.
 # when lynx is compiled with DIRED_SUPPORT and it is not disabled with a
 # -restriction).  Local directories displayed without DIRED normally act as if
 # AUTO_UNCACHE_DIRLISTS:0 was in effect.
@@ -2846,12 +2851,13 @@ MINIMAL_COMMENTS:TRUE
 #
 # <allow_for_activate> Setting this to TRUE allows the use of this command not
 # only when EXTERN key is pressed, but also when ACTIVATE command is invoked
-# (i.e activating the link with the given prefix will be equivalent to
+# (i.e., activating the link with the given prefix will be equivalent to
 # pressing EXTERN key on it).  If this component of the line is absent, then
 # FALSE is assumed.
-# 
-# For invoking the command use the EXTERN key.  By default it is mapped
-# to '.' (if the feature is enabled), see the KEYMAP section above.
+#
+# For invoking the command use the EXTERN_LINK or EXTERN_PAGE key.  By default
+# EXTERN_LINK is mapped to '.', and EXTERN_PAGE to ',' (if the feature is
+# enabled), see the KEYMAP section above.
 #
 #EXTERNAL:ftp:wget %s &:TRUE
 
@@ -3046,7 +3052,7 @@ MINIMAL_COMMENTS:TRUE
 #
 #JUSTIFY:TRUE
 
-.h2 JUSTIFY_MAX_VOID_PERCENT 
+.h2 JUSTIFY_MAX_VOID_PERCENT
 # JUSTIFY_MAX_VOID_PERCENT - Appearance
 # This option controls the maximum allowed value for ratio (in percents) of
 # 'the number of spaces to spread across the line to justify it' to
diff --git a/lynx_help/Lynx_users_guide.html b/lynx_help/Lynx_users_guide.html
index ee1ead14..2813fa33 100644
--- a/lynx_help/Lynx_users_guide.html
+++ b/lynx_help/Lynx_users_guide.html
@@ -2562,8 +2562,8 @@ where
                 <dt>externals
                         <dd>disallow some "EXTERNAL" configuration lines,
                             if support for passing URLs to external
-                            applications (with the EXTERN command) is
-                            compiled in.
+			    applications (with the EXTERN_LINK or EXTERN_PAGE
+			    command) is compiled in.
                 <dt>file_url
                         <dd>disallow using G)oto, served links or bookmarks
                             for file: URLs.
diff --git a/lynx_help/keystrokes/keystroke_help.html b/lynx_help/keystrokes/keystroke_help.html
index c3cbd118..f38bd8aa 100644
--- a/lynx_help/keystrokes/keystroke_help.html
+++ b/lynx_help/keystrokes/keystroke_help.html
@@ -83,6 +83,8 @@
                *              - Toggle image_links mode on and off
                @              - Toggle raw 8-bit translations or CJK mode
                                 on or off
+               .              - Run external program on the current link.
+               ,              - Run external program on the current document.
                {              - Shift the screen left.
                }              - Shift the screen right.
                |              - Toggle line-wrap mode.  When line-wrap is
diff --git a/makefile.in b/makefile.in
index 6f15f8fa..cbda86b2 100644
--- a/makefile.in
+++ b/makefile.in
@@ -150,7 +150,6 @@ SITE_DEFS = # Your defines here
 # -DEXEC_SCRIPTS
 # -DEXP_CHARTRANS_AUTOSWITCH
 # -DEXP_PERSISTENT_COOKIES
-# -DLINKEDSTYLES
 # -DLONG_LIST
 # -DLYNXCGI_LINKS
 # -DLY_FIND_LEAKS
@@ -173,7 +172,6 @@ SITE_DEFS = # Your defines here
 # -DUSE_COLOR_STYLE
 # -DUSE_DEFAULT_COLORS
 # -DUSE_EXTERNALS
-# -DUSE_HASH
 # -DUSE_SLANG
 # -DUSE_SOCKS5
 # -DUSE_ZLIB
diff --git a/makefile.msc b/makefile.msc
index a2ece4d5..e8393912 100644
--- a/makefile.msc
+++ b/makefile.msc
@@ -13,7 +13,7 @@ ETC_LIB = lib
 
 # Uncomment the CS_DEFS and CS_OBJS lines if you wish to build the color-style
 # configuration.
-#CS_DEFS = /D "CHAR_BIT=8" /D "USE_HASH" /D "USE_COLOR_STYLE" /D "LINKEDSTYLES"
+#CS_DEFS = /D "CHAR_BIT=8" /D "USE_COLOR_STYLE"
 #CS_OBJS = "LYHash.obj" "LYStyle.obj"
 
 # Uncomment SOCK_DEFS if you wish to build with winsock2.
diff --git a/samples/bright-blue.lss b/samples/bright-blue.lss
new file mode 100644
index 00000000..5aa5272c
--- /dev/null
+++ b/samples/bright-blue.lss
@@ -0,0 +1,57 @@
+# From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+#
+# Colors: black, red, green, brown, blue, magenta, cyan,
+# lightgray, gray, brightred, brightgreen, yellow, brightblue,
+# brightmagenta, brightcyan, white.
+#
+# On some terminals combination of background and foreground of different
+# brightness is not supported.
+#
+# Normal type styles correspond to HTML tags.
+#
+# default should be the *last* line
+#
+# The next line (beginning with "h1") means:  use bold if mono, otherwise
+# yellow on black (use 'default' for <defaultbackground>/<defaultforeground>)
+default:normal:brightcyan:blue
+# match "link":
+input:normal:green
+input.type.submit:normal:blue:black
+textarea:normal:white:cyan
+# type-less input is the same as type=text (similar to textarea)
+input.type.:normal:white:cyan
+input.type.text:normal:white:cyan
+edit.current:normal:yellow:white
+edit.active:normal:black:white
+edit.active.marked:normal:white:black
+edit.prompt:normal:green:cyan
+edit.prompt.marked:normal:black:white
+edit.active.arrow:normal:red:white
+edit.prompt.arrow:normal:yellow:gray
+edit.active.pad:normal:red:white
+edit.prompt.pad:normal:white:black
+option:normal:red:black
+#alink:normal:red:green
+scroll.arrow:bold:white:default
+scroll.noarrow:normal:black:default
+scroll.bar:bold:white
+#scroll.back:reverse:green:red
+status:reverse:yellow:black
+h1:bold:yellow:black
+em:bold:white
+em.a:reverse:black:blue
+em.b:reverse:white:black
+font.letter:normal:default:black
+link.blue:bold:white:brightblue
+link.blue.prev:bold:yellow:brightblue
+title:normal:magenta:black
+i:bold:white
+table:normal:white
+blockquote:normal:white
+li.blue:bold:blue:black
+link.blue.next:bold:blue:black
+normal:normal:default:default
+INCLUDE:lynx.lss
+default:normal:brightcyan:blue
+#default:normal:cyan:blue
+scroll.noarrow:normal:black:default
diff --git a/samples/lynx.lss b/samples/lynx.lss
index 13f673f8..9c6477e6 100644
--- a/samples/lynx.lss
+++ b/samples/lynx.lss
@@ -51,6 +51,7 @@ whereis:reverse+underline:magenta:cyan
 # currently not used
 #value:normal:green
 #high:bold:brightmagenta
+forwbackw.arrow:reverse
 
 # Styles with classes - <ul class=red> etc.
 ul.red:underline:brightred
diff --git a/src/GridText.c b/src/GridText.c
index ad5abbfe..e61ddbd9 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -33,6 +33,7 @@
 #include <LYPrint.h>
 #include <LYPrettySrc.h>
 #include <TRSTable.h>
+#include <LYHistory.h>
 #ifdef EXP_CHARTRANS_AUTOSWITCH
 #include <UCAuto.h>
 #endif /* EXP_CHARTRANS_AUTOSWITCH */
@@ -60,7 +61,6 @@ unsigned int cached_styles[CACHEH][CACHEW];
 
 #include <LYJustify.h>
 
-
 #ifdef USE_COLOR_STYLE_UNUSED
 void LynxClearScreenCache NOARGS
 {
@@ -128,8 +128,8 @@ PUBLIC char * unchecked_box = "[ ]";
 PUBLIC char * checked_radio = "(*)";
 PUBLIC char * unchecked_radio = "( )";
 
-PUBLIC BOOLEAN underline_on = OFF;
-PUBLIC BOOLEAN bold_on      = OFF;
+PRIVATE BOOLEAN underline_on = OFF;
+PRIVATE BOOLEAN bold_on      = OFF;
 
 #ifdef SOURCE_CACHE
 PUBLIC int LYCacheSource = SOURCE_CACHE_NONE;
@@ -160,9 +160,6 @@ typedef struct _line {
 	struct _line	*prev;
 	unsigned	offset;		/* Implicit initial spaces */
 	unsigned	size;		/* Number of characters */
-	BOOL	split_after;		/* Can we split after? */
-	BOOL	bullet;			/* Do we bullet? */
-	BOOL	expansion_line;		/* TEXTAREA edit new line flag */
 #if defined(USE_COLOR_STYLE)
 	HTStyleChange* styles;
 	int	numstyles;
@@ -294,9 +291,8 @@ void POOL_FREE( pool_type , P* ptr)
 typedef struct _TextAnchor {
 	struct _TextAnchor *	next;
 	int			number;		/* For user interface */
-	int			start;		/* Characters */
-	int			line_pos;	/* Position in text */
-	int			extent;		/* Characters */
+	int			line_pos;	/* Bytes/chars - extent too */
+	int			extent;		/* (see HText_trimHightext) */
 	int			line_num;	/* Place in document */
 	char *			hightext;	/* The link text */
 	char *			hightext2;	/* A second line*/
@@ -336,11 +332,10 @@ struct _HText {
 	BOOLEAN			old_dtd;
 	int			keypad_mode;
 	int			disp_lines;	/* Screen size */
-	int			disp_cols;
+	int			disp_cols;	/* Used for reports only */
 #endif
 	HTLine *		last_line;
 	int			Lines;		/* Number of them */
-	int			chars;		/* Number of them */
 	TextAnchor *		first_anchor;	/* Singly linked list */
 	TextAnchor *		last_anchor;
 	TextAnchor *		last_anchor_before_stbl;
@@ -406,7 +401,6 @@ struct _HText {
 
 PRIVATE void HText_AddHiddenLink PARAMS((HText *text, TextAnchor *textanchor));
 
-
 #ifdef EXP_JUSTIFY_ELTS
 PUBLIC BOOL can_justify_here;
 PUBLIC BOOL can_justify_here_saved;
@@ -436,10 +430,6 @@ static int ht_num_runs;/*the number of runs filled*/
 static ht_run_info ht_runs[MAX_LINE];
 static BOOL this_line_was_split;
 static TextAnchor* last_anchor_of_previous_line;
-static int justified_text_map[MAX_LINE]; /* this is a map - for each index i
-    it tells to which position j=justified_text_map[i] in justified text
-    i-th character is mapped - it's used for anchor positions fixup and for
-    color style's positions adjustment. */
 static BOOL have_raw_nbsps = FALSE;
 
 PUBLIC void ht_justify_cleanup NOARGS
@@ -472,6 +462,8 @@ PUBLIC void mark_justify_start_position ARGS1(void*,text)
 	HTCJK == NOCJK && !in_DT && \
 	can_justify_here && can_justify_this_line && !form_in_htext )
 
+#else
+#define last_anchor_of_previous_line (TextAnchor*)0
 #endif /* EXP_JUSTIFY_ELTS */
 
 
@@ -588,7 +580,7 @@ PRIVATE void * LY_check_calloc ARGS2(
 	if (t == HTMainText)
 	    t = NULL;		/* shouldn't happen */
 	{
-	CTRACE((tfp, "\r *** Emergency freeing document %d/%d for '%s'%s!\n",
+	CTRACE((tfp, "\nBUG *** Emergency freeing document %d/%d for '%s'%s!\n",
 		    i + 1, n,
 		    ((t && t->node_anchor &&
 		      t->node_anchor->address) ?
@@ -754,7 +746,7 @@ PUBLIC HText *	HText_new ARGS1(
     stylechanges_buffers_free = 0;
     line->styles = stylechanges_buffers[0];
 #endif
-    self->Lines = self->chars = 0;
+    self->Lines = 0;
     self->first_anchor = self->last_anchor = NULL;
     self->style = &default_style;
     self->top_of_screen = 0;
@@ -1430,7 +1422,7 @@ PRIVATE void display_title ARGS1(
     char percent[20];
     char *cp = NULL;
     unsigned char *tmp = NULL;
-    int i = 0, j = 0;
+    int i = 0, j = 0, toolbar = 0;
     int limit;
 
     /*
@@ -1530,9 +1522,26 @@ PRIVATE void display_title ARGS1(
 #if defined(SH_EX) && defined(KANJI_CODE_OVERRIDE)
     LYaddstr(str_kcode(last_kcode));
 #endif
-    if (text->top_of_screen > 0 && HText_hasToolbar(text)) {
+    if (HText_hasToolbar(text)) {
 	LYaddch('#');
+	toolbar = 1;
     }
+#ifdef USE_COLOR_STYLE
+    if (s_forw_backw != NOSTYLE && (nhist || nhist_extra > 1)) {
+	int c = nhist ? ACS_LARROW : ' ';
+
+	/* turn the FORWBACKW.ARROW style on */
+	LynxChangeStyle(s_forw_backw, STACK_ON);
+	if (nhist) {
+	    LYaddch(c); LYaddch(c); LYaddch(c);
+	} else
+	    LYmove(0, 3 + toolbar);
+	if (nhist_extra > 1) {
+	    LYaddch(ACS_RARROW); LYaddch(ACS_RARROW); LYaddch(ACS_RARROW);
+	}
+	LynxChangeStyle(s_forw_backw, STACK_OFF);
+    }
+#endif /* USE_COLOR_STYLE */
     i = (limit - 1) - strlen(percent) - strlen(title);
     if (i >= CHAR_WIDTH) {
 	LYmove(0, i);
@@ -1844,7 +1853,7 @@ PRIVATE void display_page ARGS3(
 
 #ifdef DISP_PARTIAL
     if (display_partial && text->stbl) {
-	stop_before_for_anchors = Stbl_getStartLine(text->stbl);
+	stop_before_for_anchors = Stbl_getStartLineDeep(text->stbl);
 	if (stop_before_for_anchors > line_number+(display_lines))
 	    stop_before_for_anchors = line_number+(display_lines);
     } else
@@ -2337,6 +2346,232 @@ PUBLIC void HText_beginAppend ARGS1(
 #define CTRACE_SPLITLINE(p)	/*nothing*/
 #endif
 
+PRIVATE int set_style_by_embedded_chars ARGS4(
+	char *,		s,
+	char *,		e,
+	unsigned char,	start_c,
+	unsigned char,	end_c)
+{
+    int ret = NO;
+
+    while (--e >= s) {
+	if (*e == end_c)
+	    break;
+	if (*e == start_c) {
+	    ret = YES;
+	    break;
+	}
+    }
+    return ret;
+}
+
+PRIVATE void move_anchors_in_region ARGS7(
+    HTLine *,		line,
+    int,		line_number,
+    TextAnchor **,	prev_anchor,
+    int *,		prev_head_processed,
+    int,		sbyte,
+    int,		ebyte,
+    int,		shift)		/* Likewise */
+{
+    /*
+     *  Update anchor positions for anchors that start on this line.
+     *  Note: we rely on a->line_pos counting bytes, not
+     *  characters.  That's one reason why HText_trimHightext
+     *  has to be prevented from acting on these anchors in
+     *  partial display mode before we get a chance to
+     *  deal with them here.
+     */
+    TextAnchor *a;
+    int head_processed = *prev_head_processed;
+
+    /* We need to know whether (*prev_anchor)->line_pos is "in new
+       coordinates" or in old ones.  If prev_anchor' head was touched
+       on the previous iteraction, we set head_processed.  The tail
+       may need to be treated now. */
+    for (a = *prev_anchor;
+	 a && a->line_num <= line_number;
+	 a = a->next, head_processed = 0) {
+	/* extent==0 needs to be special-cased; happens if no text for
+	   the anchor was processed yet.  */
+	/* Subtract one so that the space is not inserted at the end
+	   of the anchor... */
+	int last = a->line_pos + (a->extent ? a->extent - 1 : 0);
+
+	/* Include the anchors started on the previous line */
+	if (a->line_num < line_number - 1)
+	    continue;
+	if (a->line_num == line_number - 1)
+	    last -= line->prev->size + 1; /* Fake "\n" "between" lines counted too */
+	if (last < sbyte)		/* Completely before the start */
+	    continue;
+
+	if ( !head_processed		/* a->line_pos is not edited yet */
+	     && a->line_num == line_number
+	     && a->line_pos >= ebyte)	/* Completely after the end */
+	    break;
+	/* Now we know that the anchor context intersects the chunk */
+
+	/* Fix the start */
+	if ( !head_processed && a->line_num == line_number
+	     && a->line_pos >= sbyte ) {
+	    a->line_pos += shift;
+	    a->extent -= shift;
+	    head_processed = 1;
+	}
+	/* Fix the end */
+	if ( last < ebyte )
+	    a->extent += shift;
+	else
+	    break;			/* Keep this `a' for the next step */
+    }
+    *prev_anchor = a;
+    *prev_head_processed = head_processed;
+}
+
+/*
+ *  Given a line and two int arrays of old/now position, this function
+ *  creates a new line where spaces have been inserted/removed
+ *  in appropriate places - so that characters at/after the old
+ *  position end up at/after the new position, for each pair, if possible.
+ *  Some necessary changes for anchors starting on this line are also done
+ *  here if needed.
+ *  Returns a newly allocated HTLine* if changes were made
+ *    (caller has to free the old one).
+ *  Returns NULL if no changes needed.  (Remove-spaces code may be buggy...)
+ * - kw
+ */
+PRIVATE HTLine * insert_blanks_in_line ARGS7(
+    HTLine *,		line,
+    int,		line_number,
+    HText *,		text,
+    TextAnchor *,	prev_anchor,
+    int,		ninserts,
+    int *,		oldpos,		/* Measured in cells */
+    int *,		newpos)		/* Likewise */
+{
+    int ioldc = 0;			/* count visible characters */
+    int ip;				/* count insertion pairs */
+#if defined(USE_COLOR_STYLE)
+    int istyle = 0;
+#endif
+    int added_chars = 0;
+    int shift = 0;
+    int head_processed;
+    HTLine * mod_line;
+    char *newdata;
+    char *s = line->data;
+    char *copied = line->data, *t;
+
+    if (!(line && line->size && ninserts))
+	return NULL;
+    for (ip = 0; ip < ninserts; ip++)
+	if (newpos[ip] > oldpos[ip] &&
+	    (newpos[ip] - oldpos[ip]) > added_chars)
+	    added_chars = newpos[ip] - oldpos[ip];
+    if (line->size + added_chars > MAX_LINE - 2)
+	return NULL;
+    if (line == text->last_line)
+	mod_line = allocHTLine(MAX_LINE);
+    else
+	mod_line = allocHTLine(line->size + added_chars);
+    if (!mod_line)
+	return NULL;
+    if (!prev_anchor)
+	prev_anchor = text->first_anchor;
+    head_processed = (prev_anchor && prev_anchor->line_num < line_number);
+    memcpy(mod_line, line, LINE_SIZE(1));
+    t = newdata = mod_line->data;
+    ip = 0;
+    while (ip <= ninserts) {
+	/* line->size is in bytes, so it may be larger than needed... */
+	int curlim = (ip < ninserts
+		      ? oldpos[ip]
+		      /* Include'em all! */
+		      : (line->size <= MAX_LINE ? MAX_LINE+1 : line->size+1));
+	char *pre = s;
+
+	/* Fast forward to char==curlim or EOL.  Stop *before* the
+	   style-change chars. */
+	while (*s) {
+	    if ( text && text->T.output_utf8
+		 && UCH(*s) >= 0x80 && UCH(*s) <  0xC0 )
+		pre = s + 1;
+	    else if (!IsSpecialAttrChar(*s)) {	/* At a "displayed" char */
+		if (ioldc >= curlim)
+		    break;
+		ioldc++;
+		pre = s + 1;
+	    }
+	    s++;
+	}
+
+	/* Now s is at the "displayed" char, pre is before the style change */
+	if (ip)				/* Fix anchor positions */
+	    move_anchors_in_region(line, line_number, &prev_anchor,
+				   &head_processed,
+				   copied - line->data, pre - line->data,
+				   shift);
+#if defined(USE_COLOR_STYLE)		/* Move styles too */
+#define NStyle mod_line->styles[istyle]
+	for (; istyle < line->numstyles && NStyle.horizpos < curlim ; istyle++)
+	    /* Should not we include OFF-styles at curlim? */
+	    NStyle.horizpos += shift;
+#endif
+	while (copied < pre)	/* Copy verbatim to byte == pre */
+	    *t++ = *copied++;
+	if (ip < ninserts) {		/* Insert spaces */
+	    int delta = newpos[ip] - oldpos[ip] - shift;
+
+	    if (delta < 0) {		/* Not used yet? */
+		while (delta++ < 0 && t > newdata && t[-1] == ' ')
+		    t--, shift--;
+	    } else
+		shift = newpos[ip] - oldpos[ip];
+	    while (delta-- > 0)
+		*t++ = ' ';
+	}
+	ip++;
+    }
+    /* Check whether the last anchor continues on the next line */
+    if (head_processed && prev_anchor && prev_anchor->line_num == line_number)
+	prev_anchor->extent += shift;
+    *t = '\0';
+    mod_line->size = t - newdata;
+    return mod_line;
+}
+
+#if defined(USE_COLOR_STYLE)
+PRIVATE HTStyleChange * skip_matched_and_correct_offsets ARGS3(
+	HTStyleChange *,	end,
+	HTStyleChange *,	start,
+	unsigned,		split_pos)
+{ /* Found an OFF change not part of an adjacent matched pair.
+   * Walk backward looking for the corresponding ON change.
+   * Move everything after split_pos to be at split_pos.
+   * This can only work correctly if all changes are correctly
+   * nested!  If this fails, assume it is safer to leave whatever
+   * comes before the OFF on the previous line alone. */
+    int level = 0;
+    HTStyleChange *tmp = end;
+
+    for (; tmp >= start; tmp--) {
+	if (tmp->style == end->style) {
+	    if (tmp->direction == STACK_OFF)
+		level--;
+	    else if (tmp->direction == STACK_ON) {
+		if (++level == 0)
+		    return tmp;
+	    } else
+		return 0;
+	}
+	if (tmp->horizpos > split_pos)
+	    tmp->horizpos = split_pos;
+    }
+    return 0;
+}
+#endif /* USE_COLOR_STYLE */
+
 PRIVATE void split_line ARGS2(
 	HText *,	text,
 	unsigned,	split)
@@ -2344,9 +2579,6 @@ PRIVATE void split_line ARGS2(
     HTStyle * style = text->style;
     HTLine * temp;
     int spare;
-#if defined(USE_COLOR_STYLE)
-    int inew;
-#endif
     int indent = text->in_line_1 ?
 	  text->style->indent1st : text->style->leftIndent;
     short alignment;
@@ -2355,22 +2587,20 @@ PRIVATE void split_line ARGS2(
     int HeadTrim = 0;
     int SpecialAttrChars = 0;
     int TailTrim = 0;
-    int s;
-
-    /*
-     *  Make new line.
-     */
+    int s, s_post, s_pre, t_underline = underline_on, t_bold = bold_on;
+    char *p;
     HTLine * previous = text->last_line;
     int ctrl_chars_on_previous_line = 0;
     int utfxtra_on_previous_line = utfxtra_on_this_line;
     char * cp;
     /* can't wrap in middle of multibyte sequences, so allocate 2 extra */
     HTLine * line = (HTLine *)LY_CALLOC(1, LINE_SIZE(MAX_LINE)+2);
+
+    /*
+     *  Make new line.
+     */
     if (line == NULL)
 	outofmem(__FILE__, "split_line_1");
-#if defined(USE_COLOR_STYLE)
-    line->styles = stylechanges_buffers[stylechanges_buffers_free = (stylechanges_buffers_free + 1) &1];
-#endif
     ctrl_chars_on_this_line = 0; /*reset since we are going to a new line*/
     utfxtra_on_this_line = 0;	/*reset too, we'll count them*/
     text->LastChar = ' ';
@@ -2381,6 +2611,7 @@ PRIVATE void split_line ARGS2(
 #endif
 
     cp = previous->data;
+    /* Float LY_SOFT_NEWLINE to the start */
     if (cp[0] == LY_BOLD_START_CHAR
      || cp[0] == LY_UNDERLINE_START_CHAR) {
 	switch (cp[1]) {
@@ -2423,36 +2654,42 @@ PRIVATE void split_line ARGS2(
     text->permissible_split = 0;  /* 12/13/93 */
     line->data[0] = '\0';
 
-    /*
-     *  If we are not splitting and need an underline char, add it now. - FM
-     */
-    if ((split < 1) &&
-	!(dump_output_immediately && use_underscore) && underline_on) {
+    alignment = style->alignment;
+
+    if (split > 0) { /* Restore flags to the value at the splitting point */
+	if (!(dump_output_immediately && use_underscore))
+	    t_underline = set_style_by_embedded_chars(
+		previous->data, previous->data + split,
+		LY_UNDERLINE_START_CHAR, LY_UNDERLINE_END_CHAR);
+
+	t_bold = set_style_by_embedded_chars(
+	    previous->data, previous->data + split,
+	    LY_BOLD_START_CHAR, LY_BOLD_END_CHAR);
+
+    }
+
+    if (!(dump_output_immediately && use_underscore) && t_underline) {
 	line->data[line->size++] = LY_UNDERLINE_START_CHAR;
 	line->data[line->size] = '\0';
 	ctrl_chars_on_this_line++;
+	SpecialAttrChars++;
     }
-    /*
-     *  If we are not splitting and need a bold char, add it now. - FM
-     */
-    if ((split < 1) && bold_on) {
+    if (t_bold) {
 	line->data[line->size++] = LY_BOLD_START_CHAR;
 	line->data[line->size] = '\0';
 	ctrl_chars_on_this_line++;
+	SpecialAttrChars++;
     }
 
-    alignment = style->alignment;
     /*
      *  Split at required point
      */
     if (split > 0) {	/* Delete space at "split" splitting line */
-	char *p, *prevdata = previous->data, *linedata = line->data;
+	char *prevdata = previous->data, *linedata = line->data;
 	unsigned plen;
 	int i;
 
-	/*
-	 *  Split the line. - FM
-	 */
+	/* Split the line. - FM */
 	prevdata[previous->size] = '\0';
 	previous->size = split;
 
@@ -2462,160 +2699,76 @@ PRIVATE void split_line ARGS2(
 	 */
 	p = prevdata + split;
 	while ((
+		(*p == ' '
 #ifdef EXP_JUSTIFY_ELTS
 		/* if justification is allowed for prev line, then raw
 		 * HT_NON_BREAK_SPACE are still present in data[] (they'll be
 		 * substituted at the end of this function with ' ') - VH
 		 */
-		(*p == ' ' || *p == HT_NON_BREAK_SPACE ) &&
-#else
-		(*p == ' ') &&
-#endif
-
-		(HeadTrim || text->first_anchor ||
-		 underline_on || bold_on ||
-		 alignment != HT_LEFT ||
-		 style->wordWrap || style->freeFormat ||
-		 style->spaceBefore || style->spaceAfter)) ||
+		 || *p == HT_NON_BREAK_SPACE
+#endif
+		)
+		&& (HeadTrim || text->first_anchor ||
+		    underline_on || bold_on ||
+		    alignment != HT_LEFT ||
+		    style->wordWrap || style->freeFormat ||
+		    style->spaceBefore || style->spaceAfter)) ||
 		*p == LY_SOFT_HYPHEN) {
 	    p++;
 	    HeadTrim++;
 	}
-	plen = strlen(p);
 
-	/*
-	 *  Add underline char if needed. - FM
-	 */
-	if (!(dump_output_immediately && use_underscore)) {
-	    /*
-	     * Make sure our global flag is correct. - FM
-	     */
-	    underline_on = NO;
-	    for (i = (split-1); i >= 0; i--) {
-		if (prevdata[i] == LY_UNDERLINE_END_CHAR) {
-		    break;
-		}
-		if (prevdata[i] == LY_UNDERLINE_START_CHAR) {
-		    underline_on = YES;
-		    break;
-		}
-	    }
-	    /*
-	     *  Act on the global flag if set above. - FM
-	     */
-	    if (underline_on && *p != LY_UNDERLINE_END_CHAR) {
-		linedata[line->size++] = LY_UNDERLINE_START_CHAR;
-		linedata[line->size] = '\0';
-		ctrl_chars_on_this_line++;
-		SpecialAttrChars++;
-	    }
-	    if (plen) {
-		for (i = (plen - 1); i >= 0; i--) {
-		    if (p[i] == LY_UNDERLINE_START_CHAR) {
-			underline_on = YES;
-			break;
-		    }
-		    if (p[i] == LY_UNDERLINE_END_CHAR) {
-			underline_on = NO;
-			break;
-		    }
-		}
-		for (i = (plen - 1); i >= 0; i--) {
-		    if (p[i] == LY_UNDERLINE_START_CHAR ||
-			p[i] == LY_UNDERLINE_END_CHAR) {
-			ctrl_chars_on_this_line++;
-		    }
-		}
-	    }
-	}
-
-	/*
-	 *  Add bold char if needed, first making
-	 *  sure that our global flag is correct. - FM
-	 */
-	bold_on = NO;
-	for (i = (split - 1); i >= 0; i--) {
-	    if (prevdata[i] == LY_BOLD_END_CHAR) {
-		break;
-	    }
-	    if (prevdata[i] == LY_BOLD_START_CHAR) {
-		bold_on = YES;
-		break;
-	    }
-	}
-	/*
-	 *  Act on the global flag if set above. - FM
-	 */
-	if (bold_on && *p != LY_BOLD_END_CHAR) {
-	    linedata[line->size++] = LY_BOLD_START_CHAR;
-	    linedata[line->size] = '\0';
-	    ctrl_chars_on_this_line++;
-	    SpecialAttrChars++;
-	}
-	if (plen) {
-	    for (i = (plen - 1); i >= 0; i--) {
-		if (p[i] == LY_BOLD_START_CHAR) {
-		    bold_on = YES;
-		    break;
-		}
-		if (p[i] == LY_BOLD_END_CHAR) {
-		    bold_on = NO;
-		    break;
-		}
-	    }
+	plen = strlen(p);
+	if (plen) {			/* Count funny characters */
 	    for (i = (plen - 1); i >= 0; i--) {
-		if (p[i] == LY_BOLD_START_CHAR ||
+		if (p[i] == LY_UNDERLINE_START_CHAR ||
+		    p[i] == LY_UNDERLINE_END_CHAR ||
+		    p[i] == LY_BOLD_START_CHAR ||
 		    p[i] == LY_BOLD_END_CHAR ||
-		    p[i] == LY_SOFT_HYPHEN) {
+		    p[i] == LY_SOFT_HYPHEN)
 		    ctrl_chars_on_this_line++;
-		} else if (IS_UTF_EXTRA(p[i])) {
+		else if (IS_UTF_EXTRA(p[i]))
 		    utfxtra_on_this_line++;
-		}
-		if (p[i] == LY_SOFT_HYPHEN && (int)text->permissible_split < i) {
+		if (p[i] == LY_SOFT_HYPHEN && (int)text->permissible_split < i)
 		    text->permissible_split = i + 1;
-		}
 	    }
 	    ctrl_chars_on_this_line += utfxtra_on_this_line;
-	}
 
-	/*
-	 *  Add the data to the new line. - FM
-	 */
-	strcat(linedata, p);
-	line->size += plen;
+	    /* Add the data to the new line. - FM */
+	    strcat(linedata, p);
+	    line->size += plen;
+	}
     }
 
     /*
      *  Economize on space.
      */
-    while ((previous->size > 0) &&
+    p = previous->data + previous->size - 1;
+    while (p >= previous->data
+	   && (*p == ' '
 #ifdef EXP_JUSTIFY_ELTS
 	    /* if justification is allowed for prev line, then raw
 	     * HT_NON_BREAK_SPACE are still present in data[] (they'll be
 	     * substituted at the end of this function with ' ') - VH
 	     */
-	   ((previous->data[previous->size-1] == ' ') ||
-	    (previous->data[previous->size-1] == HT_NON_BREAK_SPACE)) &&
-#else
-	   (previous->data[previous->size-1] == ' ') &&
+	       || *p == HT_NON_BREAK_SPACE
 #endif
+	      )
 #ifdef USE_PRETTYSRC
-	    !psrc_view && /*don't strip trailing whites - since next line can
+	   && !psrc_view /*don't strip trailing whites - since next line can
 		start with LY_SOFT_NEWLINE - so we don't lose spaces when
 		'p'rinting this text to file -VH */
 #endif
-	   (ctrl_chars_on_this_line || HeadTrim || text->first_anchor ||
-	    underline_on || bold_on ||
-	    alignment != HT_LEFT ||
-	    style->wordWrap || style->freeFormat ||
-	    style->spaceBefore || style->spaceAfter)) {
-	/*
-	 *  Strip trailers.
-	 */
-	previous->data[previous->size-1] = '\0';
-	previous->size--;
-	TailTrim++;
-    }
+	   && (ctrl_chars_on_this_line || HeadTrim || text->first_anchor ||
+	       underline_on || bold_on ||
+	       alignment != HT_LEFT ||
+	       style->wordWrap || style->freeFormat ||
+	       style->spaceBefore || style->spaceAfter))
+	p--;	/*  Strip trailers. */
+    TailTrim = previous->data + previous->size - 1 - p;	/*  Strip trailers. */
+    previous->size -= TailTrim;
+    p[1] = '\0';
+
     /*
      *  s is the effective split position, given by either a non-zero
      *  value of split or by the size of the previous line before
@@ -2626,6 +2779,9 @@ PRIVATE void split_line ARGS2(
     } else {
 	s = split;
     }
+    s_post = s + HeadTrim;
+    s_pre  = s - TailTrim;
+
 #ifdef DEBUG_SPLITLINE
 #ifdef DEBUG_APPCH
     if (s != (int)split)
@@ -2634,150 +2790,98 @@ PRIVATE void split_line ARGS2(
 #endif
 
 #if defined(USE_COLOR_STYLE)
-#define LastStyle (previous->numstyles-1)
+    line->styles = stylechanges_buffers[stylechanges_buffers_free = (stylechanges_buffers_free + 1) &1];
     line->numstyles = 0;
-    inew = MAX_STYLES_ON_LINE - 1;
-    /*
-     *  Color style changes after the split position + possible trimmed
-     *  head characters are transferred to the new line.  Ditto for changes
-     *  within the trimming region, but we stop when we reach an OFF change.
-     *  The second while loop below may then handle remaining changes. - kw
-     */
-    while (previous->numstyles && inew >= 0) {
-	if (previous->styles[LastStyle].horizpos > s + HeadTrim) {
-	    line->styles[inew].horizpos =
-		previous->styles[LastStyle].horizpos
-		- (s + HeadTrim) + SpecialAttrChars;
-	    line->styles[inew].direction = previous->styles[LastStyle].direction;
-	    line->styles[inew].style = previous->styles[LastStyle].style;
-	    inew --;
-	    line->numstyles ++;
-	    previous->numstyles --;
-	} else if (previous->styles[LastStyle].horizpos > s - TailTrim &&
-		   (previous->styles[LastStyle].direction == STACK_ON ||
-		    previous->styles[LastStyle].direction == ABS_ON)) {
-	    line->styles[inew].horizpos =
-		(previous->styles[LastStyle].horizpos < s) ?
-		0 : SpecialAttrChars;
-	    line->styles[inew].direction = previous->styles[LastStyle].direction;
-	    line->styles[inew].style = previous->styles[LastStyle].style;
-	    inew --;
-	    line->numstyles ++;
-	    previous->numstyles --;
-	} else
-	    break;
-    }
-    spare = previous->numstyles;
-    while (previous->numstyles && inew >= 0) {
-	if (previous->numstyles >= 2 &&
-	    previous->styles[LastStyle].style
-	    == previous->styles[previous->numstyles-2].style &&
-	    previous->styles[LastStyle].horizpos
-	    == previous->styles[previous->numstyles-2].horizpos &&
-	    ((previous->styles[LastStyle].direction == STACK_OFF &&
-	      previous->styles[previous->numstyles-2].direction == STACK_ON) ||
-	     (previous->styles[LastStyle].direction == ABS_OFF &&
-	      previous->styles[previous->numstyles-2].direction == ABS_ON) ||
-	     (previous->styles[LastStyle].direction == ABS_ON &&
-	      previous->styles[previous->numstyles-2].direction == ABS_OFF)
-		)) {
-	    /*
-	     *  Discard pairs of ON/OFF for the same color style, but only
-	     *  if they appear at the same position. - kw
-	     */
-	    previous->numstyles -= 2;
-	    if (spare > previous->numstyles)
-		spare = previous->numstyles;
-	} else if (spare > 0 && previous->styles[spare - 1].direction &&
-		   previous->numstyles < MAX_STYLES_ON_LINE) {
-	    /*
-	     *  The index variable spare walks backwards through the
-	     *  list of color style changes on the previous line, trying
-	     *  to find an ON change which isn't followed by a
-	     *  corresponding OFF.  When it finds one, the missing OFF
-	     *  change is appended to the end, and an ON change is added
-	     *  at the beginning of the current line.  The OFF change
-	     *  appended to the previous line may get removed again in
-	     *  the next iteration. - kw
-	     */
-	    line->styles[inew].horizpos = 0;
-	    line->styles[inew].direction = ON;
-	    line->styles[inew].style = previous->styles[spare - 1].style;
-	    inew --;
-	    line->numstyles ++;
-	    previous->styles[previous->numstyles].style = line->styles[inew + 1].style;
-
-	    previous->styles[previous->numstyles].direction = ABS_OFF;
-	    previous->styles[previous->numstyles].horizpos = previous->size;
-	    previous->numstyles++;
-	    spare --;
-	} else if (spare >= 2 &&
-		   previous->styles[spare - 1].style == previous->styles[spare - 2].style &&
-		   ((previous->styles[spare - 1].direction == STACK_OFF &&
-		     previous->styles[spare - 2].direction == STACK_ON) ||
-		    (previous->styles[spare - 1].direction == ABS_OFF &&
-		     previous->styles[spare - 2].direction == ABS_ON) ||
-		    (previous->styles[spare - 1].direction == STACK_ON &&
-		     previous->styles[spare - 2].direction == STACK_OFF) ||
-		    (previous->styles[spare - 1].direction == ABS_ON &&
-		     previous->styles[spare - 2].direction == ABS_OFF)
-		       )) {
-		/*
-		 *  Skip pairs of adjacent ON/OFF or OFF/ON changes.
-		 */
-	    spare -= 2;
-	} else if (spare && !previous->styles[spare - 1].direction) {
-	    /*
-	     *  Found an OFF change not part of an adjacent matched pair.
-	     *  Walk backward looking for the corresponding ON change.
-	     *  If we find it, skip the ON/OFF and everything in between.
-	     *  This can only work correctly if all changes are correctly
-	     *  nested!  If this fails, assume it is safer to leave whatever
-	     *  comes before the OFF on the previous line alone.  Setting
-	     *  spare to 0 ensures that it won't be used in a following
-	     *  iteration. - kw
+    {
+	HTStyleChange *from = previous->styles + previous->numstyles - 1;
+	HTStyleChange *to = line->styles + MAX_STYLES_ON_LINE - 1;
+	HTStyleChange *scan, *at_end;
+
+	/*  Color style changes after the split position
+	 *  are transferred to the new line.  Ditto for changes
+	 *  in the trimming region, but we stop when we reach an OFF change.
+	 *  The second loop below may then handle remaining changes. - kw */
+	while (from >= previous->styles && to >= line->styles) {
+	    *to = *from;
+	    if (to->horizpos > s_post)
+		to->horizpos += - s_post + SpecialAttrChars;
+	    else if (to->horizpos > s_pre &&
+		     (to->direction == STACK_ON ||
+		      to->direction == ABS_ON))
+		to->horizpos = (to->horizpos < s) ? 0 : SpecialAttrChars;
+	    else
+		break;
+	    to--;
+	    from--;
+	}
+	/* FROM may be invalid, otherwise it is either an ON change at or
+	   before s_pre, or is an OFF change at or before s_post.  */
+
+	scan = from;
+	at_end = from;
+	/* Now on the previous line we have a correctly nested but
+	   possibly non-terminated sequence of style changes.
+	   Terminate it, and duplicate unterminated changes at the
+	   beginning of the new line. */
+	while (scan >= previous->styles && at_end >= previous->styles) {
+	    /* The algorithm: scan back though the styles on the previous line.
+	       a) If OFF, skip the matched group.
+	          Report a bug on failure.
+	       b) If ON, (try to) cancel the corresponding ON at at_end,
+		  and the corresponding OFF at to;
+		  If not, put the corresponding OFF at at_end, and copy to to;
 	     */
-	    int level=-1;
-	    int itmp;
-	    for (itmp = spare-1; itmp > 0; itmp--) {
-		if (previous->styles[itmp - 1].style
-		    == previous->styles[spare - 1].style) {
-		    if (previous->styles[itmp - 1].direction == STACK_OFF) {
-			level--;
-		    } else if (previous->styles[itmp - 1].direction == STACK_ON) {
-			if (++level == 0)
-			    break;
-		    } else
-			break;
+	    if (scan->direction == STACK_OFF) {
+		scan = skip_matched_and_correct_offsets(scan, previous->styles,
+							s_pre);
+		if (!scan) {
+		    CTRACE((tfp, "BUG: styles improperly nested.\n"));
+		    break;
+		}
+	    } else if (scan->direction == STACK_ON) {
+		if ( at_end->direction == STACK_ON
+		     && at_end->style == scan->style
+		     && at_end->horizpos >= s_pre )
+		    at_end--;
+		else if (at_end >= previous->styles + MAX_STYLES_ON_LINE - 1) {
+		    CTRACE((tfp, "BUG: style overflow before split_line.\n"));
+		    break;
+		} else {
+		    at_end++;
+		    at_end->direction = STACK_OFF;
+		    at_end->style = scan->style;
+		    at_end->horizpos = s_pre;
+		}
+		if ( to < line->styles + MAX_STYLES_ON_LINE - 1
+		     && to[1].direction == STACK_OFF
+		     && to[1].horizpos <= SpecialAttrChars
+		     && to[1].style == scan->style )
+		    to++;
+		else if (to >= line->styles) {
+		    *to = *scan;
+		    to->horizpos = SpecialAttrChars;
+		    to--;
+		} else {
+		    CTRACE((tfp, "BUG: style overflow after split_line.\n"));
+		    break;
 		}
 	    }
-	    if (level == 0)
-		spare = itmp - 1;
-	    else
-		spare = 0;
-	} else {
-	    /*
-	     *  Nothing applied, so we are done with the loop. - kw
-	     */
-	    break;
+	    if (scan->horizpos > s_pre)
+		scan->horizpos = s_pre;
+	    scan--;
 	}
-    }
-    if (previous->numstyles > 0 && previous->styles[LastStyle].direction) {
+	line->numstyles = line->styles + MAX_STYLES_ON_LINE - 1 - to;
+	if (line->numstyles > 0 && line->numstyles < MAX_STYLES_ON_LINE) {
+	    int n;
 
-	CTRACE((tfp, "%s\n%s%s\n",
-		    "........... Too many character styles on line:",
-		    "........... ", previous->data));
-    }
-    if (line->numstyles > 0 && line->numstyles < MAX_STYLES_ON_LINE) {
-	int n;
-	inew ++;
-	for (n = 0; n < line->numstyles; n++)
-		line->styles[n] = line->styles[n + inew];
-    } else if (line->numstyles == 0) {
-	line->styles[0].horizpos = ~0;
+	    for (n = 0; n < line->numstyles; n++)
+		line->styles[n] = to[n + 1];
+	} else if (line->numstyles == 0)
+	    line->styles[0].horizpos = ~0; /* ?!!! */
+	previous->numstyles = at_end - previous->styles + 1;
+	if (previous->numstyles == 0)
+	    previous->styles[0].horizpos = ~0;	/* ?!!! */
     }
-    if (previous->numstyles == 0)
-	previous->styles[0].horizpos = ~0;
 #endif /*USE_COLOR_STYLE*/
 
     temp = (HTLine *)LY_CALLOC(1, LINE_SIZE(previous->size));
@@ -2907,7 +3011,6 @@ PRIVATE void split_line ARGS2(
 	    break;
     } /* switch */
 
-    text->chars = text->chars + previous->size + 1;	/* 1 for the line */
     text->in_line_1 = NO;		/* unless caller sets it otherwise */
 
     /*
@@ -2915,126 +3018,73 @@ PRIVATE void split_line ARGS2(
      *  structure values for the new line. - FM
      */
 
-    if (split > 0 || s > 0) {		/* if not completely empty */
+    if (s > 0) {			/* if not completely empty */
 	TextAnchor * prev_a = NULL;
+	int moved = 0;
+
+	/* In the algorithm below we move or not move anchors between
+	   lines using some heuristic criteria.  However, it is
+	   desirable not to have two consequent anchors on different
+	   lines *in a wrong order*!  (How can this happen?)
+	   So when the "reasonable choice" is not unique, we use the
+	   MOVED flag to choose one.
+	 */
+	/* Our operations can make a non-empty all-whitespace link
+	   empty.  So what? */
 	for (a = text->first_anchor; a; prev_a = a, a = a->next) {
 	    if (a->line_num == CurLine) {
-		int old_e = a->extent;
-		int a0 = a->line_pos, a1 = a->line_pos + a->extent;
-		int S, d, new_pos, new_ext;
-		if (a->link_type == INPUT_ANCHOR) {
-		    if (a->line_pos >= s) {
-			a->start += (1 + SpecialAttrChars - HeadTrim - TailTrim);
-			a->line_pos -= (s - SpecialAttrChars + HeadTrim);
-			a->line_num = text->Lines;
+		int len = a->extent, n = a->number, start = a->line_pos;
+		int end = start + len;
+
+		/* Which anchors do we leave on the previous line?
+		   a) empty finished (We need a cut-off value.
+		      "Just because": those before s;
+		      this is the only case when we use s, not s_pre/s_post);
+		   b) Those which start before s_pre;
+		 */
+		if (start < s_pre) {
+		    if (end <= s_pre)
+			continue;	/* No problem */
+
+		    CTRACE_SPLITLINE((tfp, "anchor %d: no relocation", n));
+		    if (end > s_post) {
+			CTRACE_SPLITLINE((tfp, " of the start.\n"));
+			a->extent += -(TailTrim + HeadTrim) - SpecialAttrChars;
+		    } else {
+			CTRACE_SPLITLINE((tfp, ", cut the end.\n"));
+			a->extent = s_pre - start;
 		    }
 		    continue;
+		} else if (start < s && !len
+			   && (!n || (a->show_anchor && !moved))) {
+		    CTRACE_SPLITLINE((tfp, "anchor %d: no relocation, empty-finished",
+				      n));
+		    a->line_pos = s_pre; /* Leave at the end of line */
+		    continue;
 		}
-		if (a0 < s - TailTrim && a1 <= s - TailTrim) {
-		    continue;	/* unaffected, leave it where it is. */
-		}
-		S = s + a->start - a->line_pos;
-		d = S - s;	/* == a->start - a->line_pos */
-		new_ext = old_e = a->extent;
-
-		if (!old_e &&
-		    (!a->number || a->show_anchor) &&
-		    a0 <= s + HeadTrim) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,1));
-		    /*
-		     *  It is meant to be empty, and/or endAnchor
-		     *  has seen it and recognized it as empty.
-		     */
-		    new_pos = (a0 <= s) ? s - TailTrim :
-			s - TailTrim + 1;
-		    if (prev_a && new_pos + d < prev_a->start) {
-			if (prev_a->start <= S - TailTrim + 1 + SpecialAttrChars)
-			    new_pos = prev_a->start - d;
-			else
-			    new_pos = s - TailTrim + 1 + SpecialAttrChars;
-		    }
-		} else if (old_e &&
-		     a0 >= s - TailTrim && a0 <= s + HeadTrim &&
-		     a1 <= s + HeadTrim) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,2));
-		    /*
-		     *  endAnchor has seen it, it is effectively empty
-		     *  after our trimming, but endAnchor has for some
-		     *  reason not recognized this.  In other words,
-		     *  this should not happen.
-		     *  Should we not adjust the extent and let it "leak"
-		     *  into the new line?
-		     */
-		    new_pos = (a0 < s) ? s - TailTrim :
-			s - TailTrim + 1;
-		    if (prev_a && new_pos + d < prev_a->start) {
-			if (prev_a->start <= S - TailTrim + 1 + SpecialAttrChars)
-			    new_pos = prev_a->start - d;
-			else
-			    new_pos = s - TailTrim + 1 + SpecialAttrChars;
-		    }
-		    new_ext = 0;
-		} else if (a0 >= s + HeadTrim) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,3));
-		    /*
-		     *  Completely after split, just shift.
-		     */
-		    new_pos = a0 - TailTrim + 1 - HeadTrim + SpecialAttrChars;
-		} else if (!old_e) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,4));
-		    /*
-		     *  No extent set, we may still be growing it.
-		     */
-		    new_pos = s - TailTrim + 1 + SpecialAttrChars;
 
-		    /*
-		     *  Ok, it's neither empty, nor is it completely
-		     *  before or after the split region (including trimmed
-		     *  stuff).  So the anchor is either being split in
-		     *  the middle, with stuff remaining on both lines,
-		     *  or something is being nibbled off, either at
-		     *  the end (anchor stays on previous line) or at
-		     *  the beginning (anchor is on new line).  Let's
-		     *  try in that order.
-		     */
-		} else if (a0 < s - TailTrim &&
-			   a1 > s + HeadTrim) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,5));
-		    new_pos = a0;
-		    new_ext = old_e - TailTrim - HeadTrim + SpecialAttrChars;
-		} else if (a0 < s - TailTrim) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,6));
-		    new_pos = a0;
-		    new_ext = s - TailTrim - a0;
-		} else if (a1 > s + HeadTrim) {
-		    CTRACE_SPLITLINE((tfp, "anchor %d case %d: ", a->number,7));
-		    new_pos = s - TailTrim + 1 + SpecialAttrChars;
-		    new_ext = old_e - (s + HeadTrim - a0);
-		} else {
-		    CTRACE((tfp, "split_line anchor %d line %d: This should not happen!\n",
-			   a->number, a->line_num));
-		    CTRACE((tfp,
-			   "anchor %d: (T,H,S)=(%d,%d,%d); (line,start,pos,ext):(%d,%d,%d,%d)!\n",
-			   a->number,
-			   TailTrim,HeadTrim,SpecialAttrChars,
-			   a->line_num,a->start,a->line_pos,a->extent));
-		    continue;
+		/* The rest we relocate */
+		moved = 1;
+		a->line_num++;
+		CTRACE_SPLITLINE((tfp, "anchor %d: (T,H,S)=(%d,%d,%d); (line,pos,ext):(%d,%d,%d), ",
+		       n, TailTrim,HeadTrim,SpecialAttrChars,
+		       a->line_num,a->line_pos,a->extent));
+		if (end < s_post) {	/* Move the end to s_post */
+		    CTRACE_SPLITLINE((tfp, "Move end +%d, ", s_post - end));
+		    len += s_post - end;
 		}
-		CTRACE_SPLITLINE((tfp, "(T,H,S)=(%d,%d,%d); (line,start,pos,ext):(%d,%d,%d,%d",
-		       TailTrim,HeadTrim,SpecialAttrChars,
-		       a->line_num,a->start,a->line_pos,a->extent));
-		if (new_pos != a->line_pos)
-		    a->start = new_pos + d;
-		if (new_pos > s - TailTrim) {
-		    new_pos -= s - TailTrim + 1;
-		    a->line_num = text->Lines;
+		if (start < s_post) {	/* Move the start to s_post */
+		    CTRACE_SPLITLINE((tfp, "Move start +%d, ", s_post - start));
+		    len -= s_post - start;
+		    start = s_post;
 		}
-		a->line_pos = new_pos;
-		a->extent = new_ext;
+		a->line_pos = start - s_post + SpecialAttrChars;
+		a->extent = len;
 
-		CTRACE_SPLITLINE((tfp, "))->(%d,%d,%d,%d)\n",
-		       a->line_num,a->start,a->line_pos,a->extent));
-	    }
+		CTRACE_SPLITLINE((tfp, "->(%d,%d,%d)\n",
+		       a->line_num,a->line_pos,a->extent));
+	    } else if (a->line_num > CurLine)
+		break;
 	}
     }
 
@@ -3043,6 +3093,7 @@ PRIVATE void split_line ARGS2(
 
     if (this_line_was_split
      && spare
+     && !text->stbl	/* We don't inform TRST on the cell width change yet */
      && justify_max_void_percent > 0
      && justify_max_void_percent <= 100
      && justify_max_void_percent >= ((100*spare)
@@ -3055,10 +3106,8 @@ PRIVATE void split_line ARGS2(
 	ht_run_info* r = ht_runs;
 	char c;
 	int total_byte_len = 0, total_cell_len = 0;
-	int d_, r_, i, j, cur_byte_num, *m;
+	int d_, r_;
 	HTLine * jline;
-	char *jdata;
-	char *prevdata = previous->data;
 
 	ht_num_runs = 0;
 	r->byte_len = r->cell_len = 0;
@@ -3106,183 +3155,46 @@ PRIVATE void split_line ARGS2(
 	++ht_num_runs;
 
 	if (ht_num_runs != 1) {
+	    int *oldpos = (int*)malloc(sizeof(int)*2*(ht_num_runs - 1));
+	    int *newpos = oldpos + ht_num_runs - 1;
+	    int i = 1;
 
-	    jline = allocHTLine(previous->size+spare);
-	    if (jline == NULL)
-		outofmem(__FILE__, "split_line_1");
-#if defined(USE_COLOR_STYLE)
-	    jline->styles = previous->styles;
-#endif
-	    jdata = jline->data;
+	    if (oldpos == NULL)
+		outofmem(__FILE__, "split_line_3");
 
-	    /*
-	     * we have to spread num_spaces among (ht_num_runs-1) runs - we
-	     * fill justified_text_map in order to apply changes caused by
-	     * justification to anchor data and color styles, and justify
-	     * original string on the fly
-	     */
 	    d_ = spare/(ht_num_runs-1);
 	    r_ = spare % (ht_num_runs-1);
 
-	    m = justified_text_map;
-	    for(jp = previous->data, i = 0; i < justify_start_position; ++i) {
-		*m++ = i;
-		*jdata++ = ( *prevdata == HT_NON_BREAK_SPACE ? ' ' : *prevdata);
-		++prevdata;
-	    }
-
-	    cur_byte_num = i;
-
-	    for (r = ht_runs; r < ht_runs + ht_num_runs; ++r ) {
+	    /* The first run is not moved, proceed to the second one */
+	    oldpos[0] = justify_start_position + ht_runs[0].cell_len + 1;
+	    newpos[0] = oldpos[0] + ( d_ + ( r_--  > 0 ) );
+	    while (i < ht_num_runs - 1) {
+		int delta = ht_runs[i].cell_len + 1;
 
-		/* copy the reference to run content */
-		for(i=0; i < r->byte_len;  ++i) {
-		    *m++ = cur_byte_num++;
-		    *jdata++ = *prevdata++;
-		}
-		if ( r - ht_runs  == ht_num_runs - 1 ) { /* nop on last run */
-		    *jdata++ = '\0';
-		    break;
-		}
-
-		/* the space that was in original string */
-		*m++ = cur_byte_num++;
-		*jdata++ = ' ';
-		prevdata++;/* skip that space */
-
-		cur_byte_num += j=( d_ + ( r_--  > 0 ) );
-		for (i=0; i<j; ++i)
-		    *jdata++ = ' ';
+		oldpos[i] = oldpos[i-1] + delta;
+		newpos[i] = newpos[i-1] + delta + ( d_ + ( r_--  > 0 ) );
+		i++;
 	    }
-	    *m++ = previous->size + spare; /*map the end */
-
-	    text->chars += spare;
-
-	    jline->offset = previous->offset;
-	    jline->size = previous->size + spare;
-	    jline->split_after = previous->split_after;
-	    jline->bullet = previous->bullet;
-	    jline->expansion_line = previous->expansion_line;
-
-	    jline->prev = previous->prev;
-	    jline->next = previous->next;
+	    jline = insert_blanks_in_line(previous, CurLine, text,
+					  last_anchor_of_previous_line,
+					  ht_num_runs - 1, oldpos, newpos);
+	    free((char*)oldpos);
+	    if (jline == NULL)
+		outofmem(__FILE__, "split_line_4");
 	    previous->next->prev = jline;
 	    previous->prev->next = jline;
 
-#if defined(USE_COLOR_STYLE)
-	    jline->numstyles = previous->numstyles;
-
-	    /* now copy and fix colorstyles */
-	    for(i = 0; i < jline->numstyles; ++i) {
-		int hpos = previous->styles[i].horizpos;
-
-		jline->styles[i].style = previous->styles[i].style;
-		jline->styles[i].direction = previous->styles[i].direction;
-		/*there are stylechanges with hpos > line length */
-		jline->styles[i].horizpos = (hpos > previous->size)
-			? previous->size + spare
-			: justified_text_map[hpos];
-	    }
-#endif
-	    /* we have to fix anchors*/
-	    {
-		/*a2 is the last anchor on the line preceding 'previous'*/
-		TextAnchor* a2 = last_anchor_of_previous_line;
-
-		if (!a2)
-		    a2 = text->first_anchor;
-		else if (a2 == text->last_anchor)
-		    a2 = NULL;
-		else
-		    a2 = a2->next; /*1st anchor on line we justify */
-
-		if (a2) {
-		    for (; a2 /*&& a2->line_num == text->Lines-1*/;
-			    last_anchor_of_previous_line = a2, a2 = a2->next) {
-			int oldpos = a2->line_pos,
-			    newpos = justified_text_map[a2->line_pos],
-			    shift = newpos - oldpos;
-
-			if (a2->line_num == text->Lines)
-			    break;/*new line not yet completed*/
-
-			if (a2->line_num == text->Lines-1) {
-			    a2->line_pos = newpos;
-			    a2->start += shift;
-
-			    if (!a2->extent && a2->number &&
-				(a2->link_type & HYPERTEXT_ANCHOR) &&
-				!a2->show_anchor &&
-				a2->number == text->last_anchor_number)
-				/* seems endAnchor wasn't called for it */ {
-				a2 = a2->next; /*don't allow .start to be incremented
-				    by 'spare' once more */
-				break;
-			    }
-
-			    if ( a2->extent + oldpos > (int) previous->size)
-				/*anchor content wrapped to new line */
-				a2->extent += (jline->size - newpos) -
-				    (previous->size - oldpos);
-			    else
-				a2->extent = justified_text_map[oldpos+a2->extent]
-				    - newpos;
-
-			} else {
-			    /* This is the anchor that was started on previous
-			     * line.  Its .line_pos and .start were updated.
-			     * So we have to update only extent.  If anchor
-			     * text is longer than two lines, we don't bother
-			     * setting it to correct value.
-			     */
-			    if (a2->line_num != text->Lines-2)
-				continue; /* don't bother */
-			    if (!a2->extent && a2->number &&
-				(a2->link_type & HYPERTEXT_ANCHOR) &&
-				!a2->show_anchor &&
-				a2->number == text->last_anchor_number)
-				/* seems endAnchor wasn't called for it */
-				continue;
-			    /* anchor is started at text->Lines-2, and there
-			     * are two cases - either it was wrapped to newline
-			     * or it ended in previous text->Lines-1.
-			     */
-			    {
-				int p2sz = previous->prev->size,
-				    p1sz = previous->size,
-				    onp2sz = p2sz - a2->line_pos,
-				    onp1sz = a2->extent - 1 - onp2sz;
-
-				if (onp1sz >= p1sz)
-				    /* this anchor will be skipped at the next
-				     * split_line here, since its line_num will
-				     * be text->Lines-3
-				     */
-				    a2->extent += spare;
-				else if (onp2sz < a2->extent)
-				    a2->extent += justified_text_map[onp1sz-1]
-					 - onp1sz + 1;
-			    }
-
-			}
-
-		    }
-
-		    /* iterate on anchors in the last line */
-		    for (; a2; a2 = a2->next)
-			a2->start += spare;
-		}
-	    }
-
 	    FREE(previous);
 
-	} else { /* (ht_num_runs==1) */
+	    previous = jline;
+	}
+	{ /* (ht_num_runs==1) */
 	    /* keep maintaining 'last_anchor_of_previous_line' */
 	    TextAnchor* a2 = last_anchor_of_previous_line;
 	    if (justify_start_position) {
-		char* p = previous->data;
-		for( ; p < previous->data + justify_start_position; ++p)
-		    *p = (*p == HT_NON_BREAK_SPACE ? ' ' : *p);
+		char* p2 = previous->data;
+		for( ; p2 < previous->data + justify_start_position; ++p2)
+		    *p2 = (*p2 == HT_NON_BREAK_SPACE ? ' ' : *p2);
 	    }
 
 	    if (!a2)
@@ -3298,23 +3210,23 @@ PRIVATE void split_line ARGS2(
 	}
     } else {
 	if (REALLY_CAN_JUSTIFY(text) ) {
-	    char* p;
+	    char* p2;
 
 	    /* it was permitted to justify line, but this function was called
 	     * to end paragraph - we must substitute HT_NON_BREAK_SPACEs with
 	     * spaces in previous line
 	     */
-	    if (line->size) {
-		  CTRACE((tfp,"justification: shouldn't happen - new line is not empty!\n"));
+	    if (line->size && !text->stbl) {
+		  CTRACE((tfp,"BUG: justification: shouldn't happen - new line is not empty!\n"));
 	    }
 
-	    for (p=previous->data;*p;++p)
-		if (*p == HT_NON_BREAK_SPACE)
-		    *p = ' ';
+	    for (p2=previous->data;*p2;++p2)
+		if (*p2 == HT_NON_BREAK_SPACE)
+		    *p2 = ' ';
 	} else if (have_raw_nbsps) {
 	    /* this is very rare case, that can happen in forms placed in
 	       table cells*/
-	    int i;
+	    unsigned i;
 
 	    for (i = 0; i< previous->size; ++i)
 		if (previous->data[i] == HT_NON_BREAK_SPACE)
@@ -3349,6 +3261,13 @@ PRIVATE void blank_lines ARGS2(
 
     if (!HText_LastLineSize(text, IgnoreSpaces)) { /* No text on current line */
 	HTLine * line = text->last_line->prev;
+
+#ifdef USE_COLOR_STYLE
+	/* Style-change petty requests at the start of the document: */
+	if (line == text->last_line && newlines == 1)
+	    return;			/* Do not add a blank line at start */
+#endif
+
 	while ((line != text->last_line) &&
 	       (HText_TrueLineSize(line, text, IgnoreSpaces) == 0)) {
 	    if (newlines == 0)
@@ -4411,9 +4330,9 @@ PUBLIC void _internal_HTC ARGS3(HText *,text, int,style, int,dir)
 	line = text->last_line;
 
 	if (line->numstyles > 0 && dir == 0 &&
-	    line->styles[line->numstyles].direction &&
-	    line->styles[line->numstyles].style == style &&
-	    (int) line->styles[line->numstyles].horizpos
+	    line->styles[line->numstyles-1].direction &&
+	    line->styles[line->numstyles-1].style == style &&
+	    (int) line->styles[line->numstyles-1].horizpos
 	    == (int)line->size - ctrl_chars_on_this_line) {
 	    /*
 	     *  If this is an OFF change directly preceded by an
@@ -4483,138 +4402,6 @@ PUBLIC void HText_setIgnoreExcess ARGS2(
 */
 
 /*
- *  Given a line and two int arrays of old/now position, this function
- *  does the actual work of creating a new line where spaces have been
- *  inserted in appropriate places - so that characters at/after the old
- *  position end up at/after the new position, for each pair, if possible.
- *  Some necessary changes for anchors starting on this line are also done
- *  here if needed.
- *  Returns a newly allocated HTLine* if changes were made
- *    (caller has to free the old one).
- *  Returns NULL if no changes needed.
- * - kw
- */
-PRIVATE HTLine * insert_blanks_in_line ARGS6(
-    HTLine *,		line,
-    int,		line_number,
-    HText *,		text,
-    int,		ninserts,
-    int *,		oldpos,
-    int *,		newpos)
-{
-    int i;
-    int ioldb, inewb;		/* count bytes */
-    int ioldc = 0, inewc = 0;	/* count visible characters (positions) */
-    int ip = 0;			/* count oldpos,newpos insertion pairs */
-    int acurshift, ashift = 0;	/* for shifting of anchors in this line */
-#if defined(USE_COLOR_STYLE)
-    int stcurshift, stshift = 0; /* for shifting of styles in this line */
-    int istyle;
-#endif
-    int added_chars = 0;
-    HTLine * mod_line;
-    char * newdata;
-    TextAnchor * a;
-    if (!(line && line->size && ninserts))
-	return NULL;
-    for (i = 0; i < ninserts; i++)
-	if (newpos[i] > oldpos[i] &&
-	    (newpos[i] - oldpos[i]) > added_chars)
-	    added_chars = newpos[i] - oldpos[i];
-    if (line->size + added_chars > MAX_LINE - 2)
-	return NULL;
-    if (line == text->last_line)
-	mod_line = allocHTLine(MAX_LINE);
-    else
-	mod_line = allocHTLine(line->size + added_chars);
-    if (!mod_line)
-	return NULL;
-    memcpy(mod_line, line, LINE_SIZE(1));
-    newdata = mod_line->data;
-    for (ioldb = 0, inewb = 0; ioldb < (int)line->size; ioldb++) {
-	if ((line->data[ioldb] == LY_BOLD_START_CHAR ||
-	     line->data[ioldb] == LY_UNDERLINE_START_CHAR ||
-	     !IsSpecialAttrChar(line->data[ioldb])) &&
-	    (!(text && text->T.output_utf8) ||
-	     UCH(line->data[ioldb]) < 128 ||
-	     (UCH((line->data[ioldb] & 0xc0)) == 0xc0))) {
-	    /*
-	     *  A new displayable character starts here.  Time to check
-	     *  whether this is a position to insert spaces.
-	     */
-	    while (ip < ninserts && oldpos[ip] <= ioldc) {
-		if (inewc < newpos[ip]) {
-		    /*
-		     *  Yup, spaces to insert.  We also have to update
-		     *  anchor positions for anchors that start on the
-		     *  same line, this is a pain.  Let's do it first.
-		     *  Note: we rely on a->line_pos counting bytes, not
-		     *  characters.  That's one reason why HText_trimHightext
-		     *  has to be prevented from acting on these anchors in
-		     *  partial display mode before we get a chance to
-		     *  deal with them here.
-		     */
-		    acurshift = 0;
-		    for (a = text->last_anchor_before_stbl ?
-			     text->last_anchor_before_stbl->next :
-			     text->first_anchor;
-			 a && a->line_num <= line_number; a = a->next) {
-			if (a->line_num == line_number)
-			    if (a->line_pos - ashift >= ioldb) {
-				acurshift = newpos[ip] - inewc;
-				a->line_pos += acurshift;
-				a->start += acurshift;
-			    }
-		    }
-		    ashift += acurshift;
-
-		    /*  doing something for color styles here.
-		     *  we rely on horizpos counting characters
-		     *  (display positions), not bytes. */
-#if defined(USE_COLOR_STYLE)
-#define NStyle mod_line->styles[istyle]
-		    stcurshift = 0;
-		    for (istyle = 0; istyle < line->numstyles;
-			 istyle++) {
-			if (NStyle.horizpos - stshift >= ioldc) {
-			    stcurshift = newpos[ip] - inewc;
-			    NStyle.horizpos += stcurshift;
-			}
-		    }
-		    stshift += stcurshift;
-#endif
-		    /*
-		     *  Now insert the spaces.
-		     */
-		    for (; inewc < newpos[ip]; inewc++) {
-			newdata[inewb++] = ' ';
-		    }
-		}
-		ip++;	/* done with this oldpos[ip],newpos[ip] pair. */
-	    }
-	    /*
-	     *  Copy character data over, advance position pointers.
-	     */
-	    newdata[inewb++] = line->data[ioldb];
-	    if (!(line->data[ioldb] == LY_BOLD_START_CHAR ||
-		  line->data[ioldb] == LY_UNDERLINE_START_CHAR)) {
-		ioldc++;
-		inewc++;
-	    }
-	} else {
-	    /*
-	     *  Just copy special attribute chars and utf-8 additional
-	     *  bytes over, don't advance position pointers.
-	     */
-	    newdata[inewb++] = line->data[ioldb];
-	}
-    }
-    newdata[inewb] = '\0';
-    mod_line->size = inewb;
-    return mod_line;
-}
-
-/*
  *  HText_insertBlanksInStblLines fixes up table lines when simple table
  *  processing is closed, by calling insert_blanks_in_line for lines
  *  that need fixup.  Also recalculates alignment for those lines,
@@ -4636,7 +4423,6 @@ PRIVATE int HText_insertBlanksInStblLines ARGS2(
     int		last_nonempty = -1;
 #endif
     int		added_chars_before = 0;
-    TextAnchor * a;
     int lines_changed = 0;
     int max_width = 0, indent, spare, table_offset;
     HTStyle *style;
@@ -4662,14 +4448,6 @@ PRIVATE int HText_insertBlanksInStblLines ARGS2(
     }
     first_lineno_pass2 = last_lineno = me->Lines;
     for (; line && lineno <= last_lineno; line = line->next, lineno++) {
-	if (added_chars_before) {
-	    for (a = me->last_anchor_before_stbl ?
-		     me->last_anchor_before_stbl->next : me->first_anchor;
-		 a && a->line_num <= lineno; a = a->next) {
-		if (a->line_num == lineno)
-		    a->start += added_chars_before;
-	    }
-	}
 	ninserts = Stbl_getFixupPositions(me->stbl, lineno, oldpos, newpos);
 	if (ninserts < 0)
 	    continue;
@@ -4712,12 +4490,12 @@ PRIVATE int HText_insertBlanksInStblLines ARGS2(
 	    continue;
 	}
 	mod_line = insert_blanks_in_line(line, lineno, me,
+					 me->last_anchor_before_stbl,
 					 ninserts, oldpos, newpos);
 	if (mod_line) {
 	    if (line == me->last_line) {
 		me->last_line = mod_line;
 	    } else {
-		me->chars += (mod_line->size - line->size);
 		added_chars_before += (mod_line->size - line->size);
 	    }
 	    line->prev->next = mod_line;
@@ -4807,7 +4585,7 @@ PRIVATE int HText_insertBlanksInStblLines ARGS2(
 	 *  Still not enough.  Something went wrong.  Try the best we
 	 *  can do.
 	 */
-	CTRACE((tfp, "insertBlanks: resulting table too wide by %d positions!",
+	CTRACE((tfp, "BUG: insertBlanks: resulting table too wide by %d positions!\n",
 	       -spare));
 	indent = spare = 0;
     }
@@ -4848,11 +4626,11 @@ PRIVATE int HText_insertBlanksInStblLines ARGS2(
 	    CTRACE((tfp, " %d:%d", lineno, table_offset - line->offset));
 	    line->offset = table_offset;
 	}
+    }
 #ifdef EXP_NESTED_TABLES
-	if (max_width)
-	    Stbl_update_enclosing(me->stbl, max_width, last_nonempty);
+    if (max_width)
+	Stbl_update_enclosing(me->stbl, max_width, last_nonempty);
 #endif
-    }
     CTRACE((tfp, " %d:done\n", lineno));
     free(oldpos);
     return lines_changed;
@@ -4867,20 +4645,20 @@ PRIVATE int HText_insertBlanksInStblLines ARGS2(
 PUBLIC void HText_cancelStbl ARGS1(
 	HText *,	me)
 {
-    STable_info *stbl;
-
     if (!me || !me->stbl) {
 	CTRACE((tfp, "cancelStbl: ignored.\n"));
 	return;
     }
     CTRACE((tfp, "cancelStbl: ok, will do.\n"));
 #ifdef EXP_NESTED_TABLES
-    stbl = me->stbl;
+    {
+    STable_info *stbl = me->stbl;
     while (stbl) {
 	STable_info *enclosing = Stbl_get_enclosing(stbl);
 	Stbl_free(stbl);
 	stbl = enclosing;
     }
+    }
 #else
     Stbl_free(me->stbl);
 #endif
@@ -5012,7 +4790,7 @@ PUBLIC void HText_endStblTD ARGS1(
 {
     if (!me || !me->stbl)
 	return;
-    if (Stbl_finishCellInTable(me->stbl, YES,
+    if (Stbl_finishCellInTable(me->stbl, TRST_ENDCELL_ENDTD,
 			       me->Lines, HText_LastLineSize(me,FALSE)) < 0)
 	HText_cancelStbl(me);	/* give up */
 }
@@ -5079,7 +4857,6 @@ PUBLIC int HText_beginAnchor ARGS3(
 	outofmem(__FILE__, "HText_beginAnchor");
     a->hightext  = NULL;
     a->hightext2 = NULL;
-    a->start = text->chars + text->last_line->size;
     a->inUnderline = underline;
 
     a->line_num = text->Lines;
@@ -5122,7 +4899,6 @@ PUBLIC int HText_beginAnchor ARGS3(
 	HText_appendText(text, marker);
 	if (saved_linenum && text->Lines && saved_lastchar != ' ')
 	    text->LastChar = ']'; /* if marker not after space caused split */
-	a->start = text->chars + text->last_line->size;
 	a->line_num = text->Lines;
 	a->line_pos = text->last_line->size;
     }
@@ -5130,15 +4906,11 @@ PUBLIC int HText_beginAnchor ARGS3(
     return(a->number);
 }
 
-/*
-    This returns whether the given anchor has blank content. Shamelessly copied
-    from HText_endAnchor. The values returned are meaningful only for "normal"
-    links - like ones produced by <a href=".">foo</a>, no inputs, etc. - VH
-*/
-#ifdef MARK_HIDDEN_LINKS
-PUBLIC BOOL HText_isAnchorBlank ARGS2(
+/* If !really, report whether the anchor is empty. */
+PRIVATE int HText_endAnchor0 ARGS3(
 	HText *,	text,
-	int,		number)
+	int,		number,
+	int,		really)
 {
     TextAnchor *a;
 
@@ -5170,7 +4942,7 @@ PUBLIC BOOL HText_isAnchorBlank ARGS2(
 	}
     }
 
-    CTRACE((tfp, "GridText:HText_isAnchorBlank: number:%d link_type:%d\n",
+    CTRACE((tfp, "GridText:HText_endAnchor0: number:%d link_type:%d\n",
 			a->number, a->link_type));
     if (a->link_type == INPUT_ANCHOR) {
 	/*
@@ -5178,188 +4950,8 @@ PUBLIC BOOL HText_isAnchorBlank ARGS2(
 	 */
 
 	CTRACE((tfp,
-	   "HText_isAnchorBlank: internal error: last anchor was input field!\n"));
-	return 0;
-    }
-    if (a->number) {
-	/*
-	 *  If it goes somewhere...
-	 */
-	int i, j, k;
-	HTLine *last = text->last_line;
-	HTLine *prev = text->last_line->prev;
-	HTLine *start = last;
-	int CurBlankExtent = 0;
-	int BlankExtent = 0;
-
-	int extent_adjust = (text->chars + last->size) - a->start -
-		     (text->Lines - a->line_num);
-
-	/*
-	 *  Check if the anchor content has only
-	 *  white and special characters, starting
-	 *  with the content on the last line. - FM
-	 */
-	a->extent += extent_adjust;
-	if (a->extent > (int)last->size) {
-	    /*
-	     *  The anchor extends over more than one line,
-	     *  so set up to check the entire last line. - FM
-	     */
-	    i = last->size;
-	} else {
-	    /*
-	     *  The anchor is restricted to the last line,
-	     *  so check from the start of the anchor. - FM
-	     */
-	    i = a->extent;
-	}
-	k = j = (last->size - i);
-	while (j < (int)last->size) {
-	    if (!IsSpecialAttrChar(last->data[j]) &&
-		!isspace(UCH(last->data[j])) &&
-		last->data[j] != HT_NON_BREAK_SPACE &&
-		last->data[j] != HT_EN_SPACE)
-		break;
-	    i--;
-	    j++;
-	}
-	if (i == 0) {
-	    if (a->extent > (int)last->size) {
-		/*
-		 *  The anchor starts on a preceding line, and
-		 *  the last line has only white and special
-		 *  characters, so declare the entire extent
-		 *  of the last line as blank. - FM
-		 */
-		CurBlankExtent = BlankExtent = last->size;
-	    } else {
-		/*
-		 *  The anchor starts on the last line, and
-		 *  has only white or special characters, so
-		 *  declare the anchor's extent as blank. - FM
-		 */
-		CurBlankExtent = BlankExtent = a->extent;
-	    }
-	}
-	/*
-	 *  While the anchor starts on a line preceding
-	 *  the one we just checked, and the one we just
-	 *  checked has only white and special characters,
-	 *  check whether the anchor's content on the
-	 *  immediately preceding line also has only
-	 *  white and special characters. - FM
-	 */
-	while (i == 0 &&
-	       (a->extent > CurBlankExtent ||
-		(a->extent == CurBlankExtent &&
-		 k == 0 &&
-		 prev != text->last_line &&
-		 (prev->size == 0 ||
-		  prev->data[prev->size - 1] == ']')))) {
-	    start = prev;
-	    k = j = prev->size - a->extent + CurBlankExtent;
-	    if (j < 0) {
-		/*
-		 *  The anchor starts on a preceding line,
-		 *  so check all of this line. - FM
-		 */
-		j = 0;
-		i = prev->size;
-	    } else {
-		/*
-		 *  The anchor starts on this line. - FM
-		 */
-		i = a->extent - CurBlankExtent;
-	    }
-	    while (j < (int)prev->size) {
-		if (!IsSpecialAttrChar(prev->data[j]) &&
-		    !isspace(UCH(prev->data[j])) &&
-		    prev->data[j] != HT_NON_BREAK_SPACE &&
-		    prev->data[j] != HT_EN_SPACE)
-		    break;
-		i--;
-		j++;
-	    }
-	    if (i == 0) {
-		if (a->extent > (CurBlankExtent + (int)prev->size) ||
-		    (a->extent == CurBlankExtent + (int)prev->size &&
-		     k == 0 &&
-		     prev->prev != text->last_line &&
-		     (prev->prev->size == 0 ||
-		      prev->prev->data[prev->prev->size - 1] == ']'))) {
-		    /*
-		     *  This line has only white and special
-		     *  characters, so treat its entire extent
-		     *  as blank, and decrement the pointer for
-		     *  the line to be analyzed. - FM
-		     */
-		    CurBlankExtent += prev->size;
-		    BlankExtent = CurBlankExtent;
-		    prev = prev->prev;
-		} else {
-		    /*
-		     *  The anchor starts on this line, and it
-		     *  has only white or special characters, so
-		     *  declare the anchor's extent as blank. - FM
-		     */
-		    BlankExtent = a->extent;
-		    break;
-		}
-	    }
-	}
-	a->extent -= extent_adjust;
-	return i==0;
-    } else
+	   "BUG: HText_endAnchor0: internal error: last anchor was input field!\n"));
 	return 0;
-}
-#endif /* MARK_HIDDEN_LINKS */
-
-
-PUBLIC void HText_endAnchor ARGS2(
-	HText *,	text,
-	int,		number)
-{
-    TextAnchor *a;
-
-    /*
-     *  The number argument is set to 0 in HTML.c and
-     *  LYCharUtils.c when we want to end the anchor
-     *  for the immediately preceding HText_beginAnchor()
-     *  call.  If it's greater than 0, we want to handle
-     *  a particular anchor.  This allows us to set links
-     *  for positions indicated by NAME or ID attributes,
-     *  without needing to close any anchor with an HREF
-     *  within which that link might be embedded. - FM
-     */
-    if (number <= 0 || number == text->last_anchor->number) {
-	a = text->last_anchor;
-    } else {
-	for (a = text->first_anchor; a; a = a->next) {
-	    if (a->number == number) {
-		break;
-	    }
-	}
-	if (a == NULL) {
-	    /*
-	     *  There's no anchor with that number,
-	     *  so we'll default to the last anchor,
-	     *  and cross our fingers. - FM
-	     */
-	    a = text->last_anchor;
-	}
-    }
-
-    CTRACE((tfp, "GridText:HText_endAnchor: number:%d link_type:%d\n",
-			a->number, a->link_type));
-    if (a->link_type == INPUT_ANCHOR) {
-	/*
-	 *  Shouldn't happen, but put test here anyway to be safe. - LE
-	 */
-
-	CTRACE((tfp,
-	   "HText_endAnchor: internal error: last anchor was input field!\n"));
-	return;
     }
     if (a->number) {
 	/*
@@ -5379,14 +4971,25 @@ PUBLIC void HText_endAnchor ARGS2(
 	HTLine *start = last;
 	int CurBlankExtent = 0;
 	int BlankExtent = 0;
+	int extent_adjust = 0;
+
+	/* Find the length taken by the anchor */
+	l = text->Lines;		/* lineno of last */
+	while (l > a->line_num) {
+	    extent_adjust += start->size;
+	    start = start->prev;
+	    l--;
+	}
+	/* Now start is the start line of the anchor */
+	extent_adjust += start->size - a->line_pos;
+	start = last;			/* Used later */
 
 	/*
 	 *  Check if the anchor content has only
 	 *  white and special characters, starting
 	 *  with the content on the last line. - FM
 	 */
-	a->extent += (text->chars + last->size) - a->start -
-		     (text->Lines - a->line_num);
+	a->extent += extent_adjust;
 	if (a->extent > (int)last->size) {
 	    /*
 	     *  The anchor extends over more than one line,
@@ -5494,6 +5097,10 @@ PUBLIC void HText_endAnchor ARGS2(
 		}
 	    }
 	}
+	if (!really) {			/* Just report whether it is empty */
+	    a->extent -= extent_adjust;
+	    return i==0;
+	}
 	if (i == 0) {
 	    /*
 	     *  It's an invisible anchor probably from an ALT=""
@@ -5503,8 +5110,8 @@ PUBLIC void HText_endAnchor ARGS2(
 	    a->show_anchor = NO;
 
 	    CTRACE((tfp,
-		   "HText_endAnchor: hidden (line,start,pos,ext,BlankExtent):(%d,%d,%d,%d,%d)",
-		   a->line_num,a->start,a->line_pos,a->extent,
+		   "HText_endAnchor0: hidden (line,pos,ext,BlankExtent):(%d,%d,%d,%d)",
+		   a->line_num,a->line_pos,a->extent,
 		   BlankExtent));
 
 	    /*
@@ -5579,10 +5186,7 @@ PUBLIC void HText_endAnchor ARGS2(
 			k = j + NumSize;
 			while (k < (int)start->size)
 			    start->data[j++] = start->data[k++];
-			if (start != last)
-			    text->chars -= NumSize;
 			for (anc = a; anc; anc = anc->next) {
-			    anc->start -= NumSize;
 			    if (anc->line_num == a->line_num &&
 				anc->line_pos >= NumSize) {
 			    anc->line_pos -= NumSize;
@@ -5617,10 +5221,6 @@ PUBLIC void HText_endAnchor ARGS2(
 			    l = (i - j);
 			    while (i < (int)prev->size)
 				prev->data[j++] = prev->data[i++];
-			    text->chars -= l;
-			    for (anc = a; anc; anc = anc->next) {
-				anc->start -= l;
-			    }
 			    prev->size = j;
 			    prev->data[j] = '\0';
 			    while (j < i)
@@ -5635,10 +5235,7 @@ PUBLIC void HText_endAnchor ARGS2(
 			    i = k;
 			    while (k < (int)start->size)
 				start->data[j++] = start->data[k++];
-			    if (start != last)
-				text->chars -= i;
 			    for (anc = a; anc; anc = anc->next) {
-				anc->start -= i;
 				if (anc->line_num == a->line_num &&
 				    anc->line_pos >= i) {
 				    anc->line_pos -= i;
@@ -5694,10 +5291,6 @@ PUBLIC void HText_endAnchor ARGS2(
 			    k = j + NumSize;
 			    while (k < (int)prev->size)
 				prev->data[j++] = prev->data[k++];
-			    text->chars -= NumSize;
-			    for (anc = a; anc; anc = anc->next) {
-				anc->start -= NumSize;
-			    }
 			    prev->size = j;
 			    prev->data[j++] = '\0';
 			    while (j < k)
@@ -5733,8 +5326,8 @@ PUBLIC void HText_endAnchor ARGS2(
 	    a->show_anchor = YES;
 	    if (BlankExtent) {
 		CTRACE((tfp,
-		   "HText_endAnchor: blanks (line,start,pos,ext,BlankExtent):(%d,%d,%d,%d,%d)",
-		   a->line_num,a->start,a->line_pos,a->extent,
+		   "HText_endAnchor0: blanks (line,pos,ext,BlankExtent):(%d,%d,%d,%d)",
+		   a->line_num,a->line_pos,a->extent,
 		   BlankExtent));
 	    }
 	}
@@ -5764,12 +5357,14 @@ PUBLIC void HText_endAnchor ARGS2(
 	}
 	if (BlankExtent || a->extent <= 0 || a->number <= 0) {
 	    CTRACE((tfp,
-		   "->[%d](%d,%d,%d,%d,%d)\n",
+		   "->[%d](%d,%d,%d,%d)\n",
 		   a->number,
-		   a->line_num,a->start,a->line_pos,a->extent,
+		   a->line_num,a->line_pos,a->extent,
 		   BlankExtent));
 	}
     } else {
+	if (!really)			/* Just report whether it is empty */
+	    return 0;
 	/*
 	 *  It's a named anchor without an HREF, so it
 	 *  should be registered but not shown as a
@@ -5778,8 +5373,29 @@ PUBLIC void HText_endAnchor ARGS2(
 	a->show_anchor = NO;
 	a->extent = 0;
     }
+    return 0;
+}
+
+PUBLIC void HText_endAnchor ARGS2(
+	HText *,	text,
+	int,		number)
+{
+    HText_endAnchor0(text, number, 1);
 }
 
+/*
+    This returns whether the given anchor has blank content. Shamelessly copied
+    from HText_endAnchor. The values returned are meaningful only for "normal"
+    links - like ones produced by <a href=".">foo</a>, no inputs, etc. - VH
+*/
+#ifdef MARK_HIDDEN_LINKS
+PUBLIC BOOL HText_isAnchorBlank ARGS2(
+	HText *,	text,
+	int,		number)
+{
+    return HText_endAnchor0(text, number, 0);
+}
+#endif /* MARK_HIDDEN_LINKS */
 
 PUBLIC void HText_appendText ARGS2(
 	HText *,	text,
@@ -5921,7 +5537,7 @@ PUBLIC void HText_trimHightext ARGS3(
 	BOOLEAN,	final,
 	int,		stop_before)
 {
-    int cur_line, cur_char, cur_shift;
+    int cur_line, cur_shift;
     TextAnchor *anchor_ptr;
     TextAnchor *prev_a = NULL;
     HTLine *line_ptr;
@@ -5944,7 +5560,6 @@ PUBLIC void HText_trimHightext ARGS3(
      *  Get the first line.
      */
     line_ptr = text->last_line->next;
-    cur_char = line_ptr->size;
     cur_line = 0;
 
     /*
@@ -5959,10 +5574,8 @@ re_parse:
 	/*
 	 *  Find the right line.
 	 */
-	for (; anchor_ptr->start > cur_char;
-	       line_ptr = line_ptr->next,
-	       cur_char += line_ptr->size+1,
-	       cur_line++) {
+	for (; anchor_ptr->line_num > cur_line;
+	       line_ptr = line_ptr->next, cur_line++) {
 	    ; /* null body */
 	}
 
@@ -5974,7 +5587,8 @@ re_parse:
 	     */
 	    if (cur_line >= stop_before)
 		break;
-	    if (anchor_ptr->start >= text->chars - 1)
+	    if ( anchor_ptr->line_num >= text->Lines - 1
+		 && anchor_ptr->line_pos >= (int) text->last_line->prev->size )
 		break;
 	    /*
 	     *  Also skip this anchor if it looks like HText_endAnchor
@@ -5995,14 +5609,10 @@ re_parse:
 	if (anchor_ptr->hightext)
 	    continue;
 
-	if (anchor_ptr->start == cur_char) {
+	if (anchor_ptr->line_pos > (int) line_ptr->size) {
 	    anchor_ptr->line_pos = line_ptr->size;
-	} else {
-	    anchor_ptr->line_pos = anchor_ptr->start -
-				   (cur_char - line_ptr->size);
 	}
 	if (anchor_ptr->line_pos < 0) {
-	    anchor_ptr->start -= anchor_ptr->line_pos;
 	    anchor_ptr->line_pos = 0;
 	    anchor_ptr->line_num = cur_line;
 	}
@@ -6029,7 +5639,6 @@ re_parse:
 	if (anchor_ptr->extent < 0) {
 	    anchor_ptr->extent = 0;
 	}
-	anchor_ptr->start += cur_shift;
 
 	CTRACE((tfp, "anchor text: '%s'\n", line_ptr->data));
 	/*
@@ -6043,8 +5652,10 @@ re_parse:
 	    if (cur_line < text->Lines &&
 		(anchor_ptr->extent ||
 		 anchor_ptr->line_pos != (int)line_ptr->size ||
-		 (prev_a && prev_a->start > anchor_ptr->start))) {
-		anchor_ptr->start++;
+		 (prev_a && /* How could this happen? */
+		  (prev_a->line_num > anchor_ptr->line_num)))) {
+		anchor_ptr->line_num++;
+		anchor_ptr->line_pos = 0;
 		CTRACE((tfp, "found anchor at end of line\n"));
 		goto re_parse;
 	    } else {
@@ -6369,8 +5980,8 @@ PUBLIC int HTGetLinkInfo ARGS6(
 	 *  and don't count towards nlinks. - KW
 	 */
 	if ((a->show_anchor) &&
-	    (a->link_type != INPUT_ANCHOR ||
-	     a->input_field->type != F_HIDDEN_TYPE)) {
+	    !(a->link_type == INPUT_ANCHOR
+	      && a->input_field->type == F_HIDDEN_TYPE)) {
 	    if (a->line_num == prev_anchor_line) {
 		anchors_this_line++;
 	    } else {
@@ -6645,8 +6256,8 @@ PUBLIC int HTGetLinkOrFieldStart ARGS5(
 	 *  and don't count towards nlinks. - KW
 	 */
 	if ((a->show_anchor) &&
-	    (a->link_type != INPUT_ANCHOR ||
-	     a->input_field->type != F_HIDDEN_TYPE)) {
+	    !(a->link_type == INPUT_ANCHOR
+	      && a->input_field->type == F_HIDDEN_TYPE)) {
 	    if (a->line_num == prev_anchor_line) {
 		anchors_this_line++;
 	    } else {
@@ -7141,7 +6752,7 @@ PUBLIC void HText_pageDisplay ARGS2(
 	**  Multiple calls of HText_trimHightext works without problem now.
 	*/
 	if (HTMainText && HTMainText->stbl)
-	    stop_before = Stbl_getStartLine(HTMainText->stbl);
+	    stop_before = Stbl_getStartLineDeep(HTMainText->stbl);
 	HText_trimHightext(HTMainText, FALSE, stop_before);
     }
 #endif
@@ -7197,8 +6808,8 @@ PUBLIC int HText_LinksInLines ARGS3(
 	if (Anchor_ptr->line_num >= start &&
 	    Anchor_ptr->line_num < end &&
 	    Anchor_ptr->show_anchor &&
-	    (Anchor_ptr->link_type != INPUT_ANCHOR ||
-	     Anchor_ptr->input_field->type != F_HIDDEN_TYPE))
+	    !(Anchor_ptr->link_type == INPUT_ANCHOR
+	      && Anchor_ptr->input_field->type == F_HIDDEN_TYPE))
 	    ++total;
 	if (Anchor_ptr == text->last_anchor)
 	    break;
@@ -7273,22 +6884,6 @@ PUBLIC void HText_scrollBottom ARGS1(
 
 /* Bring to front and highlight it
 */
-PRIVATE int line_for_char ARGS2(
-	HText *,	text,
-	int,		char_num)
-{
-    int line_number = 0;
-    int characters = 0;
-    HTLine * line = text->last_line->next;
-    for (;;) {
-	if (line == text->last_line) return 0;	/* Invalid */
-	characters = characters + line->size + 1;
-	if (characters > char_num) return line_number;
-	line_number ++;
-	line = line->next;
-    }
-}
-
 PUBLIC BOOL HText_select ARGS1(
 	HText *,	text)
 {
@@ -7400,8 +6995,8 @@ PUBLIC BOOL HTFindPoundSelector ARGS1(
 		www_search_result = a->line_num+1;
 
 		CTRACE((tfp,
-		       "HText: Selecting anchor [%d] at character %d, line %d\n",
-				     a->number, a->start, www_search_result));
+		       "HText: Selecting anchor [%d] at line %d\n",
+				     a->number, www_search_result));
 		if (!strcmp(selector, LYToolbarName)) {
 		    --www_search_result;
 		}
@@ -7440,10 +7035,10 @@ PUBLIC BOOL HText_selectAnchor ARGS2(
     }
 
     {
-	 int l = line_for_char(text, a->start);
+	 int l = a->line_num;
 	 CTRACE((tfp,
-	    "HText: Selecting anchor [%d] at character %d, line %d\n",
-	    a->number, a->start, l));
+	    "HText: Selecting anchor [%d] at line %d\n",
+	    a->number, l));
 
 	if ( !text->stale &&
 	     (l >= text->top_of_screen) &&
@@ -8119,8 +7714,8 @@ PRIVATE int www_user_search_internals ARGS8(
     for (;;) {
 	while ((a != NULL) && a->line_num == (*count - 1)) {
 	    if (a->show_anchor &&
-		(a->link_type != INPUT_ANCHOR ||
-		 a->input_field->type != F_HIDDEN_TYPE)) {
+		!(a->link_type == INPUT_ANCHOR
+		  && a->input_field->type == F_HIDDEN_TYPE)) {
 		if (((a->hightext != NULL && case_sensitive == TRUE) &&
 		     LYno_attr_char_strstr(a->hightext, target)) ||
 		    ((a->hightext != NULL && case_sensitive == FALSE) &&
@@ -8491,7 +8086,7 @@ PUBLIC BOOLEAN HTreparse_document NOARGS
 	}
 	CTRACE((tfp, "  Content type is \"%s\"\n", format->name));
 
-	fp = fopen(HTMainAnchor->source_cache_file, "r");
+	fp = fopen(HTMainAnchor->source_cache_file, TXT_R);
 	if (!fp) {
 	    CTRACE((tfp, "  Cannot read file %s\n", HTMainAnchor->source_cache_file));
 	    LYRemoveTemp(HTMainAnchor->source_cache_file);
@@ -8873,8 +8468,6 @@ PUBLIC void HText_RemovePreviousLine ARGS1(
     previous = line->prev;
     previous->next = text->last_line;
     text->last_line->prev = previous;
-    text->chars -= ((data && *data == '\0') ?
-					  1 : strlen(line->data) + 1);
     text->Lines--;
     FREE(line);
 }
@@ -9486,7 +9079,7 @@ PUBLIC char * HText_setLastOptionValue ARGS7(
 	cp[j] = '\0';
 	if (HTCJK != NOCJK) {
 	    if (cp &&
-		(tmp = (unsigned char *)calloc(1, strlen(cp)+1))) {
+		(tmp = typecallocn(unsigned char, strlen(cp)+1)) != 0) {
 #ifdef SH_EX
 		if (tmp == NULL)
 		    outofmem(__FILE__, "HText_setLastOptionValue");
@@ -9608,27 +9201,6 @@ PUBLIC char * HText_setLastOptionValue ARGS7(
 }
 
 /*
- * Count the number of anchors on the current line so we can allow for the
- * length of numbered fields.
- */
-PRIVATE int AnchorsOnThisLine ARGS2(
-	HText *,	txt,
-	TextAnchor *,	ank)
-{
-    TextAnchor *chk = txt->first_anchor;
-    int count = 1;
-
-    while (chk != 0
-    	&& chk != txt->last_anchor
-	&& chk != ank) {
-	if (chk->line_num == ank->line_num)
-	    count++;
-	chk = chk->next;
-    }
-    return count;
-}
-
-/*
  *  Assign a form input anchor.
  *  Returns the number of characters to leave
  *  blank so that the input field can fit.
@@ -9650,7 +9222,6 @@ PUBLIC int HText_beginInput ARGS3(
     if (a == NULL || f == NULL)
 	outofmem(__FILE__, "HText_beginInput");
 
-    a->start = text->chars + text->last_line->size;
     a->inUnderline = underline;
     a->line_num = text->Lines;
     a->line_pos = text->last_line->size;
@@ -9728,11 +9299,7 @@ PUBLIC int HText_beginInput ARGS3(
     if (I->value)
 	StrAllocCopy(IValue, I->value);
     if (IValue && HTCJK != NOCJK) {
-	if ((tmp = (unsigned char *)calloc(1, (strlen(IValue) + 1)))) {
-#ifdef SH_EX
-	    if (tmp == NULL)
-		outofmem(__FILE__, "HText_beginInput");
-#endif
+	if ((tmp = typecallocn(unsigned char, strlen(IValue) + 1)) != 0) {
 	    if (kanji_code == EUC) {
 		TO_EUC((unsigned char *)IValue, tmp);
 		I->value_cs = current_char_set;
@@ -10018,7 +9585,6 @@ PUBLIC int HText_beginInput ARGS3(
 	     *  Add option list designation char.
 	     */
 	    HText_appendCharacter(text, '[');
-	a->start = text->chars + text->last_line->size;
 	a->line_num = text->Lines;
 	a->line_pos = text->last_line->size;
     }
@@ -10047,12 +9613,14 @@ PUBLIC int HText_beginInput ARGS3(
 			  (int)text->style->leftIndent -
 			  (int)text->style->rightIndent;
 
-	    /*
-	     *  If we are numbering form links, take that into
-	     *  account as well. - FM
-	     */
+	    /*  If we are numbering form links, place is taken by [nn]  */
 	    if (keypad_mode == LINKS_AND_FIELDS_ARE_NUMBERED)
-		MaximumSize -= AnchorsOnThisLine(text, a) / 10 + 3;
+		MaximumSize -= (a->number >= 10	/*Buggy if 1e6 links, sowhat?*/
+				? (a->number >= 100
+				   ? (a->number >= 1000
+				      ? (a->number >= 10000
+					 ? (a->number >= 100000
+					    ? 6 : 5) : 4) : 3) : 2) : 1) + 2;
 	    if (f->size > MaximumSize)
 		f->size = MaximumSize;
 
@@ -10858,7 +10426,7 @@ PUBLIC int HText_SubmitForm ARGS4(
 			escaped1 = HTEscapeSP(name_used, URL_XALPHAS);
 		    }
 
-		    if ((fd = fopen(val_used, "rb")) == 0) {
+		    if ((fd = fopen(val_used, BIN_R)) == 0) {
 			/* We can't open the file, what do we do? */
 			HTAlert(gettext("Can't open file for uploading"));
 			goto exit_disgracefully;
@@ -12189,7 +11757,6 @@ PRIVATE void insert_new_textarea_anchor ARGS2(
     /*  [anything "special" needed based on ->show_anchor value ?] */
     a->next	       = anchor->next;
     a->number	       = anchor->number;
-    a->start	       = anchor->start + anchor->input_field->size + 1;
     a->line_pos	       = anchor->line_pos;
     a->extent	       = anchor->extent;
     a->line_num	       = anchor->line_num + 1;
@@ -12220,9 +11787,6 @@ PRIVATE void insert_new_textarea_anchor ARGS2(
     l->prev	       = htline;
     l->offset	       = htline->offset;
     l->size	       = htline->size;
-    l->split_after     = htline->split_after;
-    l->bullet	       = htline->bullet;
-    l->expansion_line  = TRUE;
 #if defined(USE_COLOR_STYLE)
     /* dup styles[] if needed [no need in TEXTAREA (?); leave 0's] */
     l->numstyles       = htline->numstyles;
@@ -12276,13 +11840,12 @@ PRIVATE void insert_new_textarea_anchor ARGS2(
 PRIVATE void update_subsequent_anchors ARGS4(
 	int,		 n,
 	TextAnchor *,	 start_anchor,
-	HTLine *,        start_htline,
+	HTLine *,	 start_htline,
 	int,		 start_tag)
 {
     TextAnchor *anchor;
     HTLine     *htline = start_htline;
 
-    int form_chars_added = (start_anchor->input_field->size + 1) * n;
     int		line_adj = 0;
     int		tag_adj	 = 0;
     int		lx	 = 0;
@@ -12306,7 +11869,6 @@ PRIVATE void update_subsequent_anchors ARGS4(
 	    (anchor->number != 0))
 	    anchor->number += n;
 	anchor->line_num  += n;
-	anchor->start	  += form_chars_added;
 	anchor = anchor->next;
     }
 
@@ -12395,7 +11957,6 @@ finish:
     nlinks                         += n;
     HTMainText->Lines              += n;
     HTMainText->last_anchor_number += n;
-    HTMainText->chars              += (form_chars_added + tag_adj);
 
     more = HText_canScrollDown();
 
@@ -12456,7 +12017,7 @@ PUBLIC int HText_ExtEditForm ARGS1(
     char       *line;
     char       *lp;
     char       *cp;
-    int         match_tag = 0;
+    int		match_tag = 0;
     int		newlines  = 0;
     int		len, len0, len_in;
     int		wanted_fieldlen_wrap = -1; /* not yet asked; 0 means don't. */
@@ -12596,7 +12157,7 @@ PUBLIC int HText_ExtEditForm ARGS1(
 	    return 0;
 	}
 
-	fp = fopen (ed_temp, "r");
+	fp = fopen (ed_temp, TXT_R);
 	size = fread (ebuf, 1, size, fp);
 	LYCloseInput (fp);
 	ebuf[size] = '\0';	/* Terminate! - kw */
@@ -12801,7 +12362,7 @@ PUBLIC int HText_ExtEditForm ARGS1(
  */
 PUBLIC void HText_ExpandTextarea ARGS2(
 	    struct link *,  form_link,
-	    int,            newlines)
+	    int,	    newlines)
 {
     TextAnchor *anchor_ptr;
     TextAnchor *end_anchor    = NULL;
@@ -12986,7 +12547,7 @@ PUBLIC int HText_InsertFile ARGS1(
 	 */
 	LYGetFileInfo(fn, 0, 0, 0, 0, 0, &file_cs);
 
-	fp   = fopen (fn, "r");
+	fp   = fopen (fn, TXT_R);
 	if (!fp) {
 	    free(fbuf);
 	    free(fn);
@@ -13059,7 +12620,6 @@ PUBLIC int HText_InsertFile ARGS1(
     /*  [anything "special" needed based on ->show_anchor value ?] */
     a->next	       = anchor_ptr;
     a->number	       = anchor_ptr->number;
-    a->start	       = anchor_ptr->start;
     a->line_pos	       = anchor_ptr->line_pos;
     a->extent	       = anchor_ptr->extent;
     a->line_num	       = anchor_ptr->line_num;
@@ -13088,9 +12648,6 @@ PUBLIC int HText_InsertFile ARGS1(
     /*  Init all the fields in the new HTLine (but see the #if).   */
     l->offset	       = htline->offset;
     l->size	       = htline->size;
-    l->split_after     = htline->split_after;
-    l->bullet	       = htline->bullet;
-    l->expansion_line  = TRUE;
 #if defined(USE_COLOR_STYLE)
     /* dup styles[] if needed [no need in TEXTAREA (?); leave 0's] */
     l->numstyles       = htline->numstyles;
@@ -13112,11 +12669,11 @@ PUBLIC int HText_InsertFile ARGS1(
     if (prev_anchor)
 	prev_anchor->next = a;
 
-    htline             = htline->prev;
-    l->next	       = htline->next;
-    l->prev	       = htline;
-    htline->next->prev = l;
-    htline->next       = l;
+    htline		= htline->prev;
+    l->next		= htline->next;
+    l->prev		= htline;
+    htline->next->prev	= l;
+    htline->next	= l;
 
     /*
      *  update_subsequent_anchors() expects htline to point to 1st potential
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index ff75c6e0..3afa76db 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -570,7 +570,7 @@ PRIVATE char *mailcap_substitute ARGS3(
 	    }
 	}
 	if (pass == 0) {
-	    if ((result = malloc(need)) == 0)
+	    if ((result = malloc(need + 1)) == 0)
 		outofmem(__FILE__, "mailcap_substitute");
 	    *result = 0;
 	}
@@ -667,7 +667,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3(
 	 *  not being able to find the fp.  The ".bin" suffix is expected
 	 *  to not be used, it's only for fallback in unusual error cases. - kw
 	 */
-	me->fp = LYOpenTempRewrite(fnam, ".bin", "wb");
+	me->fp = LYOpenTempRewrite(fnam, ".bin", BIN_W);
     } else {
 #if defined(WIN_EX) && !defined(__CYGWIN__)	/* 1998/01/04 (Sun) */
 	if (!strncmp(anchor->address,"file://localhost",16)) {
@@ -730,7 +730,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3(
 	{
 	    suffix = HTML_SUFFIX;
 	}
-	me->fp = LYOpenTemp(fnam, suffix, "wb");
+	me->fp = LYOpenTemp(fnam, suffix, BIN_W);
     }
 
     if (!me->fp) {
@@ -862,7 +862,7 @@ PUBLIC HTStream* HTSaveToFile ARGS3(
 	 *  not being able to find the fp.  The ".bin" suffix is expected
 	 *  to not be used, it's only for fallback in unusual error cases. - kw
 	 */
-	ret_obj->fp = LYOpenTempRewrite(fnam, ".bin", "wb");
+	ret_obj->fp = LYOpenTempRewrite(fnam, ".bin", BIN_W);
     } else {
 	/*
 	 *  Check for a suffix.
@@ -880,7 +880,7 @@ PUBLIC HTStream* HTSaveToFile ARGS3(
 		    || *suffix != '.') {
 	    suffix = HTML_SUFFIX;
 	}
-	ret_obj->fp = LYOpenTemp(fnam, suffix, "wb");
+	ret_obj->fp = LYOpenTemp(fnam, suffix, BIN_W);
     }
 
     if (!ret_obj->fp) {
@@ -1173,7 +1173,7 @@ PUBLIC HTStream* HTCompressed ARGS3(
     /*
      *	Open the file for receiving the compressed input stream. - FM
      */
-    me->fp = LYOpenTemp (fnam, temp, "wb");
+    me->fp = LYOpenTemp (fnam, temp, BIN_W);
     if (!me->fp) {
 	HTAlert(CANNOT_OPEN_TEMP);
 	FREE(uncompress_mask);
diff --git a/src/HTML.c b/src/HTML.c
index 8973cab0..4175b026 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -8178,7 +8178,7 @@ PUBLIC HTStructured* HTML_new ARGS3(
 	exit_immediately (EXIT_FAILURE);
     }
 
-    me = (HTStructured*) calloc(sizeof(*me),1);
+    me = typecalloc(HTStructured);
     if (me == NULL)
 	outofmem(__FILE__, "HTML_new");
 
@@ -8631,7 +8631,7 @@ PRIVATE HTStream* CacheThru_new ARGS2(
 	 * don't get munged; this way, the file should (knock on wood)
 	 * contain exactly what came in from the network.
 	 */
-	if (!(stream->fp = LYOpenTemp(filename, HTML_SUFFIX, "wb"))) {
+	if (!(stream->fp = LYOpenTemp(filename, HTML_SUFFIX, BIN_W))) {
 	    CTRACE((tfp, "SourceCacheWriter: Cannot open source cache file for URL %s\n",
 		   HTAnchor_address((HTAnchor *)anchor)));
 	    FREE(stream);
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index db2e0271..cfe8c837 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -328,7 +328,7 @@ PUBLIC void save_bookmark_link ARGS2(
     }
     CTRACE((tfp, "\nsave_bookmark_link: SEEKING %s\n   AS %s\n\n",
 		BookmarkPage, filename_buffer));
-    if ((fp = fopen(filename_buffer, (first_time ? "w" : "a+"))) == NULL) {
+    if ((fp = fopen(filename_buffer, (first_time ? TXT_W : TXT_A))) == NULL) {
 	LYMBM_statusline(BOOKMARK_OPEN_FAILED);
 	LYSleepAlert();
 	FREE(Title);
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 6bb34184..3a15f269 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -111,8 +111,8 @@ PUBLIC void LYEntify ARGS2(
     /*
      *	Allocate space and convert. - FM
      */
-    q = (char *)calloc(1,
-		     (strlen(*str) + (4 * amps) + (3 * lts) + (3 * gts) + 1));
+    q = typecallocn(char,
+		    (strlen(*str) + (4 * amps) + (3 * lts) + (3 * gts) + 1));
     if ((cp = q) == NULL)
 	outofmem(__FILE__, "LYEntify");
     for (p = *str; *p; p++) {
@@ -3623,11 +3623,10 @@ PUBLIC int LYLegitimizeHREF ARGS4(
 		   : me->node_anchor->address[4]) == 's') {
 		    str = "s";
 		}
-		if (TRACE) {
-		    CTRACE((tfp, "LYLegitimizeHREF: Bad value '%s' for http%s URL.\n",
-				 *href, str);)
-		    CTRACE((tfp, "                  Stripping lead dots.\n"));
-		} else if (!me->inBadHREF) {
+		CTRACE((tfp, "LYLegitimizeHREF: Bad value '%s' for http%s URL.\n",
+			*href, str));
+		CTRACE((tfp, "                  Stripping lead dots.\n"));
+		if (!me->inBadHREF) {
 		    HTUserMsg(BAD_PARTIAL_REFERENCE);
 		    me->inBadHREF = TRUE;
 		}
diff --git a/src/LYCookie.c b/src/LYCookie.c
index ec9ab39d..df847365 100644
--- a/src/LYCookie.c
+++ b/src/LYCookie.c
@@ -132,7 +132,7 @@ PRIVATE void MemAllocCopy ARGS3(
 	return;
     }
 
-    temp = (char *)calloc(1, ((end - start) + 1));
+    temp = typecallocn(char, (end - start) + 1);
     if (temp == NULL)
 	outofmem(__FILE__, "MemAllocCopy");
     LYstrncpy(temp, start, (end - start));
@@ -1031,7 +1031,7 @@ PRIVATE void LYProcessSetCookies ARGS6(
 		if (value_len > max_cookies_buffer) {
 		    value_len = max_cookies_buffer;
 		}
-		value = (char *)calloc(1, value_len + 1);
+		value = typecallocn(char, value_len + 1);
 		if (value == NULL)
 		    outofmem(__FILE__, "LYProcessSetCookies");
 		LYstrncpy(value, value_start, value_len);
@@ -1551,7 +1551,7 @@ PRIVATE void LYProcessSetCookies ARGS6(
 		if (value_len > max_cookies_buffer) {
 		    value_len = max_cookies_buffer;
 		}
-		value = (char *)calloc(1, value_len + 1);
+		value = typecallocn(char, value_len + 1);
 		if (value == NULL)
 		    outofmem(__FILE__, "LYProcessSetCookies");
 		LYstrncpy(value, value_start, value_len);
diff --git a/src/LYCurses.c b/src/LYCurses.c
index fe9642b6..49d48567 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -769,7 +769,6 @@ static WINDOW *LYscreen = NULL;
 
 PUBLIC void start_curses NOARGS
 {
-    int keypad_on = 0;
 #ifdef USE_SLANG
     static int slinit;
 
@@ -882,10 +881,10 @@ PUBLIC void start_curses NOARGS
     signal(SIGINT, cleanup_sig);
 #endif /* !VMS */
 
-   lynx_enable_mouse (1);
+    lynx_enable_mouse (1);
 
 #else /* USE_SLANG; Now using curses: */
-
+    int keypad_on = 0;
 
 #ifdef VMS
     /*
@@ -1152,6 +1151,56 @@ PUBLIC void lynx_enable_mouse ARGS1(int,state)
 #endif /* USE_MOUSE */
 }
 
+/*
+ * SVr4 curses (and ncurses) initialize the terminal I/O to raw mode, and
+ * simulate other modes in the library.  This means that when running, it
+ * simulates the OCRNL setting.  Normally that is not a problem.  However, when
+ * spawning a subprocess (e.g., xli), the subprocess may write to the screen. 
+ * Fine so far - curses resets the terminal I/O to the normal state on exit. 
+ * But the subprocess's messages can still be coming to the screen when lynx
+ * returns to the screen mode.  This function delays restoring OCRNL until
+ * after the first getch() call.
+ *
+ * The OCRNL setting is controlled by nl()/nonl() of course - but we do not
+ * want to give up that optimization since it would be a bit slower.  (Note -
+ * slang does not use this optimization; if it did, the same screen glitch
+ * would occur).
+ *
+ * FIXME:  for simplicity, only ncurses is implemented here - the TTY and
+ * SET_TTY definitions are ncurses-specific.  The same effect could be done for
+ * other curses implementations, since the "cur_term->Nttyb" part is common to
+ * SVr4 curses.
+ */
+PUBLIC void lynx_nl2crlf ARGS1(int, normal GCC_UNUSED)
+{
+    
+#if defined(NCURSES_VERSION) && defined(SET_TTY) && defined(TERMIOS) && defined(ONLCR)
+    static TTY saved_tty;
+    static int did_save = FALSE;
+    static int waiting = FALSE;
+
+    if (!did_save) {
+	saved_tty = cur_term->Nttyb;
+	did_save = TRUE;
+    }
+    if (normal) {
+	if (!waiting) {
+	    cur_term->Nttyb.c_oflag |= ONLCR;
+	    waiting = TRUE;
+	    nonl();
+	}
+    } else {
+	if (waiting) {
+	    cur_term->Nttyb = saved_tty;
+	    SET_TTY(fileno(stdout), &saved_tty);
+	    waiting = FALSE;
+	    nl();
+	    LYrefresh();
+	}
+    }
+#endif
+}
+
 PUBLIC void stop_curses NOARGS
 {
     if (LYCursesON)
@@ -1172,6 +1221,7 @@ PUBLIC void stop_curses NOARGS
      *	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
      */
     if(LYCursesON == TRUE)	{
+	lynx_nl2crlf(TRUE);
 	lynx_enable_mouse (0);
 #if (!defined(WIN_EX) || defined(__CYGWIN__))	/* @@@ */
 	if(LYscreen) {
@@ -1293,10 +1343,10 @@ PUBLIC BOOLEAN setup ARGS1(
     char *buffer = NULL;
     char *cp;
 
-   /*
-    *  If the display was not set by a command line option then
-    *  see if it is available from the environment .
-    */
+    /*
+     *  If the display was not set by a command line option then
+     *  see if it is available from the environment .
+     */
     if ((cp = LYgetXDisplay()) != NULL) {
 	StrAllocCopy(x_display, cp);
     } else {
@@ -1350,7 +1400,7 @@ PUBLIC BOOLEAN setup ARGS1(
      *  the current link is indistinguishable from all other links.
      *  The workaround here is to disable the 'rev' capability.
      */
-    if ((strncmp(ttytype, "sun", 3) == 0)) {
+    if ((strncmp((CONST char *)ttytype, "sun", 3) == 0)) {
 	LYnoVideo(2);
     }
 #endif /* HAVE_TTYTYPE */
@@ -2090,6 +2140,19 @@ PUBLIC void LYrefresh NOARGS
 {
 #ifdef USE_CURSES_PADS
     if (LYwin != stdscr) {
+	/*
+	 * Workaround for special case where lynx is prompting for a mailto,
+	 * and has a subject line that is wider than the screen.  The 
+	 * wnoutrefresh() call resets newscr's position to match stdscr's,
+	 * which happens to be the window's origin because we were not updating
+	 * that, and other stray wmove's in lynx fail because the coordinate
+	 * is on/after the right margin.  Force things to look ok here.
+	 */
+	int y, x;
+	getyx(LYwin, y, x);
+	if (x >= LYcols) x = LYcols-1;
+	wmove(stdscr, y, x);
+
 	wnoutrefresh(stdscr);
 	pnoutrefresh(LYwin, 0, LYshiftWin, 0, 0, LYlines, LYscreenWidth()-1);
 	doupdate();
@@ -2199,16 +2262,16 @@ PUBLIC void lynx_stop_link_color ARGS2(
 
 PUBLIC void lynx_stop_target_color NOARGS
 {
-   stop_underline();
-   stop_reverse();
-   stop_bold();
+    stop_underline();
+    stop_reverse();
+    stop_bold();
 }
 
 PUBLIC void lynx_start_target_color NOARGS
 {
-   start_bold();
-   start_reverse();
-   start_underline();
+    start_bold();
+    start_reverse();
+    start_underline();
 }
 
 
@@ -2234,41 +2297,41 @@ PUBLIC void lynx_stop_status_color NOARGS
 
 PUBLIC void lynx_start_h1_color NOARGS
 {
-   if (bold_H1 || bold_headers)
-     start_bold();
+    if (bold_H1 || bold_headers)
+	start_bold();
 }
 
 PUBLIC void lynx_stop_h1_color NOARGS
 {
-   if (bold_H1 || bold_headers)
-     stop_bold();
+    if (bold_H1 || bold_headers)
+	stop_bold();
 }
 
 PUBLIC void lynx_start_prompt_color NOARGS
 {
-   start_reverse ();
+    start_reverse ();
 }
 
 PUBLIC void lynx_stop_prompt_color NOARGS
 {
-   stop_reverse ();
+    stop_reverse ();
 }
 
 PUBLIC void lynx_start_radio_color NOARGS
 {
-   start_bold ();
+    start_bold ();
 }
 
 PUBLIC void lynx_stop_radio_color NOARGS
 {
-   stop_bold ();
+    stop_bold ();
 }
 
 PUBLIC void lynx_stop_all_colors NOARGS
 {
-   stop_underline ();
-   stop_reverse ();
-   stop_bold ();
+    stop_underline ();
+    stop_reverse ();
+    stop_bold ();
 }
 
 /*
diff --git a/src/LYCurses.h b/src/LYCurses.h
index c872758e..f4be459f 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -66,6 +66,14 @@ typedef struct {
 #define ACS_DARROW  SLSMG_DARROW_CHAR
 #endif
 
+#ifndef ACS_LARROW
+#define ACS_LARROW  SLSMG_LARROW_CHAR
+#endif
+
+#ifndef ACS_RARROW
+#define ACS_RARROW  SLSMG_RARROW_CHAR
+#endif
+
 #ifndef ACS_CKBOARD
 #define ACS_CKBOARD SLSMG_CKBRD_CHAR
 #endif
@@ -542,6 +550,7 @@ FANCY_CURSES.  Check your config.log to see why the FANCY_CURSES test failed.
 
 extern void lynx_enable_mouse PARAMS((int));
 extern void lynx_force_repaint NOPARAMS;
+extern void lynx_nl2crlf PARAMS((int normal));
 extern void lynx_start_title_color NOPARAMS;
 extern void lynx_stop_title_color NOPARAMS;
 extern void lynx_start_link_color PARAMS((int flag, int pending));
diff --git a/src/LYDownload.c b/src/LYDownload.c
index 839af32b..03a9ea5f 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -34,7 +34,7 @@ PUBLIC void LYDownload ARGS1(
     char buffer[LY_MAXPATH];
     char command[LY_MAXPATH];
     char *cp;
-    lynx_html_item_type *download_command = 0;
+    lynx_list_item_type *download_command = 0;
     int ch, recall;
     int FnameTotal;
     int FnameNum;
@@ -62,7 +62,7 @@ PUBLIC void LYDownload ARGS1(
     /*
      *	Parse out the File, sug_file, and the Method.
      */
-    if ((file = (char *)strstr(Line, "/File=")) == NULL)
+    if ((file = strstr(Line, "/File=")) == NULL)
 	goto failed;
     *file = '\0';
     /*
@@ -70,7 +70,7 @@ PUBLIC void LYDownload ARGS1(
      */
     file += 6;
 
-    if ((sug_file = (char *)strstr(file + 1, "/SugFile=")) != NULL) {
+    if ((sug_file = strstr(file + 1, "/SugFile=")) != NULL) {
 	*sug_file = '\0';
 	/*
 	 *  Go past "SugFile=".
@@ -110,7 +110,7 @@ PUBLIC void LYDownload ARGS1(
 #endif /* _WINDOWS */
 #endif /* DIRED_SUPPORT */
 
-    if ((method = (char *)strstr(Line, "Method=")) == NULL)
+    if ((method = strstr(Line, "Method=")) == NULL)
 	goto failed;
     /*
      *	Go past "Method=".
@@ -485,7 +485,7 @@ PUBLIC int LYdownload_options ARGS2(
     char *downloaded_url = NULL;
     char *sug_filename = NULL;
     FILE *fp0;
-    lynx_html_item_type *cur_download;
+    lynx_list_item_type *cur_download;
     int count;
 
     /*
@@ -495,10 +495,10 @@ PUBLIC int LYdownload_options ARGS2(
     change_sug_filename(sug_filename);
 
     if (LYReuseTempfiles) {
-	fp0 = LYOpenTempRewrite(tempfile, HTML_SUFFIX, "wb");
+	fp0 = LYOpenTempRewrite(tempfile, HTML_SUFFIX, BIN_W);
     } else {
 	LYRemoveTemp(tempfile);
-	fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "wb");
+	fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, BIN_W);
     }
     if (fp0 == NULL) {
 	HTAlert(CANNOT_OPEN_TEMP);
diff --git a/src/LYEdit.c b/src/LYEdit.c
index 37b182db..453cab0b 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -129,7 +129,7 @@ PUBLIC int edit_current_file ARGS3(
     /*
      *  Don't allow editing if user lacks append access.
      */
-    if ((fp = fopen(filename, "a")) == NULL)
+    if ((fp = fopen(filename, TXT_A)) == NULL)
     {
 	HTUserMsg(NOAUTH_TO_EDIT_FILE);
 	goto done;
diff --git a/src/LYExtern.c b/src/LYExtern.c
index 8cecb422..4f341bb7 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -24,9 +24,9 @@
 #include <LYExtern.h>
 #include <LYLeaks.h>
 #include <LYCurses.h>
+#include <LYReadCFG.h>
 #include <LYStrings.h>
 
-
 #ifdef WIN_EX
 /* 1997/10/15 (Wed) 17:39:50 */
 
@@ -126,254 +126,297 @@ PUBLIC char * quote_pathname ARGS1(
 }
 #endif /* WIN_EX */
 
-#if 0	/* old version */
-void run_external_ ARGS1(char *, cmd)
+
+PRIVATE void format ARGS3(
+    char **,	result,
+    char *,	fmt,
+    char *,	parm)
 {
-    char *the_command = 0;
-    lynx_html_item_type *ext = 0;
+    *result = NULL;
+    HTAddParam(result, fmt, 1, parm);
+    HTEndParam(result, fmt, 1);
+}
 
-    for (ext = externals; ext != NULL; ext = ext->next) {
+/*
+ * Format the given command into a buffer, returning the resulting string.
+ *
+ * It is too dangerous to leave any URL that may come along unquoted.  They
+ * often contain '&', ';', and '?' chars, and who knows what else may occur. 
+ * Prevent spoofing of the shell.  Dunno how this needs to be modified for VMS
+ * or DOS.  - kw
+ */
+PRIVATE char *format_command ARGS2(
+    char *,	command,
+    char *,	param)
+{
+#ifdef WIN_EX
+    char pram_string[PATH_MAX];
+#endif
+    char *cmdbuf = NULL;
 
-	if (ext->command != 0
-	&& !strncasecomp(ext->name, cmd, strlen(ext->name))) {
+#if (defined(VMS) || defined(DOSPATH) || defined(__EMX__)) && !defined(WIN_EX)
+    format(&cmdbuf, command, param);
+#else	/* Unix or DOS/Win: */
+#if defined(WIN_EX)
+    if (*param != '\"' && strchr(param, ' ') != NULL) {
+	char *cp = quote_pathname(param);
+	format(&cmdbuf, command, cp);
+	FREE(cp);
+    } else {
+	LYstrncpy(pram_string, param, sizeof(pram_string)-1);
+	decode_string(pram_string);
+	param = pram_string;
+
+	if (strnicmp("mailto:", param, 7) == 0) {
+	    format(&cmdbuf, command, param + 7);
+	} else if (strnicmp("telnet://", param, 9) == 0) {
+	    char host[sizeof(pram_string)];
+	    int last_pos;
+
+	    strcpy(host, param + 9);
+	    last_pos = strlen(host) - 1;
+	    if (last_pos > 1 && host[last_pos] == '/')
+		host[last_pos] = '\0';
+
+	    format(&cmdbuf, command, host);
+	} else if (strnicmp("file://localhost/", param, 17) == 0) {
+	    char e_buff[PATH_MAX], *p;
+
+	    p = param + 17;
+	    *e_buff = 0;
+	    if (strchr(p, ':') == NULL) {
+		sprintf(e_buff, "%.3s/", windows_drive);
+	    }
+	    strncat(e_buff, p, sizeof(e_buff) - strlen(e_buff) - 1);
+	    p = strrchr(e_buff, '.');
+	    if (p) {
+		p = strchr(p, '#');
+		if (p) {
+		    *p = '\0';
+		}
+	    }
+	    if (*e_buff != '\"' && strchr(e_buff, ' ') != NULL) {
+		p = quote_pathname(e_buff);
+		LYstrncpy(e_buff, p, sizeof(e_buff)-1);
+		FREE(p);
+	    }
 
-	    if (no_externals && !ext->always_enabled) {
-		HTUserMsg(EXTERNALS_DISABLED);
+	    /* Less ==> short filename,
+	     * less ==> long filename
+	     */
+	    if (isupper(command[0])) {
+		format(&cmdbuf,
+			command, HTDOS_short_name(e_buff));
 	    } else {
-
-		HTAddParam(&the_command, ext->command, 1, cmd);
-		HTEndParam(&the_command, ext->command, 1);
-
-		HTUserMsg(the_command);
-
-		stop_curses();
-		LYSystem(the_command);
-		FREE(the_command);
-		start_curses();
+		format(&cmdbuf, command, e_buff);
 	    }
-
-	    break;
+	} else {
+	    format(&cmdbuf, command, param);
 	}
     }
-
-    return;
-}
+#else	/* Unix */
+    {
+	format(&cmdbuf, command, param);
+    }
 #endif
+#endif	/* VMS */
+    return cmdbuf;
+}
 
-PRIVATE void format ARGS3(
-    char **,	result,
-    char *,	fmt,
-    char *,	parm)
+/*
+ * Find the EXTERNAL command which matches the given name 'param'.  If there is
+ * more than one possibility, make a popup menu of the matching commands and
+ * allow the user to select one.  Return the selected command.
+ */
+PRIVATE char *lookup_external ARGS2(
+    char *, 	param,
+    BOOL,	only_overriders)
 {
-    *result = NULL;
-    HTAddParam(result, fmt, 1, parm);
-    HTEndParam(result, fmt, 1);
+    int pass, num_disabled, num_matched, num_choices, cur_choice;
+    int length = 0;
+    char *cmdbuf = NULL;
+    char **choices = 0;
+    lynx_list_item_type *ptr = 0;
+
+    for (pass = 0; pass < 2; pass++) {
+	num_disabled = 0;
+	num_matched = 0;
+	num_choices = 0;
+	for (ptr = externals; ptr != 0; ptr = ptr->next) {
+
+	    if (match_item_by_name(ptr, param, only_overriders)) {
+		++num_matched;
+		CTRACE((tfp, "EXTERNAL: '%s' <==> '%s'\n", ptr->name, param));
+		if (no_externals && !ptr->always_enabled && !only_overriders) {
+		    ++num_disabled;
+		} else {
+		    if (pass == 0) {
+			length++;
+		    } else if (pass != 0) {
+			cmdbuf = format_command(ptr->command, param);
+			if (length > 1)
+			    choices[num_choices] = cmdbuf;
+		    }
+		    num_choices++;
+		}
+	    }
+	}
+	if (length > 1) {
+	    if (pass == 0) {
+		choices = typecallocn(char *, length + 1);
+	    } else {
+		choices[num_choices] = 0;
+	    }
+	}
+    }
+
+    if (num_disabled != 0
+     && num_disabled == num_matched) {
+	HTUserMsg(EXTERNALS_DISABLED);
+    } else if (num_choices > 1) {
+	int old_y, old_x;
+#ifdef USE_SLANG
+	old_y = SLsmg_get_row();
+	old_x = SLsmg_get_column();
+#else
+	getyx(LYwin, old_y, old_x);
+#endif
+	cur_choice = LYhandlePopupList(
+			-1,
+			0,
+			old_x,
+			(CONST char **)choices,
+			-1,
+			-1,
+			FALSE,
+			TRUE,
+			FALSE);
+#ifdef USE_SLANG
+	SLsmg_gotorc(old_y, old_x);
+#else
+	wmove(LYwin, old_y, old_x);
+#endif
+	CTRACE((tfp, "selected choice %d of %d\n", cur_choice, num_choices));
+	if (cur_choice < 0) {
+	    HTInfoMsg(CANCELLED);
+	    cmdbuf = 0;
+	}
+	for (pass = 0; choices[pass] != 0; pass++) {
+	    if (pass == cur_choice) {
+		cmdbuf = choices[pass];
+	    } else {
+		FREE(choices[pass]);
+	    }
+	}
+	FREE(choices);
+    }
+    return cmdbuf;
 }
 
 BOOL run_external ARGS2(
-    char *, 	c,
+    char *, 	param,
     BOOL,	only_overriders)
 {
 #ifdef WIN_EX
-    HANDLE handle;
     int status;
-    int confirmed;
-    char pram_string[PATH_MAX];
-    int redraw_flag;
     extern int xsystem(char *cmd);
 #endif
+    int redraw_flag = TRUE;
     char *cmdbuf = NULL;
-    lynx_html_item_type *externals2 = 0;
     int found = 0;
+    int confirmed = TRUE;
 
     if (externals == NULL)
 	return 0;
 
 #ifdef WIN_EX			/* 1998/01/26 (Mon) 09:16:13 */
-    if (c == NULL) {
+    if (param == NULL) {
 	HTInfoMsg("External command is null");
 	return 0;
     }
 #endif
 
-    for (externals2 = externals; externals2 != NULL;
-	 externals2 = externals2->next) {
-
-#ifdef WIN_EX
-	handle = GetForegroundWindow();
-	CTRACE((tfp, "EXTERNAL: '%s' <==> '%s'\n", externals2->name, c));
-#endif
-	if (externals2->command != 0
-	  && !strncasecomp(externals2->name, c, strlen(externals2->name))
-	  && (only_overriders ? externals2->override_primary_action : 1))
-	{
-	    if (no_externals && !externals2->always_enabled && !only_overriders) {
-		HTUserMsg(EXTERNALS_DISABLED);
-		break;
-	    }
-	    ++found;
-	    /*  Too dangerous to leave any URL that may come along unquoted.
-	     *  They often contain '&', ';', and '?' chars, and who knows
-	     *  what else may occur.
-	     *  Prevent spoofing of the shell.
-	     *  Dunno how this needs to be modified for VMS or DOS. - kw
-	     */
-#if (defined(VMS) || defined(DOSPATH) || defined(__EMX__)) && !defined(WIN_EX)
-	    format(&cmdbuf, externals2->command, c);
-#else	/* Unix or DOS/Win: */
-#if defined(WIN_EX)
-	    if (*c != '\"' && strchr(c, ' ') != NULL) {
-		char *cp = quote_pathname(c);
-		format(&cmdbuf, externals2->command, cp);
-		FREE(cp);
-	    } else {
-		LYstrncpy(pram_string, c, sizeof(pram_string)-1);
-		decode_string(pram_string);
-		c = pram_string;
-
-		if (strnicmp("mailto:", c, 7) == 0) {
-		    format(&cmdbuf, externals2->command, c + 7);
-		} else if (strnicmp("telnet://", c, 9) == 0) {
-		    char host[sizeof(pram_string)];
-		    int last_pos;
-
-		    strcpy(host, c + 9);
-		    last_pos = strlen(host) - 1;
-		    if (last_pos > 1 && host[last_pos] == '/')
-			host[last_pos] = '\0';
-
-		    format(&cmdbuf, externals2->command, host);
-		} else if (strnicmp("file://localhost/", c, 17) == 0) {
-		    char e_buff[PATH_MAX], *p;
-
-		    p = c + 17;
-		    *e_buff = 0;
-		    if (strchr(p, ':') == NULL) {
-			sprintf(e_buff, "%.3s/", windows_drive);
-		    }
-		    strncat(e_buff, p, sizeof(e_buff) - strlen(e_buff) - 1);
-		    p = strrchr(e_buff, '.');
-		    if (p) {
-			p = strchr(p, '#');
-			if (p) {
-			    *p = '\0';
-			}
-		    }
-		    if (*e_buff != '\"' && strchr(e_buff, ' ') != NULL) {
-			p = quote_pathname(e_buff);
-			LYstrncpy(e_buff, p, sizeof(e_buff)-1);
-			FREE(p);
-		    }
-
-		    /* Less ==> short filename,
-		     * less ==> long filename
-		     */
-		    if (isupper(externals2->command[0])) {
-			format(&cmdbuf,
-				externals2->command, HTDOS_short_name(e_buff));
-		    } else {
-			format(&cmdbuf, externals2->command, e_buff);
-		    }
-		} else {
-		    format(&cmdbuf, externals2->command, c);
-		}
-	    }
-#else	/* Unix */
-	    {
-		format(&cmdbuf, externals2->command, c);
-	    }
-#endif
-#endif	/* VMS */
-
-	    if (cmdbuf != 0 && *cmdbuf != '\0') {
+    cmdbuf = lookup_external(param, only_overriders);
+    if (cmdbuf != 0 && *cmdbuf != '\0') {
 #ifdef WIN_EX			/* 1997/10/17 (Fri) 14:07:50 */
-		int len;
-		char buff[PATH_MAX];
+	int len;
+	char buff[PATH_MAX];
 
-		CTRACE((tfp, "Lynx EXTERNAL: '%s'\n", cmdbuf));
+	CTRACE((tfp, "Lynx EXTERNAL: '%s'\n", cmdbuf));
 #ifdef WIN_GUI			/* 1997/11/06 (Thu) 14:17:15 */
-		confirmed = MessageBox(handle, cmdbuf,
-				  "Lynx (EXTERNAL COMMAND EXEC)",
-		       MB_ICONQUESTION | MB_SETFOREGROUND | MB_OKCANCEL)
-			    == IDCANCEL;
+	confirmed = MessageBox(GetForegroundWindow(), cmdbuf,
+			       "Lynx (EXTERNAL COMMAND EXEC)",
+			       MB_ICONQUESTION | MB_SETFOREGROUND | MB_OKCANCEL)
+		    != IDCANCEL;
 #else
-		confirmed = HTConfirm(string_short(cmdbuf, 40)) == NO;
+	confirmed = HTConfirm(string_short(cmdbuf, 40)) != NO;
 #endif
-		if (confirmed)
-		    break;
-
-		len = strlen(cmdbuf);
-		if (len > 255) {
-		    sprintf(buff, "Lynx: command line too long (%d > 255)", len);
+	if (confirmed) {
+	    len = strlen(cmdbuf);
+	    if (len > 255) {
+		sprintf(buff, "Lynx: command line too long (%d > 255)", len);
 #ifdef WIN_GUI			/* 1997/11/06 (Thu) 14:17:02 */
-		    MessageBox(handle, buff,
-			       "Lynx (EXTERNAL COMMAND EXEC)",
-			  MB_ICONEXCLAMATION | MB_SETFOREGROUND | MB_OK);
-		    SetConsoleTitle("Lynx for Win32");
+		MessageBox(GetForegroundWindow(), buff,
+			   "Lynx (EXTERNAL COMMAND EXEC)",
+			   MB_ICONEXCLAMATION | MB_SETFOREGROUND | MB_OK);
+		SetConsoleTitle("Lynx for Win32");
 #else
-		    HTConfirm(string_short(buff, 40));
+		HTConfirm(string_short(buff, 40));
 #endif
-		    break;
-		} else {
-		    SetConsoleTitle(cmdbuf);
-		}
-
-		if (strnicmp(cmdbuf, "start ", 6) == 0)
-		    redraw_flag = FALSE;
-		else
-		    redraw_flag = TRUE;
+		confirmed = FALSE;
+	    } else {
+		SetConsoleTitle(cmdbuf);
+	    }
+	}
 
-		if (redraw_flag) {
-		    stop_curses();
-		    fflush(stdout);
-		}
+	if (strnicmp(cmdbuf, "start ", 6) == 0)
+	    redraw_flag = FALSE;
+	else
+	    redraw_flag = TRUE;
 #else
-		HTUserMsg(cmdbuf);
-		stop_curses();
+	HTUserMsg(cmdbuf);
 #endif
+	found = TRUE;
+	if (confirmed) {
+	    if (redraw_flag) {
+		stop_curses();
+		fflush(stdout);
+	    }
 
-		/* command running. */
+	    /* command running. */
 #ifdef WIN_EX			/* 1997/10/17 (Fri) 14:07:50 */
 #ifdef __CYGWIN__
-		status = system(cmdbuf);
+	    status = system(cmdbuf);
 #else
-		status = xsystem(cmdbuf);
+	    status = xsystem(cmdbuf);
 #endif
-		if (status != 0) {
-		    sprintf(buff,
-			    "EXEC code = %04x (%2d, %2d)\r\n"
-			    "'%s'",
-			    status, (status / 256), (status & 0xff),
-			    cmdbuf);
+	    if (status != 0) {
+		sprintf(buff,
+			"EXEC code = %04x (%2d, %2d)\r\n"
+			"'%s'",
+			status, (status / 256), (status & 0xff),
+			cmdbuf);
 #ifdef SH_EX	/* WIN_GUI for ERROR only */
-		    MessageBox(handle, buff,
-			       "Lynx (EXTERNAL COMMAND EXEC)",
-			       MB_ICONSTOP | MB_SETFOREGROUND | MB_OK);
+		MessageBox(GetForegroundWindow(), buff,
+			   "Lynx (EXTERNAL COMMAND EXEC)",
+			   MB_ICONSTOP | MB_SETFOREGROUND | MB_OK);
 #else
-		    HTConfirm(string_short(buff, 40));
-#endif		/* 1 */
-		}
+		HTConfirm(string_short(buff, 40));
+#endif /* 1 */
+	    }
 #else	/* Not WIN_EX */
-		LYSystem(cmdbuf);
+	    LYSystem(cmdbuf);
 #endif	/* WIN_EX */
 
 #if defined(WIN_EX)
-		SetConsoleTitle("Lynx for Win32");
+	    SetConsoleTitle("Lynx for Win32");
 #endif
-
-#ifdef WIN_EX
-		if (redraw_flag) {
-		    fflush(stdout);
-		    start_curses();
-		}
-#else
+	    if (redraw_flag) {
 		fflush(stdout);
 		start_curses();
-#endif
 	    }
-	    break;
-	} /* end if */
-    } /* end-for */
+	}
+    }
 
     FREE(cmdbuf);
     return found;
diff --git a/src/LYForms.c b/src/LYForms.c
index cc5ccf1e..cdf84fc6 100644
--- a/src/LYForms.c
+++ b/src/LYForms.c
@@ -232,9 +232,9 @@ PUBLIC int change_form_link_ex ARGS8(
 	    if (form->disabled == YES &&
 		(c == '\r' || c == '\n' || immediate_submit)) {
 		if (peek_mouse_link() >= 0)
-		    c = lookup_keymap(LYK_ACTIVATE);
+		    c = LAC_TO_LKC0(LYK_ACTIVATE);
 		else
-		c = '\t';
+		    c = '\t';
 		break;
 	    }
 	    /*
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 3f754c7c..c7cdd705 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -15,7 +15,7 @@
    be removed (at least):
    CURRENT_KEYMAP_HELP
 */
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H) && defined(HAVE_LYHELP_H)
 #include <LYHelp.h>
 #else
 #define ALT_EDIT_HELP		"keystrokes/alt_edit_help.html"
@@ -446,10 +446,10 @@ extern BOOLEAN with_backspaces;
 #endif
 
 #ifndef NO_LYNX_TRACE
-extern BOOLEAN LYUseTraceLog;		/* Use a TRACE log?		 */
 extern FILE *LYTraceLogFP;		/* Pointer for TRACE log	 */
 extern char *LYTraceLogPath;		/* Path for TRACE log		 */
 #endif
+extern BOOLEAN LYUseTraceLog;		/* Use a TRACE log?		 */
 
 extern BOOL force_empty_hrefless_a;
 extern int connect_timeout;
diff --git a/src/LYHash.h b/src/LYHash.h
index b6453fc8..72039a04 100644
--- a/src/LYHash.h
+++ b/src/LYHash.h
@@ -41,6 +41,7 @@ extern int	s_aedit_sel;
 extern int	s_alert;
 extern int	s_alink;
 extern int	s_curedit;
+extern int	s_forw_backw;
 extern int	s_normal;
 extern int	s_prompt_edit;
 extern int	s_prompt_edit_arr;
diff --git a/src/LYHistory.c b/src/LYHistory.c
index 31d39c92..26ac340b 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -38,7 +38,7 @@ PRIVATE VisitedLink *Latest_tree;
 PRIVATE VisitedLink *First_tree;
 PRIVATE VisitedLink *Last_by_first;
 
-PRIVATE int nhist_extra;
+int nhist_extra;
 
 #ifdef LY_FIND_LEAKS
 /*
diff --git a/src/LYHistory.h b/src/LYHistory.h
index fecb67f9..5d061a24 100644
--- a/src/LYHistory.h
+++ b/src/LYHistory.h
@@ -20,4 +20,6 @@ extern void LYstatusline_messages_on_exit PARAMS((char **buf));
 extern void LYstore_message PARAMS((CONST char *message));
 extern void LYstore_message2 PARAMS((CONST char *message, CONST char *argument));
 
+extern int nhist_extra;
+
 #endif /* LYHISTORY_H */
diff --git a/src/LYJump.c b/src/LYJump.c
index b198f3df..6f426153 100644
--- a/src/LYJump.c
+++ b/src/LYJump.c
@@ -378,7 +378,7 @@ PRIVATE unsigned LYRead_Jumpfile ARGS1(struct JumpTable *,jtp)
     }
 
     /* allocate storage to read entire file */
-    if ((mp=(char *)calloc(1, st.st_size + 1)) == NULL) {
+    if ((mp= typecallocn(char, st.st_size + 1)) == NULL) {
 	HTAlert(OUTOF_MEM_FOR_JUMP_FILE);
 	return 0;
     }
@@ -387,7 +387,7 @@ PRIVATE unsigned LYRead_Jumpfile ARGS1(struct JumpTable *,jtp)
     if (st.st_fab_rfm != (char)FAB$C_STMLF) {
 	/** It's a record-oriented file. **/
 	IsStream_LF = FALSE;
-	if ((fp = fopen(jtp->file, "r", "mbc=32")) == NULL) {
+	if ((fp = fopen(jtp->file, TXT_R, "mbc=32")) == NULL) {
 	    HTAlert(CANNOT_OPEN_JUMP_FILE);
 	    FREE(mp);
 	    return 0;
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index 75549f98..8f20e7e3 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -104,7 +104,7 @@ LYK_LAST_LINK,          0,              0,          LYK_HISTORICAL,
 LYK_UP_HALF,      LYK_DOWN_HALF, LYK_IMAGE_TOGGLE,  LYK_NEXT_PAGE,
 /* ( */              /* ) */         /* * */        /* + */
 
-LYK_NEXT_PAGE,    LYK_PREV_PAGE, LYK_EXTERN,        LYK_WHEREIS,
+LYK_EXTERN_PAGE,  LYK_PREV_PAGE, LYK_EXTERN_LINK,   LYK_WHEREIS,
 /* , */              /* - */         /* . */        /* / */
 
 LYK_F_LINK_NUM,      LYK_1,          LYK_2,         LYK_3,
@@ -898,8 +898,11 @@ PRIVATE Kcmd revmap[] = {
 #endif
 #ifdef USE_EXTERNALS
     DATA(
-	LYK_EXTERN, "EXTERN",
-	"run external program with url" ),
+	LYK_EXTERN_LINK, "EXTERN_LINK",
+	"run external program with current link" ),
+    DATA(
+	LYK_EXTERN_PAGE, "EXTERN_PAGE",
+	"run external program with current page" ),
 #endif
 #ifdef VMS
     DATA(
@@ -1319,7 +1322,7 @@ PUBLIC int lacname_to_lac ARGS1(
 {
        Kcmd *mp = LYStringToKcmd(func);
 
-       return (mp != 0) ? mp->code : -1;
+       return (mp != 0) ? (int) mp->code : -1;
 }
 
 /*
@@ -1488,7 +1491,7 @@ PUBLIC int remap ARGS3(
 	else
 #endif
 	    keymap[c+1] = mp->code;
-	return (c ? c : LAC_TO_LKC0(mp->code)); /* don't return 0, successful */
+	return (c ? c : (int) LAC_TO_LKC0(mp->code)); /* don't return 0, successful */
     }
     return 0;
 }
@@ -1614,19 +1617,6 @@ PUBLIC void reset_numbers_as_arrows NOARGS
     did_number_keys = FALSE;
 }
 
-PUBLIC int lookup_keymap ARGS1(
-	int,	func)
-{
-    size_t i;
-
-    for (i = 1; i < KEYMAP_SIZE; i++) {
-	if (LYisNonAlnumKeyname(i, func)) {
-	    return i;
-	}
-    }
-    return -1;
-}
-
 PUBLIC char *key_for_func ARGS1 (
 	int,	func)
 {
diff --git a/src/LYKeymap.h b/src/LYKeymap.h
index 8d783f7f..166df535 100644
--- a/src/LYKeymap.h
+++ b/src/LYKeymap.h
@@ -16,7 +16,6 @@ extern int LYStringToKeycode PARAMS((char *src));
 extern int lacname_to_lac PARAMS((CONST char *func));
 extern int lecname_to_lec PARAMS((CONST char *func));
 extern int lkcstring_to_lkc PARAMS((CONST char *src));
-extern int lookup_keymap PARAMS((int code));
 extern int remap PARAMS((char *key, char *func, BOOLEAN for_dired));
 extern void print_keymap PARAMS((char **newfile));
 extern void reset_emacs_keys NOPARAMS;
@@ -213,9 +212,11 @@ typedef enum {
 #endif
 
 #ifdef USE_EXTERNALS
-  , LYK_EXTERN
+  , LYK_EXTERN_LINK
+  , LYK_EXTERN_PAGE
 #else
-#define LYK_EXTERN        LYK_UNKNOWN
+#define LYK_EXTERN_LINK   LYK_UNKNOWN
+#define LYK_EXTERN_PAGE   LYK_UNKNOWN
 #endif /* !defined(USE_EXTERNALS) */
 
 #if defined(VMS) || defined(DIRED_SUPPORT)
diff --git a/src/LYLeaks.c b/src/LYLeaks.c
index 87a11666..6f188ebe 100644
--- a/src/LYLeaks.c
+++ b/src/LYLeaks.c
@@ -209,8 +209,7 @@ PUBLIC void *LYLeakMalloc ARGS3(
 	 *  Further allocate memory to store the information.
 	 *  Just return on failure to allocate more.
 	 */
-	AllocationList *ALp_new =
-			(AllocationList *)calloc(1, sizeof(AllocationList));
+	AllocationList *ALp_new = typecalloc(AllocationList);
 
 	if (ALp_new == NULL) {
 	    return(vp_malloc);
@@ -242,7 +241,7 @@ PUBLIC void *LYLeakMalloc ARGS3(
 **  Arguments:	vp_malloc	The pointer to newly allocate memory.
 **  Arguments:	st_bytes	The size of the allocation requested
 **				in bytes.
-**		cp_File 	The file from which the request for
+**		cp_File		The file from which the request for
 **				allocation came from.
 **		ssi_Line	The line number in cp_File where the
 **				allocation request came from.
@@ -256,7 +255,7 @@ PUBLIC void *LYLeakMalloc ARGS3(
 */
 PUBLIC AllocationList *LYLeak_mark_malloced ARGS4(
 	void *,		vp_malloced,
-	size_t, 	st_bytes,
+	size_t,		st_bytes,
 	CONST char *,	cp_File,
 	CONST short,	ssi_Line)
 {
@@ -276,12 +275,12 @@ PUBLIC AllocationList *LYLeak_mark_malloced ARGS4(
 	    ALp_new->SL_memory.cp_FileName = cp_File;
 	    ALp_new->SL_memory.ssi_LineNumber = ssi_Line;
 	    return(ALp_new);
-	}	    
+	}
 	/*
 	 *  Further allocate memory to store the information.
 	 *  Just return on failure to allocate more.
 	 */
-	ALp_new = (AllocationList *)calloc(1, sizeof(AllocationList));
+	ALp_new = typecalloc(AllocationList);
 
 	if (ALp_new == NULL) {
 	    return(NULL);
@@ -338,8 +337,7 @@ PUBLIC void *LYLeakCalloc ARGS4(
 	 *  Allocate memory for the item to be in the list.
 	 *  If unable, just return.
 	 */
-	AllocationList *ALp_new =
-			(AllocationList *)calloc(1, sizeof(AllocationList));
+	AllocationList *ALp_new = typecalloc(AllocationList);
 
 	if (ALp_new == NULL) {
 		return(vp_calloc);
@@ -413,9 +411,7 @@ PUBLIC void *LYLeakRealloc ARGS4(
 	 *  Track the invalid pointer value and then exit.
 	 *  If unable to allocate, just exit.
 	 */
-	auto AllocationList *ALp_new =
-			     (AllocationList *)calloc(1,
-						      sizeof(AllocationList));
+	auto AllocationList *ALp_new = typecalloc(AllocationList);
 
 	if (ALp_new == NULL) {
 	    exit(EXIT_FAILURE);
@@ -463,15 +459,15 @@ PUBLIC void *LYLeakRealloc ARGS4(
 **		after a call to realloc or an equivalent
 **		function which has not already created or updated
 **		a list entry.
-**  Arguments:	ALp_old   	List entry for previously allocated
+**  Arguments:	ALp_old		List entry for previously allocated
 **				block of memory to resize.  If NULL,
 **				mark_realloced works just like
 **				mark_malloced.
 **		vp_realloced	The new pointer, after resizing.
 **		st_newBytes	The new size of the chunk of memory.
-**		cp_File 	The file to record.
+**		cp_File		The file to record.
 **		ssi_Line	The line to record.
-**  Return Value:	      	Pointer to new or updated list entry
+**  Return Value:		Pointer to new or updated list entry
 **				for this memory block.
 **				NULL on allocation error.
 **  Revision History:
@@ -480,8 +476,8 @@ PUBLIC void *LYLeakRealloc ARGS4(
 #if defined(LY_FIND_LEAKS) && defined(LY_FIND_LEAKS_EXTENDED)
 PRIVATE AllocationList *mark_realloced ARGS5(
 	AllocationList *, ALp_old,
-	void *, 	vp_realloced,
-	size_t, 	st_newBytes,
+	void *,		vp_realloced,
+	size_t,		st_newBytes,
 	CONST char *,	cp_File,
 	CONST short,	ssi_Line)
 {
@@ -546,9 +542,7 @@ PUBLIC void LYLeakFree ARGS3(
 	 *  Create the final entry before exiting marking this error.
 	 *  If unable to allocate more memory just exit.
 	 */
-	AllocationList *ALp_new =
-			(AllocationList *)calloc(1,
-						 sizeof(AllocationList));
+	AllocationList *ALp_new = typecalloc(AllocationList);
 
 	if (ALp_new == NULL) {
 	    exit(EXIT_FAILURE);
@@ -701,7 +695,7 @@ PRIVATE char * LYLeakSAVsprintf ARGS6(
 {
     AllocationList *ALp_old;
     void *vp_oldAlloced;
-    
+
     CONST char * old_cp_File = __FILE__;
     short old_ssi_Line = __LINE__;
 
@@ -721,9 +715,7 @@ PRIVATE char * LYLeakSAVsprintf ARGS6(
 	     *  Track the invalid pointer value and then exit.
 	     *  If unable to allocate, just exit.
 	     */
-	    auto AllocationList *ALp_new =
-		(AllocationList *)calloc(1,
-					 sizeof(AllocationList));
+	    auto AllocationList *ALp_new = typecalloc(AllocationList);
 
 	    if (ALp_new == NULL) {
 		exit(EXIT_FAILURE);
diff --git a/src/LYLocal.c b/src/LYLocal.c
index 175c8ef9..ae5e5701 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -69,7 +69,7 @@
 
 PRIVATE int LYExecv PARAMS((
 	char *		path,
-	char ** 	argv,
+	char **		argv,
 	char *		msg));
 
 #ifdef DIRED_SUPPORT
@@ -91,7 +91,7 @@ PRIVATE char *get_filename PARAMS((
 PRIVATE BOOLEAN permit_location PARAMS((
 	char *		destpath,
 	char *		srcpath,
-	char ** 	newpath));
+	char **		newpath));
 #endif /* OK_PERMIT */
 
 PRIVATE char *render_item PARAMS((
@@ -100,7 +100,7 @@ PRIVATE char *render_item PARAMS((
 	CONST char *	dir,
 	char *		buf,
 	int		bufsize,
-	BOOLEAN 	url_syntax));
+	BOOLEAN		url_syntax));
 
 PRIVATE struct dired_menu *menu_head = NULL;
 struct dired_menu {
@@ -240,7 +240,7 @@ struct dired_menu {
 
 #ifdef OK_GZIP
 { DE_FILE,	      "", "Compress",
-	  "(using gzip)", "LYNXDIRED://GZIP%p", 		NULL },
+	  "(using gzip)", "LYNXDIRED://GZIP%p",			NULL },
 #endif /* OK_GZIP */
 
 #ifdef OK_ZIP
@@ -263,7 +263,7 @@ struct dired_menu {
 		      "", "LYNXDIRED://CLEAR_TAGGED",		NULL },
 
 { 0,		    NULL, NULL,
-		    NULL, NULL, 				NULL }
+		    NULL, NULL,					NULL }
 };
 
 PRIVATE BOOLEAN cannot_stat ARGS1(CONST char *, name)
@@ -451,7 +451,7 @@ PRIVATE BOOLEAN remove_tagged NOARGS
  *   uid with Lynx & dired can do the same thing.
  */
 PRIVATE BOOLEAN modify_tagged ARGS1(
-	char *, 	testpath)
+	char *,		testpath)
 {
     char *cp;
     dev_t dev;
@@ -607,7 +607,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
  *  Modify the name of the specified item.
  */
 PRIVATE BOOLEAN modify_name ARGS1(
-	char *, 	testpath)
+	char *,		testpath)
 {
     char *cp;
     char tmpbuf[DIRED_MAXBUF];
@@ -662,7 +662,7 @@ PRIVATE BOOLEAN modify_name ARGS1(
  *  Change the location of a file or directory.
  */
 PRIVATE BOOLEAN modify_location ARGS1(
-	char *, 	testpath)
+	char *,		testpath)
 {
     char *cp;
     dev_t dev;
@@ -822,7 +822,7 @@ PUBLIC BOOLEAN local_modify ARGS2(
  *  Create a new empty file in the current directory.
  */
 PRIVATE BOOLEAN create_file ARGS1(
-	char *, 	current_location)
+	char *,		current_location)
 {
     int code = FALSE;
     char tmpbuf[DIRED_MAXBUF];
@@ -871,7 +871,7 @@ PRIVATE BOOLEAN create_file ARGS1(
  *  Create a new directory in the current directory.
  */
 PRIVATE BOOLEAN create_directory ARGS1(
-	char *, 	current_location)
+	char *,		current_location)
 {
     int code = FALSE;
     char tmpbuf[DIRED_MAXBUF];
@@ -947,7 +947,7 @@ PUBLIC BOOLEAN local_create ARGS1(
  *  Remove a single file or directory.
  */
 PRIVATE BOOLEAN remove_single ARGS1(
-	char *, 	testpath)
+	char *,		testpath)
 {
     int code = 0;
     char *cp;
@@ -1079,8 +1079,8 @@ PRIVATE char LYValidPermitFile[LY_MAXPATH] = "\0";
  *  Handle DIRED permissions.
  */
 PRIVATE BOOLEAN permit_location ARGS3(
-	char *, 	destpath,
-	char *, 	srcpath,
+	char *,		destpath,
+	char *,		srcpath,
 	char **,	newpath)
 {
 #ifndef UNIX
@@ -1479,7 +1479,7 @@ PUBLIC int local_dired ARGS1(
     StrAllocCopy(line, line_url);
     HTUnEscape(line);	/* _file_ (not URL) syntax, for those functions
 			   that need it.  Don't forget to FREE it. */
-    if ((arg = match_op("CHDIR", line)) != 0) {    
+    if ((arg = match_op("CHDIR", line)) != 0) {
 #ifdef SUPPORT_CHDIR
 	handle_LYK_CHDIR();
 	do_pop_doc = FALSE;
@@ -1717,7 +1717,7 @@ PUBLIC int dired_options ARGS2(
     static char tempfile[LY_MAXPATH];
     char *path;
     char *dir;
-    lynx_html_item_type *nxt;
+    lynx_list_item_type *nxt;
     struct stat dir_info;
     FILE *fp0;
     char *dir_url;
@@ -1870,9 +1870,9 @@ PUBLIC int dired_options ARGS2(
  *  Check DIRED filename.
  */
 PRIVATE char *get_filename ARGS3(
-	char *, 	prompt,
-	char *, 	buf,
-	size_t, 	bufsize)
+	char *,		prompt,
+	char *,		buf,
+	size_t,		bufsize)
 {
     char *cp;
 
@@ -1904,7 +1904,7 @@ PRIVATE char *get_filename ARGS3(
 #define LYEXECV_MAX_ARGC 15
 /* these are quasi-constant once they have been allocated: */
 static char ** install_argp = NULL;	/* args for execv install */
-static char * install_path = NULL; 	/* auxiliary */
+static char * install_path = NULL;	/* auxiliary */
 #ifdef LY_FIND_LEAKS
 PRIVATE void clear_install_path NOARGS
 {
@@ -1936,7 +1936,7 @@ PRIVATE int fill_argv_for_execv ARGS5(
     char **args;
     char *cp;
     if (*argvp == NULL) {
-	*argvp = (char **)calloc(LYEXECV_MAX_ARGC+1, sizeof(char *));
+	*argvp = typecallocn(char *, LYEXECV_MAX_ARGC+1);
 	if (!*argvp)
 	    return(-1);
 #ifdef LY_FIND_LEAKS
@@ -1969,8 +1969,8 @@ PRIVATE int fill_argv_for_execv ARGS5(
  *  Install the specified file or directory.
  */
 PUBLIC BOOLEAN local_install ARGS3(
-	char *, 	destpath,
-	char *, 	srcpath,
+	char *,		destpath,
+	char *,		srcpath,
 	char **,	newpath)
 {
     char *tmpbuf = NULL;
@@ -2159,7 +2159,7 @@ PUBLIC void clear_tags NOARGS
  *  Handle DIRED menu item.
  */
 PUBLIC void add_menu_item ARGS1(
-	char *, 	str)
+	char *,		str)
 {
     struct dired_menu *new, *mp;
     char *cp;
@@ -2171,7 +2171,7 @@ PUBLIC void add_menu_item ARGS1(
     if (menu_head == defmenu)
 	menu_head = NULL;
 
-    new = (struct dired_menu *)calloc(1, sizeof(*new));
+    new = typecalloc(struct dired_menu);
     if (new == NULL)
 	outofmem(__FILE__, "add_menu_item");
 
@@ -2240,10 +2240,10 @@ PUBLIC void reset_dired_menu NOARGS
  *  Create URL for DIRED HREF value.
  */
 PRIVATE char * render_item ARGS6(
-	CONST char *, 	s,
-	CONST char *, 	path,
-	CONST char *, 	dir,
-	char *, 	buf,
+	CONST char *,	s,
+	CONST char *,	path,
+	CONST char *,	dir,
+	char *,		buf,
 	int,		bufsize,
 	BOOLEAN,	url_syntax)
 {
@@ -2338,18 +2338,18 @@ PRIVATE char * render_item ARGS6(
  *  Execute DIRED command, return -1 or 0 on failure, 1 success.
  */
 PRIVATE int LYExecv ARGS3(
-	char *, 	path,
+	char *,		path,
 	char **,	argv,
-	char *, 	msg)
+	char *,		msg)
 {
+    int rc = 0;
 #if defined(VMS)
     CTRACE((tfp, "LYExecv:  Called inappropriately!\n"));
-    return(0);
 #else
 #if defined(_WINDOWS)
     if (!strcmp(path, TOUCH_PATH)) {
-#if defined(__BORLANDC__) || defined(__MINGW32__) 
-	int fd = _creat(argv[1], S_IREAD | S_IWRITE); 
+#if defined(__BORLANDC__) || defined(__MINGW32__)
+	int fd = _creat(argv[1], S_IREAD | S_IWRITE);
 #else /* Visual C++ */
 	int fd = _creat(argv[1], _S_IREAD | _S_IWRITE);
 #endif
@@ -2358,12 +2358,11 @@ PRIVATE int LYExecv ARGS3(
 	    return(1);
 	}
     } else if (!strcmp(path, RM_PATH)) {
-	return remove(argv[2]);
+	rc = remove(argv[2]);
+    } else {
+	CTRACE((tfp, "LYExecv:  Called inappropriately! (path=%s)\n", path));
     }
-    CTRACE((tfp, "LYExecv:  Called inappropriately! (path=%s)\n", path));
-    return(0);
 #else
-    int rc;
     int n;
     char *tmpbuf = 0;
 #ifdef __DJGPP__
@@ -2390,11 +2389,13 @@ PRIVATE int LYExecv ARGS3(
     rc = 1;		/* It will work */
     stop_curses();
     pid = fork();	/* fork and execute command */
+
     switch (pid) {
 	case -1:
 	    HTSprintf0(&tmpbuf, gettext("Unable to %s due to system error!"), msg);
 	    rc = 0;
 	    break;	/* don't fall thru! - KW */
+
 	case 0:  /* child */
 #ifdef USE_EXECVP
 	    execvp(path, argv);	/* this uses our $PATH */
@@ -2402,6 +2403,8 @@ PRIVATE int LYExecv ARGS3(
 	    execv(path, argv);
 #endif
 	    exit(EXIT_FAILURE);	/* execv failed, give wait() something to look at */
+	    /*NOTREACHED*/
+
 	default:  /* parent */
 #if !HAVE_WAITPID
 	    while (wait(&wstatus) != pid)
@@ -2442,7 +2445,7 @@ PRIVATE int LYExecv ARGS3(
 	FREE(tmpbuf);
     }
 
-    return(rc);
 #endif /* _WINDOWS */
 #endif /* VMS */
+    return(rc);
 }
diff --git a/src/LYMain.c b/src/LYMain.c
index 371bc591..bf63a8ed 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -146,15 +146,15 @@ PUBLIC char *empty_string = "\0";
 PUBLIC int display_lines;  /* number of lines in display */
 PUBLIC int www_search_result= -1;
 			       /* linked list of printers */
-PUBLIC lynx_printer_item_type *printers = NULL;
+PUBLIC lynx_list_item_type *printers = NULL;
 			    /* linked list of download options */
-PUBLIC lynx_html_item_type *downloaders = NULL;
+PUBLIC lynx_list_item_type *downloaders = NULL;
 			    /* linked list of upload options */
 #ifdef USE_EXTERNALS
-PUBLIC lynx_html_item_type *externals = NULL;
+PUBLIC lynx_list_item_type *externals = NULL;
 			    /* linked list of external options */
 #endif
-PUBLIC lynx_html_item_type *uploaders = NULL;
+PUBLIC lynx_list_item_type *uploaders = NULL;
 PUBLIC int port_syntax = 1;
 PUBLIC int LYShowColor = SHOW_COLOR_UNKNOWN; /* to show or not to show */
 PUBLIC int LYChosenShowColor = SHOW_COLOR_UNKNOWN; /* whether to show and save */
@@ -436,18 +436,22 @@ BOOLEAN persistent_cookies = FALSE;	/* disabled by default! */
 PUBLIC char *LYCookieFile = NULL;	/* cookie read file */
 PUBLIC char *LYCookieSaveFile = NULL;	/* cookie save file */
 #endif /* EXP_PERSISTENT_COOKIES */
+
 PUBLIC int LYTransferRate = rateEtaKB_maybe;
 PUBLIC char *XLoadImageCommand = NULL;	/* Default image viewer for X */
 PUBLIC BOOLEAN LYNoISMAPifUSEMAP = FALSE; /* Omit ISMAP link if MAP present? */
 PUBLIC int LYHiddenLinks = HIDDENLINKS_SEPARATE; /* Show hidden links? */
 
 PUBLIC BOOL Old_DTD = NO;
+
+#ifndef NO_LYNX_TRACE
 PUBLIC FILE *LYTraceLogFP = NULL;		/* Pointer for TRACE log  */
+#endif
 PUBLIC char *LYTraceLogPath = NULL;		/* Path for TRACE log	   */
 PUBLIC BOOLEAN LYUseTraceLog = USE_TRACE_LOG;	/* Use a TRACE log?	   */
+
 PUBLIC BOOLEAN LYSeekFragMAPinCur = TRUE;
 PUBLIC BOOLEAN LYSeekFragAREAinCur = TRUE;
-
 PUBLIC BOOLEAN LYStripDotDotURLs = TRUE;	/* Try to fix ../ in some URLs? */
 PUBLIC BOOLEAN LYForceSSLCookiesSecure = FALSE;
 PUBLIC BOOLEAN LYNoCc = FALSE;
@@ -2139,7 +2143,7 @@ PUBLIC void reload_read_cfg NOARGS
      *  no_option_save restriction may thus be unnecessarily restrictive,
      *  but the check is currently still left in place. - kw
      */
-    tempfile = calloc(1, LY_MAXPATH);
+    tempfile = typecallocn(char, LY_MAXPATH);
     if (!tempfile) {
 	HTAlwaysAlert(NULL, NOT_ENOUGH_MEMORY);
 	return;
@@ -2196,7 +2200,7 @@ PUBLIC void reload_read_cfg NOARGS
 	/*
 	 *  Process the temporary RC file.
 	 */
-	rcfp = fopen(tempfile, "r");
+	rcfp = fopen(tempfile, TXT_R);
 	read_rc(rcfp);
 	LYRemoveTemp(tempfile);
 	FREE(tempfile);		/* done with it - kw */
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 434d804d..fd5ae994 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -2683,7 +2683,7 @@ PRIVATE int handle_LYK_ELGOTO ARGS5(
 }
 
 #ifdef USE_EXTERNALS
-PRIVATE void handle_LYK_EXTERN ARGS1(
+PRIVATE void handle_LYK_EXTERN_LINK ARGS1(
     BOOLEAN *,	refresh_screen)
 {
     if ((nlinks > 0) && (links[curdoc.link].lname != NULL))
@@ -2692,6 +2692,16 @@ PRIVATE void handle_LYK_EXTERN ARGS1(
 	*refresh_screen = TRUE;
     }
 }
+
+PRIVATE void handle_LYK_EXTERN_PAGE ARGS1(
+    BOOLEAN *,	refresh_screen)
+{
+    if (curdoc.address != NULL)
+    {
+	run_external(curdoc.address, FALSE);
+	*refresh_screen = TRUE;
+    }
+}
 #endif
 
 PRIVATE BOOLEAN handle_LYK_FASTBACKW_LINK ARGS3(
@@ -7300,8 +7310,11 @@ new_cmd:  /*
 #endif /* DIRED_SUPPORT || VMS*/
 
 #ifdef USE_EXTERNALS
-	case LYK_EXTERN:	/* use external program on url */
-	    handle_LYK_EXTERN(&refresh_screen);
+	case LYK_EXTERN_LINK:	/* use external program on url */
+	    handle_LYK_EXTERN_LINK(&refresh_screen);
+	    break;
+	case LYK_EXTERN_PAGE:	/* use external program on current page */
+	    handle_LYK_EXTERN_PAGE(&refresh_screen);
 	    break;
 #endif /* USE_EXTERNALS */
 
diff --git a/src/LYNews.c b/src/LYNews.c
index c9b13506..72309078 100644
--- a/src/LYNews.c
+++ b/src/LYNews.c
@@ -35,7 +35,7 @@ PRIVATE BOOLEAN message_has_content ARGS2(
 
     *nonspaces = FALSE;
 
-    if (!filename || (fp = fopen(filename, "r")) == NULL) {
+    if (!filename || (fp = fopen(filename, TXT_R)) == NULL) {
 	CTRACE((tfp, "Failed to open file %s for reading!\n",
 	       NONNULL(filename)));
 	return FALSE;
@@ -136,7 +136,7 @@ PUBLIC char *LYNewsPost ARGS2(
      *  and message body. - FM
      */
 #ifdef __DJGPP__
-    if ((fd = LYOpenTemp(my_tempfile, HTML_SUFFIX, "wb")) == NULL)
+    if ((fd = LYOpenTemp(my_tempfile, HTML_SUFFIX, BIN_W)) == NULL)
 #else
     if ((fd = LYOpenTemp(my_tempfile, HTML_SUFFIX, "w")) == NULL)
 #endif /* __DJGPP__ */
@@ -240,11 +240,11 @@ PUBLIC char *LYNewsPost ARGS2(
 	    CJKinput[0] = '\0';
 	    switch(kanji_code) {
 	    case EUC:
-		TO_EUC((CONST unsigned char *)kp, CJKinput);
+		TO_EUC((CONST unsigned char *)kp, (unsigned char *)CJKinput);
 		kp = CJKinput;
 		break;
 	    case SJIS:
-		TO_SJIS((CONST unsigned char *)kp, CJKinput);
+		TO_SJIS((CONST unsigned char *)kp, (unsigned char *)CJKinput);
 		kp = CJKinput;
 		break;
 	    default:
@@ -280,7 +280,7 @@ PUBLIC char *LYNewsPost ARGS2(
 	StrAllocCat(cp, org);
     }
 #ifdef UNIX
-    else if ((fp = fopen("/etc/organization", "r")) != NULL) {
+    else if ((fp = fopen("/etc/organization", TXT_R)) != NULL) {
 	char *buffer = 0;
 	if (LYSafeGets(&buffer, fp) != NULL) {
 	    if ((org = strchr(buffer, '\n')) != NULL) {
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 0ef88dec..230d380c 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -2438,7 +2438,7 @@ PRIVATE PostPair * break_data ARGS1(
 
     CTRACE((tfp, "break_data %s\n", data));
 
-    q = calloc(sizeof(PostPair), 1);
+    q = typecalloc(PostPair);
     if (q==NULL)
 	outofmem(__FILE__, "break_data(calloc)");
 
diff --git a/src/LYPrint.c b/src/LYPrint.c
index 6a95f962..12bf6605 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -805,7 +805,7 @@ PRIVATE void send_file_to_printer ARGS4(
     char my_file[LY_MAXPATH];
     char my_temp[LY_MAXPATH];
     int FnameTotal, FnameNum = -1;
-    lynx_printer_item_type *cur_printer;
+    lynx_list_item_type *cur_printer;
 
     outfile_fp = LYOpenTemp(my_temp,
 			    (HTisDocumentSource())
@@ -1115,7 +1115,7 @@ PUBLIC int printfile ARGS1(
     /*
      *	Get the number of lines in the file.
      */
-    if ((cp = (char *)strstr(link_info, "lines=")) != NULL) {
+    if ((cp = strstr(link_info, "lines=")) != NULL) {
 	/*
 	 *  Terminate prev string here.
 	 */
@@ -1143,12 +1143,12 @@ PUBLIC int printfile ARGS1(
     } else if (strstr(link_info, "PRINTER")) {
 	type = PRINTER;
 
-	if ((cp = (char *)strstr(link_info, "number=")) != NULL) {
+	if ((cp = strstr(link_info, "number=")) != NULL) {
 	    /* number of characters in "number=" */
 	    cp += 7;
 	    printer_number = atoi(cp);
 	}
-	if ((cp = (char *)strstr(link_info, "pagelen=")) != NULL) {
+	if ((cp = strstr(link_info, "pagelen=")) != NULL) {
 	    /* number of characters in "pagelen=" */
 	    cp += 8;
 	    pagelen = atoi(cp);
@@ -1271,7 +1271,7 @@ PUBLIC int print_options ARGS3(
     int count;
     int pages;
     FILE *fp0;
-    lynx_printer_item_type *cur_printer;
+    lynx_list_item_type *cur_printer;
 
     if (LYReuseTempfiles) {
 	fp0 = LYOpenTempRewrite(my_temp, HTML_SUFFIX, "w");
@@ -1464,7 +1464,7 @@ check_recall:
      *   "invalid pointer" reported in the Lynx.leaks file (if compiled
      *   with  --enable-find-leaks  turned on.  Dumb.]
      */
-    if ((fn = (char *) calloc (1, (strlen (tbuf) + 1))) == NULL)
+    if ((fn = typecallocn(char, strlen (tbuf) + 1)) == NULL)
 	outofmem(__FILE__, "GetFileName");
     return (strcpy (fn, tbuf));
 
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 1369a8df..5ba10be4 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -78,15 +78,12 @@ PRIVATE char *find_colon ARGS1(
     return NULL;
 }
 
-/*
- *  Function for freeing the DOWNLOADER and UPLOADER menus list. - FM
- */
-PRIVATE void free_item_list NOARGS
+PRIVATE void free_item_list ARGS1(
+    lynx_list_item_type **,	ptr)
 {
-    lynx_html_item_type *cur;
-    lynx_html_item_type *next;
+    lynx_list_item_type *cur = *ptr;
+    lynx_list_item_type *next;
 
-    cur = downloaders;
     while (cur) {
 	next = cur->next;
 	FREE(cur->name);
@@ -94,30 +91,22 @@ PRIVATE void free_item_list NOARGS
 	FREE(cur);
 	cur = next;
     }
-    downloaders = NULL;
+    *ptr = NULL;
+}
 
+/*
+ *  Function for freeing the DOWNLOADER and UPLOADER menus list. - FM
+ */
+PRIVATE void free_all_item_lists NOARGS
+{
+    free_item_list(&printers);
+    free_item_list(&downloaders);
 #ifdef DIRED_SUPPORT
-    cur = uploaders;
-    while (cur) {
-	next = cur->next;
-	FREE(cur->name);
-	FREE(cur->command);
-	FREE(cur);
-	cur = next;
-    }
-    uploaders = NULL;
+    free_item_list(&uploaders);
 #endif /* DIRED_SUPPORT */
 
 #ifdef USE_EXTERNALS
-    cur = externals;
-    while (cur) {
-	next = cur->next;
-	FREE(cur->name);
-	FREE(cur->command);
-	FREE(cur);
-	cur = next;
-    }
-    externals = NULL;
+    free_item_list(&externals);
 #endif /* USE_EXTERNALS */
 
     return;
@@ -126,12 +115,13 @@ PRIVATE void free_item_list NOARGS
 /*
  *  Process string buffer fields for DOWNLOADER or UPLOADER menus.
  */
-PRIVATE void add_item_to_list ARGS2(
+PRIVATE void add_item_to_list ARGS3(
 	char *,			buffer,
-	lynx_html_item_type **, list_ptr)
+	lynx_list_item_type **, list_ptr,
+	int,			special)
 {
     char *colon, *next_colon;
-    lynx_html_item_type *cur_item, *prev_item;
+    lynx_list_item_type *cur_item, *prev_item;
 
     /*
      *	Make a linked list
@@ -140,12 +130,12 @@ PRIVATE void add_item_to_list ARGS2(
 	/*
 	 *  First item.
 	 */
-	cur_item = typecalloc(lynx_html_item_type);
+	cur_item = typecalloc(lynx_list_item_type);
 	if (cur_item == NULL)
 	    outofmem(__FILE__, "read_cfg");
 	*list_ptr = cur_item;
 #ifdef LY_FIND_LEAKS
-	atexit(free_item_list);
+	atexit(free_all_item_lists);
 #endif
     } else {
 	/*
@@ -155,7 +145,7 @@ PRIVATE void add_item_to_list ARGS2(
 	     prev_item->next != NULL;
 	     prev_item = prev_item->next)
 	    ;  /* null body */
-	cur_item = typecalloc(lynx_html_item_type);
+	cur_item = typecalloc(lynx_list_item_type);
 	if (cur_item == NULL)
 	    outofmem(__FILE__, "read_cfg");
 	else
@@ -166,6 +156,7 @@ PRIVATE void add_item_to_list ARGS2(
     cur_item->command = NULL;
     cur_item->always_enabled = FALSE;
     cur_item->override_primary_action = FALSE;
+    cur_item->pagelen = 66;
 
     /*
      *	Find first unescaped colon and process fields
@@ -174,7 +165,7 @@ PRIVATE void add_item_to_list ARGS2(
 	/*
 	 *  Process name field
 	 */
-	cur_item->name = typecallocn(char,colon-buffer+1);
+	cur_item->name = typecallocn(char, colon-buffer+1);
 	if (cur_item->name == NULL)
 	    outofmem(__FILE__, "read_cfg");
 	LYstrncpy(cur_item->name, buffer, (int)(colon-buffer));
@@ -202,113 +193,36 @@ PRIVATE void add_item_to_list ARGS2(
 		*next_colon++ = '\0';
 	    cur_item->always_enabled = is_true(colon);
 	    if (next_colon) {
-		cur_item->override_primary_action = is_true(next_colon);
+		if (special) {
+		    cur_item->pagelen = atoi(next_colon);
+		} else {
+		    cur_item->override_primary_action = is_true(next_colon);
+		}
 	    }
 	}
     }
 }
 
-
-/*
- *  Function for freeing the PRINTER menus list. - FM
- */
-PRIVATE void free_printer_item_list NOARGS
+PUBLIC lynx_list_item_type *find_item_by_number ARGS2(
+	lynx_list_item_type *,	list_ptr,
+	char *,			number)
 {
-    lynx_printer_item_type *cur = printers;
-    lynx_printer_item_type *next;
-
-    while (cur) {
-	next = cur->next;
-	FREE(cur->name);
-	FREE(cur->command);
-	FREE(cur);
-	cur = next;
+    int value = atoi(number);
+    while (value-- >= 0 && list_ptr != 0) {
+	list_ptr = list_ptr->next;
     }
-    printers = NULL;
-
-    return;
+    return list_ptr;
 }
 
-/*
- *  Process string buffer fields for PRINTER menus.
- */
-PRIVATE void add_printer_to_list ARGS2(
-	char *,				buffer,
-	lynx_printer_item_type **,	list_ptr)
+PUBLIC int match_item_by_name ARGS3(
+    lynx_list_item_type *,	ptr,
+    char *,			name,
+    BOOLEAN,			only_overriders)
 {
-    char *colon, *next_colon;
-    lynx_printer_item_type *cur_item, *prev_item;
-
-    /*
-     *	Make a linked list.
-     */
-    if (*list_ptr == NULL) {
-	/*
-	 *  First item.
-	 */
-	cur_item = typecalloc(lynx_printer_item_type);
-	if (cur_item == NULL)
-	    outofmem(__FILE__, "read_cfg");
-	*list_ptr = cur_item;
-#ifdef LY_FIND_LEAKS
-	atexit(free_printer_item_list);
-#endif
-    } else {
-	/*
-	 *  Find the last item.
-	 */
-	for (prev_item = *list_ptr;
-	     prev_item->next != NULL;
-	     prev_item = prev_item->next)
-	    ;  /* null body */
-
-	cur_item = typecalloc(lynx_printer_item_type);
-	if (cur_item == NULL)
-	    outofmem(__FILE__, "read_cfg");
-	else
-	    prev_item->next = cur_item;
-    }
-    cur_item->next = NULL;
-    cur_item->name = NULL;
-    cur_item->command = NULL;
-    cur_item->always_enabled = FALSE;
-
-    /*
-     *	Find first unescaped colon and process fields.
-     */
-    if ((colon = find_colon(buffer)) != NULL) {
-	/*
-	 *  Process name field.
-	 */
-	cur_item->name = typecallocn(char, colon-buffer+1);
-	if (cur_item->name == NULL)
-	    outofmem(__FILE__, "read_cfg");
-	LYstrncpy(cur_item->name, buffer, (int)(colon-buffer));
-	remove_backslashes(cur_item->name);
-
-	/*
-	 *  Process TRUE/FALSE field.
-	 */
-	if ((next_colon = find_colon(colon+1)) != NULL) {
-	    cur_item->command = typecallocn(char, next_colon-colon);
-	    if (cur_item->command == NULL)
-		outofmem(__FILE__, "read_cfg");
-	    LYstrncpy(cur_item->command, colon+1, (int)(next_colon-(colon+1)));
-	    remove_backslashes(cur_item->command);
-	    cur_item->always_enabled = is_true(next_colon+1);
-	}
-
-	/*
-	 *  Process pagelen field.
-	 */
-	if (next_colon != NULL
-	 && (next_colon = find_colon(next_colon+1)) != NULL) {
-	    cur_item->pagelen = atoi(next_colon+1);
-	} else {
-	    /* default to 66 lines */
-	    cur_item->pagelen = 66;
-	}
-    }
+    return
+	(ptr->command != 0
+	&& !strncasecomp(ptr->name, name, strlen(ptr->name))
+	&& (only_overriders ? ptr->override_primary_action : 1));
 }
 
 #if defined(USE_COLOR_STYLE) || defined(USE_COLOR_TABLE)
@@ -483,7 +397,7 @@ PRIVATE void parse_color ARGS1(
 typedef int (*ParseFunc) PARAMS((char *));
 
 typedef union {
-	lynx_html_item_type ** add_value;
+	lynx_list_item_type ** add_value;
 	BOOLEAN * set_value;
 	int *	  int_value;
 	char **   str_value;
@@ -493,7 +407,7 @@ typedef union {
 
 #ifdef	PARSE_DEBUG
 #define ParseData \
-	lynx_html_item_type** add_value; \
+	lynx_list_item_type** add_value; \
 	BOOLEAN *set_value; \
 	int *int_value; \
 	char **str_value; \
@@ -971,7 +885,7 @@ static int cern_rulesfile_fun ARGS1(
 static int printer_fun ARGS1(
 	char *,		value)
 {
-    add_printer_to_list(value, &printers);
+    add_item_to_list(value, &printers, TRUE);
     return 0;
 }
 
@@ -1710,8 +1624,7 @@ PUBLIC void free_lynx_cfg NOARGS
 	    break;
 	}
     }
-    free_item_list();
-    free_printer_item_list();
+    free_all_item_lists();
 #ifdef DIRED_SUPPORT
     reset_dired_menu();		/* frees and resets dired menu items - kw */
 #endif
@@ -1739,6 +1652,60 @@ PRIVATE Config_Type *lookup_config ARGS1(
     return tbl;
 }
 
+/*
+ * If the given value is an absolute path (by syntax), or we can read it, use
+ * the value as given.  Otherwise, assume it must be in the same place we read
+ * the parent configuration file from.
+ *
+ * Note:  only read files from the current directory if there's no parent
+ * filename, otherwise it leads to user surprise.
+ */
+PRIVATE char *actual_filename ARGS3(
+    char *,	cfg_filename,
+    char *,	parent_filename,
+    char *,	dft_filename)
+{
+    static char *my_filename;
+
+    if (my_filename != 0) {
+	FREE(my_filename);
+    }
+    if (!LYisAbsPath(cfg_filename)
+     && !(parent_filename == 0 && LYCanReadFile(cfg_filename))) {
+	if (!strncmp(cfg_filename, "~/", 2)) {
+	    HTSprintf0(&my_filename, "%s%s", Home_Dir(), cfg_filename+1);
+	    cfg_filename = my_filename;
+	} else {
+	    if (parent_filename != 0) {
+		StrAllocCopy(my_filename, parent_filename);
+		*LYPathLeaf (my_filename) = '\0';
+		StrAllocCat(my_filename, cfg_filename);
+	    }
+	    if (my_filename != 0 && LYCanReadFile(my_filename)) {
+		cfg_filename = my_filename;
+	    } else {
+		StrAllocCopy(my_filename, dft_filename);
+		*LYPathLeaf (my_filename) = '\0';
+		StrAllocCat(my_filename, cfg_filename);
+		if (LYCanReadFile(my_filename)) {
+		    cfg_filename = my_filename;
+		}
+	    }
+	}
+    }
+    return cfg_filename;
+}
+
+PUBLIC FILE *LYOpenCFG ARGS3(
+    char *,	cfg_filename,
+    char *,	parent_filename,
+    char *,	dft_filename)
+{
+    cfg_filename = actual_filename(cfg_filename, parent_filename, dft_filename);
+    CTRACE((tfp, "opening config file %s\n", cfg_filename));
+    return fopen(cfg_filename, TXT_R);
+}
+
 #define NOPTS_ ( TABLESIZE(Config_Table) - 1 )
 typedef BOOL (optidx_set_t) [ NOPTS_ ];
  /* if element is FALSE, then it's allowed in the current file*/
@@ -1765,7 +1732,6 @@ PRIVATE void do_read_cfg ARGS5(
 	FILE *,	fp0,
 	optidx_set_t*, allowed)
 {
-    static char *mypath = NULL;
     FILE *fp;
     char *buffer = 0;
 
@@ -1790,11 +1756,7 @@ PRIVATE void do_read_cfg ARGS5(
 	CTRACE((tfp,"No filename following -cfg switch!\n"));
 	return;
     }
-    if (!strncmp(cfg_filename, "~/", 2)) {
-	HTSprintf0(&mypath, "%s%s", Home_Dir(), cfg_filename+1);
-	cfg_filename = mypath;
-    }
-    if ((fp = fopen(cfg_filename, TXT_R)) == 0) {
+    if ((fp = LYOpenCFG(cfg_filename, parent_filename, LYNX_CFG_FILE)) == 0) {
 	CTRACE((tfp, "lynx.cfg file not found as '%s'\n", cfg_filename));
 	return;
     }
@@ -1954,7 +1916,7 @@ PRIVATE void do_read_cfg ARGS5(
 
 #ifndef NO_CONFIG_INFO
 	    if (fp0 != 0  &&  !no_lynxcfg_xinfo) {
-		LYLocalFileToURL(&url, value);
+		LYLocalFileToURL(&url, actual_filename(value, cfg_filename, LYNX_CFG_FILE));
 		StrAllocCopy(cp1, value);
 		if (strchr(value, '&') || strchr(value, '<')) {
 		    LYEntify(&cp1, TRUE);
@@ -2043,7 +2005,7 @@ PRIVATE void do_read_cfg ARGS5(
 
 	case CONF_ADD_ITEM:
 	    if (q->add_value != 0)
-		add_item_to_list (value, q->add_value);
+		add_item_to_list (value, q->add_value, FALSE);
 	    break;
 
 #if defined(EXEC_LINKS) || defined(LYNXCGI_LINKS)
@@ -2076,7 +2038,7 @@ PRIVATE void do_read_cfg ARGS5(
      *	with those always_enabled options still available. - FM
      */
     if (downloaders != 0) {
-	lynx_html_item_type *cur_download;
+	lynx_list_item_type *cur_download;
 
 	cur_download = downloaders;
 	while (cur_download != 0) {
diff --git a/src/LYReadCFG.h b/src/LYReadCFG.h
index 2fc893ad..b6349cc0 100644
--- a/src/LYReadCFG.h
+++ b/src/LYReadCFG.h
@@ -53,8 +53,11 @@ extern void read_cfg PARAMS((char *cfg_filename, char *parent_filename, int nest
 extern void free_lynx_cfg NOPARAMS;
 extern BOOLEAN have_read_cfg;
 
+extern FILE *LYOpenCFG PARAMS((char *cfg_filename, char *parent_filename, char *dft_filename));
 extern int lynx_cfg_infopage PARAMS((document *newdoc));
 extern int lynx_compile_opts PARAMS((document *newdoc));
+extern int match_item_by_name PARAMS((lynx_list_item_type * ptr, char * name, BOOLEAN only_overriders));
+extern lynx_list_item_type *find_item_by_number PARAMS((lynx_list_item_type * list_ptr, char * number));
 extern void reload_read_cfg NOPARAMS; /* implemented in LYMain.c */
 
 #endif /* LYREADCFG_H */
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 7ea81384..0f6685de 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -364,16 +364,45 @@ PRIVATE int set_clicked_link ARGS4(
     int i;
     int c = -1;
 
-    if (y == (LYlines-1)) {
-	mouse_link = -2;
-	if (x < left)	    c = (code==FOR_PROMPT) ? LTARROW : LTARROW;
-	else if (x > right) c = (code==FOR_PROMPT) ? RTARROW : '\b';
-	else c = PGDOWN;
-    } else if (y == 0) {
+    if (y == (LYlines-1) || y == 0) {	/* First or last row */
+	/* XXXX In fact # is not always at x==0?  KANJI_CODE_OVERRIDE? */
+	int toolbar = (y == 0 && HText_hasToolbar(HTMainText));
+
 	mouse_link = -2;
-	if (x < left) c = LTARROW;
-	else if (x > right) c = '\b';
-	else c = PGUP;
+	if (x == 0 && toolbar)		/* On '#' */
+	    c = LAC_TO_LKC0(LYK_TOOLBAR);
+	else if (clicks > 1) {
+	    if (x < left + toolbar)
+		c = (code==FOR_PROMPT && y)
+		    ? HOME : LAC_TO_LKC0(LYK_MAIN_MENU);
+	    else if (x > right)
+		c = (code==FOR_PROMPT && y)
+		    ? END_KEY : LAC_TO_LKC0(LYK_VLINKS);
+	    else if (y)			/* Last row */
+		c = LAC_TO_LKC0(LYK_END);
+	    else			/* First row */
+		c = LAC_TO_LKC0(LYK_HOME);
+	} else {
+	    if (x < left + toolbar)
+		c = (code==FOR_PROMPT && y)
+		    ? LTARROW
+		    : (
+#ifdef USE_COLOR_STYLE
+			(s_forw_backw != NOSTYLE && x - toolbar >= 3)
+			? LAC_TO_LKC0(LYK_NEXT_DOC)
+			: LAC_TO_LKC0(LYK_PREV_DOC)
+#else
+			LAC_TO_LKC0(LYK_NEXT_DOC)
+#endif
+			);
+	    else if (x > right)
+		c = (code==FOR_PROMPT && y)
+		    ? RTARROW : LAC_TO_LKC0(LYK_HISTORY);
+	    else if (y)			/* Last row */
+		c = LAC_TO_LKC0(LYK_NEXT_PAGE);
+	    else			/* First row */
+		c = LAC_TO_LKC0(LYK_PREV_PAGE);
+	}
 #ifdef USE_SCROLLBAR
     } else if (x == LYcols - 1 && LYsb && LYsb_begin >= 0) {
 	int h = display_lines - 2*(LYsb_arrow != 0);
@@ -499,9 +528,9 @@ PRIVATE int set_clicked_link ARGS4(
 	if (mouse_link >= 0) {
 	    if (mouse_err == 0) {
 		if (c == -1)
-		    c = lookup_keymap(LYK_ACTIVATE);
+		    c = LAC_TO_LKC0(LYK_ACTIVATE);
 	    } else if (mouse_err >= 0)
-		c = lookup_keymap(LYK_CHANGE_LINK);
+		c = LAC_TO_LKC0(LYK_CHANGE_LINK);
 	}
     }
     return c;
@@ -1213,18 +1242,16 @@ PRIVATE int read_keymap_file NOARGS
     char *line = NULL;
     FILE *fp;
     char file[LY_MAXPATH];
-    int ret;
     int linenum;
     size_t n;
 
     LYAddPathToHome(file, sizeof(file), FNAME_LYNX_KEYMAPS);
 
-    if ((fp = fopen (file, "r")) == 0)
+    if ((fp = fopen (file, TXT_R)) == 0)
 	return 0;
 
     linenum = 0;
-    ret = 0;
-    while (LYSafeGets(&line, fp) != 0 && (ret == 0)) {
+    while (LYSafeGets(&line, fp) != 0) {
 	char *s = LYSkipBlanks(line);
 
 	linenum++;
@@ -1234,23 +1261,15 @@ PRIVATE int read_keymap_file NOARGS
 
 	for (n = 0; n < TABLESIZE(table); n++) {
 	    size_t len = strlen(table[n].name);
-	    if (strlen(s) > len
-	     && !strncmp(s, table[n].name, len)) {
-		if ((*(table[n].func))(LYSkipBlanks(s+len)) < 0) {
-		    ret = -1;
-		    break;
-		}
-	    }
+
+	    if ( strlen(s) > len && !strncmp(s, table[n].name, len)
+		 && (*(table[n].func))(LYSkipBlanks(s+len)) < 0 )
+		fprintf (stderr, FAILED_READING_KEYMAP, linenum, file);
 	}
     }
     FREE(line);
-
     LYCloseInput (fp);
-
-    if (ret == -1)
-	fprintf (stderr, FAILED_READING_KEYMAP, linenum, file);
-
-    return ret;
+    return 0;
 }
 
 PRIVATE void setup_vtXXX_keymap NOARGS
@@ -1547,9 +1566,11 @@ re_read:
 #endif /* !USE_SLANG */
 #if !defined(USE_SLANG) || defined(VMS) || defined(DJGPP_KEYHANDLER)
     c = GetChar();
+    lynx_nl2crlf(FALSE);
 #else
     if (LYCursesON) {
 	c = GetChar();
+	lynx_nl2crlf(FALSE);
     } else {
 	c = getchar();
 	if (c == EOF && errno == EINTR) /* Ctrl-Z causes EINTR in getchar() */
@@ -1595,7 +1616,7 @@ re_read:
 	    if (new_fd >= 0) {
 		FILE *frp;
 		close(new_fd);
-		freopen(term_name, "r", stdin);
+		freopen(term_name, TXT_R, stdin);
 		CTRACE((tfp,
 		"nozap: freopen(%s,\"r\",stdin) returned %p, stdin is now %p with fd %d.\n",
 			term_name, frp, stdin, fileno(stdin)));
@@ -2077,23 +2098,7 @@ re_read:
 		    c = set_clicked_link(event.x, event.y, code, 1);
 		} else if (event.bstate & BUTTON1_DOUBLE_CLICKED) {
 		    c = set_clicked_link(event.x, event.y, code, 2);
-		    if (c == PGDOWN)
-			c = END_KEY;
-		    else if (c == PGUP)
-			c = HOME;
-		    else if (c == REMOVE_KEY)
-			c = END_KEY;
-		    else if (c == INSERT_KEY)
-			c = HOME;
-		    else if (c == RTARROW)
-			c = END_KEY;
-		    else if (c == LTARROW && code == FOR_PROMPT)
-			c = HOME;
-		    else if (c == LTARROW)
-			c = LYReverseKeymap(LYK_MAIN_MENU);
-		    else if (c == '\b' && (code == FOR_PANEL || code == FOR_INPUT))
-			c = LAC_TO_LKC0(LYK_VLINKS);
-		    else if (c == LAC_TO_LKC0(LYK_SUBMIT) && code == FOR_INPUT)
+		    if (c == LAC_TO_LKC0(LYK_SUBMIT) && code == FOR_INPUT)
 			lac = LYK_SUBMIT;
 		} else if (event.bstate & BUTTON3_CLICKED) {
 		    c = LAC_TO_LKC0(LYK_PREV_DOC);
@@ -2110,7 +2115,7 @@ re_read:
 		    int atlink;
 
 		    c = set_clicked_link(event.x, event.y, code, 1);
-		    atlink = (c == LYReverseKeymap(LYK_ACTIVATE));
+		    atlink = (c == LAC_TO_LKC0(LYK_ACTIVATE));
 		    if (!atlink)
 			mouse_link = -1; /* Forget about approx stuff. */
 
@@ -2695,7 +2700,8 @@ PUBLIC int LYEditInsert ARGS5(
     if (map < 0)
 	map = map_active;
     if (map && LYCharSet_UC[current_char_set].enc == UCT_ENC_UTF8) {
-	unsigned char *e = s + len, *t = Buf + Pos;
+	int off = Pos;
+	unsigned char *e = s + len;
 	char *tail = 0;
 
 	while (s < e) {
@@ -2712,30 +2718,30 @@ PUBLIC int LYEditInsert ARGS5(
 			remains -= l - 1;
 			if (remains < 0) {
 			    if (tail)
-				strcpy(t, tail);
+				strcpy(Buf + off, tail);
 			    FREE(tail);
-			    len = (char*)t - Buf;
+			    len = off;
 			    overflow = 1;
 			    goto finish;
 			}
 			if (l > 1 && !tail)
-			    StrAllocCopy((char*)tail, Buf + Pos + len);
+			    StrAllocCopy(tail, Buf + Pos + len);
 		    } else
 			utfbuf[0] = '?';
 		} else
 		    utfbuf[0] = UCH(ucode);
 	    }
-	    strncpy(t, utfbuf, l);
+	    strncpy(Buf + off, utfbuf, l);
 	    edited = 1;
-	    t += l;
+	    off += l;
 	    s++;
 	}
 	if (tail)
-	    strcpy(t, tail);
-	len = (char*)t - (Buf + Pos);
+	    strcpy(Buf + off, tail);
+	len = off - Pos;
 	FREE(tail);
     } else if (map) {
-	unsigned char *e = s + len, *t = Buf + Pos;
+	unsigned char *e = s + len, *t = (unsigned char *)Buf + Pos;
 
 	while (s < e) {
 	    int ch;
@@ -3556,7 +3562,7 @@ PRIVATE char **sortedList ARGS2(
     unsigned count = HTList_count(list);
     unsigned j = 0;
     unsigned k, jk;
-    char **result = calloc(count + 1, sizeof(char *));
+    char **result = typecallocn(char *, count + 1);
 
     if (result == 0)
 	outofmem(__FILE__, "sortedList");
@@ -3695,7 +3701,7 @@ PUBLIC int LYhandlePopupList ARGS9(
 	BOOLEAN,	numbered)
 {
     int c = 0, cmd = 0, i = 0, j = 0, rel = 0;
-    int orig_choice = cur_choice;
+    int orig_choice;
     WINDOW * form_window;
     int num_choices = 0;
     int max_choices = 0;
@@ -3719,6 +3725,10 @@ PUBLIC int LYhandlePopupList ARGS9(
     char *popup_status_msg = NULL;
     CONST char **Cptr = NULL;
 
+    orig_choice = cur_choice;
+    if (cur_choice < 0)
+	cur_choice = 0;
+
     /*
      * Initialize the search string buffer. - FM
      */
@@ -5341,7 +5351,7 @@ PUBLIC char * SNACopy ARGS3(
 {
     FREE(*dest);
     if (src) {
-	*dest = (char *)calloc(1, n + 1);
+	*dest = typecallocn(char, n + 1);
 	if (*dest == NULL) {
 	    CTRACE((tfp, "Tried to calloc %d bytes\n", n));
 	    outofmem(__FILE__, "SNACopy");
@@ -5369,7 +5379,7 @@ PUBLIC char * SNACat ARGS3(
 	    strncpy(*dest + length, src, n);
 	    *(*dest + length + n) = '\0'; /* terminate */
 	} else {
-	    *dest = (char *)calloc(1, n + 1);
+	    *dest = typecallocn(char, n + 1);
 	    if (*dest == NULL)
 		outofmem(__FILE__, "SNACat");
 	    memcpy(*dest, src, n);
@@ -5692,7 +5702,7 @@ PUBLIC BOOL LYHaveCmdScript NOARGS
 PUBLIC void LYOpenCmdScript NOARGS
 {
     if (lynx_cmd_script != 0) {
-	cmd_script = fopen(lynx_cmd_script, "r");
+	cmd_script = fopen(lynx_cmd_script, TXT_R);
 	CTRACE((tfp, "LYOpenCmdScript(%s) %s\n",
 		lynx_cmd_script,
 		cmd_script != 0 ? "SUCCESS" : "FAIL"));
diff --git a/src/LYStrings.h b/src/LYStrings.h
index 3c1f0898..af6e4fb2 100644
--- a/src/LYStrings.h
+++ b/src/LYStrings.h
@@ -139,10 +139,10 @@ extern void base64_encode PARAMS((char * dest, char * src, int len));
       have to be changed/reviewed, AS WELL AS the lineedit binding
       tables in LYEditmap.c !
     - KEYMAP_SIZE, defined in LYKeymap.h, may need to be changed !
-    - See also table funckey[] in LYKeymap.c for 'pretty' strings
+    - See also table named_keys[] in LYKeymap.c for 'pretty' strings
       for the keys with codes >= 256 (to appear on the 'K'eymap page).
       New keycodes should probably be assigned consecutively, so their
-      key names can be easily added to funckey[] (but see next point).
+      key names can be easily added to named_keys[] (but see next point).
       They should also be documented in lynx.cfg.
     - The DOS port uses its own native codes for some keys, unless
       they are remapped by the code in LYgetch().  See *.key files
diff --git a/src/LYStructs.h b/src/LYStructs.h
index 2471c59c..90020afd 100644
--- a/src/LYStructs.h
+++ b/src/LYStructs.h
@@ -80,14 +80,15 @@ typedef struct _VisitedLink {
 extern histstruct history[MAXHIST];
 extern int nhist;
 
-typedef struct _lynx_html_item_type {
-    struct _lynx_html_item_type *next;  /* the next item in the linked list */
+typedef struct _lynx_list_item_type {
+    struct _lynx_list_item_type *next;  /* the next item in the linked list */
     char *name; 			/* a description of the item */
     char *command;			/* the command to execute */
     int  always_enabled;		/* a constant to tell whether or
 					* not to disable the printer
 					* when the no_print option is on
 					*/
+    /* HTML lists: */
     BOOL override_primary_action;	/* whether primary action will be
 					* overridden by this - e.g. this allows
 					* invoking user's MUA when mailto: link
@@ -95,32 +96,23 @@ typedef struct _lynx_html_item_type {
 					* command. This field is only examined
 					* by code that handles EXTERNAL command.
 					*/
-} lynx_html_item_type;
+    /* PRINTER lists: */
+    int pagelen;			/* an integer to store the printer's
+					* page length
+					*/
+} lynx_list_item_type;
 
-/* for printer commands */
-typedef struct _lynx_printer_item_type {
-    struct _lynx_printer_item_type *next; /* next item in the linked list */
-    char *name; 			  /* a description of the item	  */
-    char *command;			  /* the command to execute	  */
-    int  always_enabled;		  /* a constant to tell whether or
-					   * not to disable the printer
-					   * when the no_print option is on
-					   */
-    int pagelen;			  /* an integer to store the printer's
-					   * page length
-					   */
-} lynx_printer_item_type;
-extern lynx_printer_item_type *printers;
+extern lynx_list_item_type *printers;
 
 /* for download commands */
-extern lynx_html_item_type *downloaders;
+extern lynx_list_item_type *downloaders;
 
 /* for upload commands */
-extern lynx_html_item_type *uploaders;
+extern lynx_list_item_type *uploaders;
 
 #ifdef USE_EXTERNALS
 /* for external commands */
-extern lynx_html_item_type *externals;
+extern lynx_list_item_type *externals;
 #endif
 
 #endif /* LYSTRUCTS_H */
diff --git a/src/LYStyle.c b/src/LYStyle.c
index b2b40e69..6477b42f 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,6 +1,6 @@
 /* character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
- * @Id: LYStyle.c 1.43 Mon, 26 Feb 2001 18:41:57 -0800 dickey @
+ * @Id: LYStyle.c 1.44 Sun, 01 Apr 2001 17:51:46 -0700 dickey @
  */
 #include <HTUtils.h>
 #include <HTML.h>
@@ -58,6 +58,7 @@ PUBLIC int s_aedit_sel		= NOSTYLE;
 PUBLIC int s_alert		= NOSTYLE;
 PUBLIC int s_alink		= NOSTYLE;
 PUBLIC int s_curedit		= NOSTYLE;
+PUBLIC int s_forw_backw		= NOSTYLE;
 PUBLIC int s_normal		= NOSTYLE;
 PUBLIC int s_prompt_edit	= NOSTYLE;
 PUBLIC int s_prompt_edit_arr	= NOSTYLE;
@@ -207,6 +208,7 @@ PRIVATE void parse_style ARGS1(char*,buffer)
 	{ "edit.prompt.arrow",	DSTYLE_ELEMENTS,	&s_prompt_edit_arr },
 	{ "edit.prompt.marked",	DSTYLE_ELEMENTS,	&s_prompt_sel },
 	{ "edit.prompt",	DSTYLE_ELEMENTS,	&s_prompt_edit },
+	{ "forwbackw.arrow",	DSTYLE_ELEMENTS,	&s_forw_backw },
     };
     unsigned n;
     BOOL found = FALSE;
@@ -434,24 +436,24 @@ PUBLIC void style_deleteStyleList NOARGS
     lss_styles = NULL;
 }
 
-PRIVATE int style_readFromFileREC ARGS2(char*, file, int, toplevel)
+PRIVATE int style_readFromFileREC ARGS2(
+    char *,	lss_filename,
+    char *,	parent_filename)
 {
     FILE *fh;
     char *buffer = NULL;
     int len;
 
-    CTRACE2(TRACE_STYLE, (tfp, "CSS:Reading styles from file: %s\n", file ? file : "?!? empty ?!?"));
-    if (file == NULL || *file == '\0')
+    CTRACE2(TRACE_STYLE, (tfp, "CSS:Reading styles from file: %s\n", lss_filename ? lss_filename : "?!? empty ?!?"));
+    if (lss_filename == NULL || *lss_filename == '\0')
 	return -1;
-    fh = fopen(file, TXT_R);
-    if (!fh)
-    {
+    if ((fh = LYOpenCFG(lss_filename, parent_filename, LYNX_LSS_FILE)) == 0) {
 	/* this should probably be an alert or something */
-	CTRACE2(TRACE_STYLE, (tfp, "CSS:Can't open style file '%s', using defaults\n", file));
+	CTRACE2(TRACE_STYLE, (tfp, "CSS:Can't open style file '%s', using defaults\n", lss_filename));
 	return -1;
     }
 
-    if (toplevel) {
+    if (parent_filename == 0) {
 	style_initialiseHashTable();
 	style_deleteStyleList();
     }
@@ -461,20 +463,20 @@ PRIVATE int style_readFromFileREC ARGS2(char*, file, int, toplevel)
 	LYTrimTail(buffer);
 	LYTrimHead(buffer);
 	if (!strncasecomp(buffer,"include:",8))
-	    style_readFromFileREC(buffer+8, 0);
+	    style_readFromFileREC(buffer+8, lss_filename);
 	else if (buffer[0] != '#' && (len = strlen(buffer)) > 0)
 	    HStyle_addStyle(buffer);
     }
 
     LYCloseInput (fh);
-    if (toplevel && LYCursesON)
+    if ((parent_filename == 0) && LYCursesON)
 	parse_userstyles();
     return 0;
 }
 
-PUBLIC int style_readFromFile ARGS1(char*, file)
+PUBLIC int style_readFromFile ARGS1(char*, filename)
 {
-    return style_readFromFileREC(file, 1);
+    return style_readFromFileREC(filename, (char *)0);
 }
 
 /* Used in HTStructured methods: - kw */
diff --git a/src/LYUpload.c b/src/LYUpload.c
index 63ab40d4..a78018fa 100644
--- a/src/LYUpload.c
+++ b/src/LYUpload.c
@@ -47,19 +47,19 @@ PUBLIC int LYUpload ARGS1(
     char *the_upload = 0;
     char tmpbuf[LY_MAXPATH];
     char *filename = NULL;
-    lynx_html_item_type *upload_command = 0;
+    lynx_list_item_type *upload_command = 0;
     char *the_command = 0;
 
     /*
      *	Use configured upload commands.
      */
-    if((directory = (char *)strstr(line, "TO=")) == NULL)
+    if((directory = strstr(line, "TO=")) == NULL)
 	goto failed;
     *(directory - 1) = '\0';
     /* go past "Directory=" */
     directory += 3;
 
-    if((method = (char *)strstr(line, "UPLOAD=")) == NULL)
+    if((method = strstr(line, "UPLOAD=")) == NULL)
 	goto failed;
     /*
      *	Go past "Method=".
@@ -180,7 +180,7 @@ PUBLIC int LYUpload_options ARGS2(
 {
     static char tempfile[LY_MAXPATH];
     FILE *fp0;
-    lynx_html_item_type *cur_upload;
+    lynx_list_item_type *cur_upload;
     int count;
     static char curloc[LY_MAXPATH];
     char *cp;
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 5b754ddf..24494fc2 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -2514,7 +2514,7 @@ PUBLIC int HTCheckForInterrupt NOARGS
  * references a directory.
  */
 PUBLIC BOOLEAN LYisAbsPath ARGS1(
-	char *,		path)
+	CONST char *,	path)
 {
 #ifdef VMS
     return TRUE;
@@ -3231,7 +3231,7 @@ PUBLIC BOOLEAN LYCloseOutput ARGS1(
 PUBLIC BOOLEAN LYCanWriteFile ARGS1(
 	CONST char*,	filename)
 {
-    if (LYCloseOutput(fopen(filename, "w"))) {
+    if (LYCloseOutput(fopen(filename, TXT_W))) {
 	remove(filename);
 	return TRUE;
     } else {
@@ -3248,7 +3248,7 @@ PUBLIC BOOLEAN LYCanReadFile ARGS1(
 {
     FILE *fp;
 
-    if ((fp = fopen(filename, "r")) != 0) {
+    if ((fp = fopen(filename, TXT_R)) != 0) {
 	return LYCloseInput(fp);
     }
     return FALSE;
@@ -3293,7 +3293,7 @@ PUBLIC BOOLEAN inlocaldomain NOARGS
     if ((cp = ttyname(0)))
 	mytty = strrchr(cp, '/');
 
-    if (mytty && (fp = fopen(UTMP_FILE, "r")) != NULL) {
+    if (mytty && (fp = fopen(UTMP_FILE, TXT_R)) != NULL) {
 	mytty++;
 	do {
 	    n = fread((char *) &me, sizeof(struct utmp), 1, fp);
@@ -3506,6 +3506,15 @@ PUBLIC void size_change ARGS1(
 	recent_sizechange = TRUE;
 	CTRACE((tfp, "Window size changed from (%d,%d) to (%d,%d)\n",
 		old_lines, old_cols, LYlines, LYcols));
+#if defined(CAN_SWITCH_DISPLAY_CHARSET) && defined(CAN_AUTODETECT_DISPLAY_CHARSET)
+	/* May need to reload the font due to different char-box size */
+	if (current_char_set != auto_display_charset) {
+	    int old = current_char_set;
+
+	    Switch_Display_Charset(auto_display_charset, 1);
+	    Switch_Display_Charset(old, 1);
+	}
+#endif
     }
 #ifdef SIGWINCH
     LYExtSignal (SIGWINCH, size_change);
@@ -6388,6 +6397,7 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
 {
     FILE *fp = 0;
     struct stat data;
+    BOOLEAN binary = strchr(mode, 'b') != 0;
 
 #if defined(O_CREAT) && defined(O_EXCL) /* we have fcntl.h or kindred? */
     /*
@@ -6405,7 +6415,7 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
 	}
 	if (fd >= 0) {
 #if defined(O_BINARY) && defined(__CYGWIN__)
-	    if (mode[1] == 'b')
+	    if (binary)
 		setmode(fd, O_BINARY);
 #endif
 	    fp = fdopen(fd, mode);
@@ -6418,7 +6428,7 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
 	 && chmod(name, HIDE_CHMOD) == 0)
 	    fp = fopen(name, mode);
 	else if (lstat(name, &data) != 0)
-	    fp = OpenHiddenFile(name, "w");
+	    fp = OpenHiddenFile(name, binary ? BIN_W : TXT_W);
     /*
      * This is less stringent, but reasonably portable.  For new files, the
      * umask will suffice; however if the file already exists we'll change
@@ -6445,10 +6455,10 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
 PUBLIC FILE *LYNewBinFile ARGS1(char *, name)
 {
 #ifdef VMS
-    FILE *fp = fopen (name, "wb", "mbc=32");
+    FILE *fp = fopen (name, BIN_W, "mbc=32");
     chmod(name, HIDE_CHMOD);
 #else
-    FILE *fp = OpenHiddenFile(name, "wb");
+    FILE *fp = OpenHiddenFile(name, BIN_W);
 #endif
     return fp;
 }
@@ -6458,12 +6468,12 @@ PUBLIC FILE *LYNewTxtFile ARGS1(char *, name)
     FILE *fp;
 
 #ifdef VMS
-    fp = fopen (name, "w", "shr=get");
+    fp = fopen (name, TXT_W, "shr=get");
     chmod(name, HIDE_CHMOD);
 #else
     SetDefaultMode(O_TEXT);
 
-    fp = OpenHiddenFile(name, "w");
+    fp = OpenHiddenFile(name, TXT_W);
 
     SetDefaultMode(O_BINARY);
 #endif
@@ -6476,12 +6486,12 @@ PUBLIC FILE *LYAppendToTxtFile ARGS1(char *, name)
     FILE *fp;
 
 #ifdef VMS
-    fp = fopen (name, "a+", "shr=get");
+    fp = fopen (name, TXT_A, "shr=get");
     chmod(name, HIDE_CHMOD);
 #else
     SetDefaultMode(O_TEXT);
 
-    fp = OpenHiddenFile(name, "a+");
+    fp = OpenHiddenFile(name, TXT_A);
 
     SetDefaultMode(O_BINARY);
 #endif
@@ -7321,6 +7331,11 @@ PUBLIC void LYLocalFileToURL ARGS2(
 
     leaf = wwwName(source);
 
+    if (!LYisAbsPath(source)) {
+	char temp[LY_MAXPATH];
+	Current_Dir(temp);
+	StrAllocCat(*target, temp);
+    }
     if (!LYIsHtmlSep(*leaf))
 	LYAddHtmlSep(target);
     StrAllocCat(*target, leaf);
@@ -7529,8 +7544,8 @@ PUBLIC int LYCopyFile ARGS2(
     int len;
 
     code = EOF;
-    if ((fin = fopen(src, "rb")) != 0) {
-	if ((fout = fopen(dst, "wb")) != 0) {
+    if ((fin = fopen(src, BIN_R)) != 0) {
+	if ((fout = fopen(dst, BIN_W)) != 0) {
 	    code = 0;
 	    while ((len = fread(buff, 1, BUF_SIZE, fin)) > 0) {
 		fwrite(buff, 1, len, fout);
diff --git a/src/LYUtils.h b/src/LYUtils.h
index bc6ee44d..a9b990e5 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -75,7 +75,7 @@ extern BOOLEAN LYExpandHostForURL PARAMS((char **AllocatedString, char *prefix_l
 extern BOOLEAN LYFixCursesOnForAccess PARAMS((CONST char* addr, CONST char* physical));
 extern BOOLEAN LYPathOffHomeOK PARAMS((char *fbuffer, size_t fbuffer_size));
 extern BOOLEAN LYValidateFilename PARAMS((char * result, char * given));
-extern BOOLEAN LYisAbsPath PARAMS((char *path));
+extern BOOLEAN LYisAbsPath PARAMS((CONST char *path));
 extern BOOLEAN LYisLocalAlias PARAMS((char *filename));
 extern BOOLEAN LYisLocalFile PARAMS((char *filename));
 extern BOOLEAN LYisLocalHost PARAMS((char *filename));
@@ -312,4 +312,8 @@ extern void LYCloselog NOPARAMS;
 #define TXT_A	"a+"
 #endif
 
+#define BIN_R	"rb"
+#define BIN_W	"wb"
+#define BIN_A	"ab+"
+
 #endif /* LYUTILS_H */
diff --git a/src/TRSTable.c b/src/TRSTable.c
index 8b752135..cb3980dc 100644
--- a/src/TRSTable.c
+++ b/src/TRSTable.c
@@ -74,6 +74,12 @@ typedef struct _STable_cellinfo {
 				   or RESERVEDCELL */
 } STable_cellinfo;
 
+enum ended_state {
+	ROW_not_ended,
+	ROW_ended_by_endtr,
+	ROW_ended_by_splitline
+};
+
 typedef struct _STable_rowinfo {
     /* Each row may be displayed on many display lines, but we fix up
        positions of cells on this display line only: */
@@ -103,6 +109,7 @@ typedef struct _STable_rowinfo {
        reset to the line of icell_core.
      */
 	BOOL	fixed_line;	/* if we have a 'core' line of cells */
+	BOOL	ended;		/* if we saw </tr> */
 	int	allocated;	/* number of table cells allocated */
 	STable_cellinfo * cells;
 	short	alignment;	/* global align attribute for this row */
@@ -620,7 +627,7 @@ PRIVATE int Stbl_finishCellInRow ARGS5(
 		  cellstate_s(s->prev_state), cellstate_s(s->state)));
 
     if (multiline) {
-	if (!end_td) {			/* processing line-break */
+	if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK) {
 	    switch (s->state) {
 	    case CS_invalid:
 		newstate = empty ? CS_invalid : CS__cbc;
@@ -862,7 +869,7 @@ PRIVATE int Stbl_finishCellInRow ARGS5(
 	    }
 	}
     } else {				/* (!multiline) */
-	if (!end_td) {			/* processing line-break */
+	if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK) {
 	    switch (s->state) {
 	    case CS_invalid:
 	    case CS__0new:
@@ -1218,6 +1225,7 @@ PUBLIC int Stbl_addRowToTable ARGS3(
 	me->pending_colgroup_next = 0;
     }
     me->rows[me->nrows].Line = -1; /* not yet used */
+    me->rows[me->nrows].ended = ROW_not_ended; /* No </tr> yet */
     return (me->nrows - 1);
 }
 
@@ -1236,6 +1244,7 @@ PRIVATE int Stbl_finishRowInTable ARGS1(
 	return -1;		/* no row started! */
     lastrow = me->rows + (me->nrows - 1);
     ncells = lastrow->ncells;
+    lastrow->ended = ROW_ended_by_endtr;
     if (lastrow->ncells > 0) {
 	if (s->pending_len > 0)
 	    lastrow->cells[lastrow->ncells - 1].len = s->pending_len;
@@ -1366,7 +1375,7 @@ PRIVATE int Stbl_fakeFinishCellInTable ARGS4(
 	int cs = lastrow->cells[lastrow->ncells - 1].colspan;
 	int rs = 1;			/* XXXX How to find rowspan? */
 	int ih = 0;			/* XXXX How to find is_header? */
-	int end_td = 1;
+	int end_td = (TRST_ENDCELL_ENDTD | TRST_FAKING_CELLS);
 	int need_reserved = 0;
 	int prev_reserved_last = -1;
 	STable_rowinfo *prev_row;
@@ -1421,6 +1430,7 @@ PRIVATE int Stbl_fakeFinishCellInTable ARGS4(
 					   (me->allocated_rows + 1)
 					   * sizeof(STable_rowinfo));
 	    int need_cells = prev_reserved_last + 1;
+	    int n;
 
 	    if (!rows)
 		return -1; /* ignore silently, no free memory, may be recoverable */
@@ -1433,8 +1443,8 @@ PRIVATE int Stbl_fakeFinishCellInTable ARGS4(
 	    me->allocated_rows++;
 
 	    /* Insert a duplicate row after lastrow */
-	    memmove(lastrow+1, lastrow,
-		    sizeof(STable_rowinfo)*(me->allocated_rows - me->nrows));
+	    for (n = me->allocated_rows - me->nrows - 1; n >= 0; --n)
+		lastrow[n + 1] = lastrow[n];
 
 	    /* Ignore cells, they belong to the next row now */
 	    lastrow->allocated = 0;
@@ -1515,7 +1525,9 @@ PUBLIC int Stbl_addCellToTable ARGS7(
     if (!me->rows || !me->nrows)
 	return -1;		/* no row started! */
 				/* ##850_fail_if_fail?? */
-    Stbl_finishCellInTable(me, YES, lineno, pos);
+    if (me->rows[me->nrows - 1].ended)
+	Stbl_addRowToTable(me, alignment, lineno);
+    Stbl_finishCellInTable(me, TRST_ENDCELL_ENDTD, lineno, pos);
     lastrow = me->rows + (me->nrows - 1);
 
 #ifdef EXP_NESTED_TABLES
@@ -1650,12 +1662,14 @@ PUBLIC int Stbl_finishCellInTable ARGS4(
     icell = lastrow->ncells - 1;
     if (icell < 0)
 	return icell;
-    if (s->x_td == -1)
-	return end_td ? -1 : 0;
+    if (s->x_td == -1) {	/* Stray </TD> or safety-call */
+	if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK)
+	    lastrow->ended = ROW_ended_by_splitline;
+	return 0;
+    }
 
 #ifdef EXP_NESTED_TABLES
-    /* This check for pos saves us from infinite recursion... */
-    if (!NO_AGGRESSIVE_NEWROW && pos) {
+    if (!NO_AGGRESSIVE_NEWROW && !(end_td & TRST_FAKING_CELLS)) {
 	int rc = Stbl_fakeFinishCellInTable(me, lastrow, lineno, 1);
 
 	if (rc) {
@@ -1670,7 +1684,7 @@ PUBLIC int Stbl_finishCellInTable ARGS4(
     if (len == -1)
 	return len;
     xlen = (len > 0) ? len : s->pending_len; /* ##890 use xlen if fixed_line?: */
-    if (lastrow->fixed_line && lastrow->Line == lineno)
+    if (lastrow->Line == lineno)
 	len = xlen;
     if (lastrow->cells[icell].colspan > 1) {
 	/*
@@ -1758,7 +1772,12 @@ PUBLIC int Stbl_finishCellInTable ARGS4(
     }
 #endif
 
-#ifndef EXP_NESTED_TABLES /* maxlen may already include contribution of a cell in this column */
+    if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK)
+	lastrow->ended = ROW_ended_by_splitline;
+#ifdef EXP_NESTED_TABLES /* maxlen may already include contribution of a cell in this column */
+    if (me->maxlen > MAX_STBL_POS)
+	return -1;
+#else
     if (me->maxlen + (xlen - len) > MAX_STBL_POS)
 	return -1;
 #endif
@@ -1996,6 +2015,16 @@ PUBLIC int Stbl_getStartLine ARGS1(
 
 #ifdef EXP_NESTED_TABLES
 
+PUBLIC int Stbl_getStartLineDeep ARGS1(
+    STable_info *,	me)
+{
+    if (!me)
+	return -1;
+    while (me->enclosing)
+	me = me->enclosing;
+    return me->startline;
+}
+
 PUBLIC void Stbl_update_enclosing ARGS3(
     STable_info *,	me,
     int,		max_width,
@@ -2009,7 +2038,7 @@ PUBLIC void Stbl_update_enclosing ARGS3(
 	    max_width, me->startline, last_lineno));
     for (l = me->startline; l <= last_lineno; l++) {
 	/* Fake <BR> in appropriate positions */
-	if (Stbl_finishCellInTable(me->enclosing, 0, l, max_width) < 0) {
+	if (Stbl_finishCellInTable(me->enclosing, TRST_ENDCELL_LINEBREAK, l, max_width) < 0) {
 	    /* It is not handy to let the caller delete me->enclosing,
 	       and it does not buy us anything.  Do it directly. */
 	    STable_info *stbl = me->enclosing;
diff --git a/src/TRSTable.h b/src/TRSTable.h
index 5eb48ce5..02463640 100644
--- a/src/TRSTable.h
+++ b/src/TRSTable.h
@@ -15,7 +15,13 @@ extern int Stbl_finishCellInTable PARAMS((STable_info *, BOOL, int, int));
 extern int Stbl_addColInfo PARAMS((STable_info *, int, short, BOOL));
 extern int Stbl_finishColGroup PARAMS((STable_info *));
 extern int Stbl_addRowGroup PARAMS((STable_info *, short));
-#define Stbl_lineBreak(stbl,l,pos) Stbl_finishCellInTable(stbl, NO, l, pos)
+
+#define TRST_ENDCELL_ENDTD	1
+#define TRST_ENDCELL_LINEBREAK	0
+#define TRST_ENDCELL_MASK	1
+#define TRST_FAKING_CELLS	2
+#define Stbl_lineBreak(stbl,l,pos) Stbl_finishCellInTable(stbl, TRST_ENDCELL_LINEBREAK, l, pos)
+
 extern int Stbl_getStartLine PARAMS((STable_info *));
 extern int Stbl_getFixupPositions PARAMS((
     STable_info *	me,
@@ -35,6 +41,9 @@ extern void Stbl_set_enclosing PARAMS(( STable_info *me,
 					struct _TextAnchor *last_anchor));
 extern STable_info * Stbl_get_enclosing PARAMS((STable_info *	me));
 extern struct _TextAnchor * Stbl_get_last_anchor_before PARAMS((STable_info *	me));
+extern int Stbl_getStartLineDeep PARAMS((STable_info *));
+#else
+#define Stbl_getStartLineDeep(t) Stbl_getStartLine(t)
 #endif
 
 #endif /* TRSTABLE_H */
diff --git a/src/UCAuto.c b/src/UCAuto.c
index e37944ff..fec1b052 100644
--- a/src/UCAuto.c
+++ b/src/UCAuto.c
@@ -210,10 +210,10 @@ PUBLIC void UCChangeTerminalCodepage ARGS2(
     } else if (lastcs < 0 && old_umap == 0 && old_font == 0) {
 	FILE * fp1;
 	FILE * fp2 = NULL;
-	if ((old_font = calloc(1, LY_MAXPATH)))
-	    old_umap = calloc(1, LY_MAXPATH);
-	if ((fp1 = LYOpenTemp(old_font, ".fnt", "wb")))
-	    fp2 = LYOpenTemp(old_umap, ".uni", "wb");
+	if ((old_font = typecallocn(char, LY_MAXPATH)))
+	    old_umap = typecallocn(char, LY_MAXPATH);
+	if ((fp1 = LYOpenTemp(old_font, ".fnt", BIN_W)))
+	    fp2 = LYOpenTemp(old_umap, ".uni", BIN_W);
 	if (fp1 && fp2) {
 	    size_t nlen;
 	    char *rp;
@@ -543,7 +543,7 @@ PRIVATE int _Switch_Display_Charset ARGS2 (int, ord, int, really)
 {
     CONST char *name;
     unsigned short cp;
-    static int font_loaded_for = -1;
+    static int font_loaded_for = -1, old_h, old_w;
     int rc, ord1;
     UCHAR msgbuf[MAXPATHLEN + 80];
 
@@ -581,10 +581,7 @@ PRIVATE int _Switch_Display_Charset ARGS2 (int, ord, int, really)
     }
 
     /* Not a "prepared" codepage.  Need to load the user font. */
-    if (ord1 == font_loaded_for) {	/* The same as the previous font */
-	if ((rc = VioSetCp(0, -1, 0)))	/* -1: User font */
-	    goto err;
-    } else if (charsets_directory) {
+    if (charsets_directory) {
 	TIB *tib;			/* Can't load font in a windowed-VIO */
 	PIB *pib;
 	VIOFONTINFO f[2];
@@ -597,7 +594,8 @@ PRIVATE int _Switch_Display_Charset ARGS2 (int, ord, int, really)
 	long i, j;
 
 	/* 0 means a FS protected-mode session */
-	if (DosGetInfoBlocks(&tib, &pib) || pib->pib_ultype != 0) {
+	if ( font_loaded_for == -1		/* Did not try it yet */
+	     && (DosGetInfoBlocks(&tib, &pib) || pib->pib_ultype != 0) ) {
 	    ord = ord1 = auto_display_charset;
 	    goto retry;
 	}
@@ -619,9 +617,16 @@ PRIVATE int _Switch_Display_Charset ARGS2 (int, ord, int, really)
 	    ord = ord1 = auto_display_charset;
 	    goto retry;
 	}
+	if ( ord1 == font_loaded_for
+	     && old_h == font->cyCell && old_w == font->cxCell ) {
+	    /* The same as the previous font */
+	    if ((rc = VioSetCp(0, -1, 0)))	/* -1: User font */
+		goto err;
+	    goto report;
+	}
 	sprintf(fnamebuf, "%s/%dx%d/%s.fnt",
 		charsets_directory, font->cyCell, font->cxCell, name);
-	file = fopen(fnamebuf,"rb");
+	file = fopen(fnamebuf, BIN_R);
 	if (!file) {
 	    sprintf(msgbuf, "Can't open font file '%s'", fnamebuf);
 	    HTInfoMsg(msgbuf);
@@ -645,9 +650,12 @@ PRIVATE int _Switch_Display_Charset ARGS2 (int, ord, int, really)
 	    sprintf(msgbuf, "Can't set font: err=%#lx=%ld", rc, rc);
 	    HTInfoMsg(msgbuf);
 	    ord = ord1 = auto_display_charset;
+	    font_loaded_for = -1;
 	    goto retry;
 	}
 	font_loaded_for = ord1;
+	old_h = font->cyCell;
+	old_w = font->cxCell;
     }
   report:
     CTRACE((tfp, "Display font set to '%s'.\n", name));
diff --git a/src/Xsystem.c b/src/Xsystem.c
index 56cac70d..969f90d5 100644
--- a/src/Xsystem.c
+++ b/src/Xsystem.c
@@ -1,4 +1,4 @@
-/* @Id: Xsystem.c 1.9 Mon, 26 Feb 2001 18:41:57 -0800 dickey @
+/* @Id: Xsystem.c 1.10 Sun, 01 Apr 2001 17:51:46 -0700 dickey @
  *	like system("cmd") but return with exit code of "cmd"
  *	for Turbo-C/MS-C/LSI-C
  *  This code is in the public domain.
@@ -86,7 +86,7 @@ xmalloc(size_t n)
 {
     char *bp;
 
-    if ((bp = calloc(1, n)) == (char *) 0) {
+    if ((bp = typecallocn(char, n)) == 0) {
 	write(2, "xsystem: Out of memory.!\n", 25);
 	exit(1);
     }
diff --git a/src/chrtrans/makefile.in b/src/chrtrans/makefile.in
index 52cf5524..d399a0e5 100644
--- a/src/chrtrans/makefile.in
+++ b/src/chrtrans/makefile.in
@@ -29,6 +29,7 @@ SITE_DEFS	= # FIXME: set in parent makefile
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
+_O		= .o
 
 CPP_OPTS	= @DEFS@ @CPPFLAGS@ \
 		-I$(top_builddir) \
@@ -93,14 +94,14 @@ default: $(FONTMAP_INC)
 
 tables: $(TABLES)
 
-makeuctb$x: makeuctb.o
-	$(CC) $(CC_OPTS) $(LDFLAGS) -o $@ makeuctb.o $(INTLLIB) $(LIBS)
+makeuctb$x: makeuctb$(_O)
+	$(CC) $(CC_OPTS) $(LDFLAGS) -o $@ makeuctb$(_O) $(INTLLIB) $(LIBS)
 
-makeuctb.o: $(srcdir)/UCkd.h $(srcdir)/makeuctb.c
+makeuctb$(_O): $(srcdir)/UCkd.h $(srcdir)/makeuctb.c
 
-.SUFFIXES : .tbl .i
+.SUFFIXES : $(_O) .tbl .i
 
-.c.o:
+.c$(_O):
 @RULE_CC@
 	@ECHO_CC@$(CC) $(CC_OPTS) -c $(srcdir)/$*.c
 
@@ -155,7 +156,7 @@ utf8_uni.h:		$(srcdir)/utf8_uni.tbl		makeuctb$x
 viscii_uni.h:		$(srcdir)/viscii_uni.tbl	makeuctb$x
 
 clean:
-	rm -f makeuctb$x *.o *uni.h *uni2.h
+	rm -f makeuctb$x *$(_O) *uni.h *uni2.h
 
 distclean: clean
 	-rm -rf obsolete
diff --git a/src/makefile.dos b/src/makefile.dos
index 7c29b2c2..880c151a 100644
--- a/src/makefile.dos
+++ b/src/makefile.dos
@@ -22,9 +22,7 @@ DIRED_DEFS = \
 
 # Use this option to enable optional and *experimental* color style.
 #ENABLE_COLOR_STYLE = \
- -DUSE_COLOR_STYLE \
- -DUSE_HASH \
- -DLINKEDSTYLES
+ -DUSE_COLOR_STYLE
 
 CC = gcc
 
diff --git a/src/makefile.in b/src/makefile.in
index f76c6bef..36bdb424 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -24,6 +24,7 @@ CFLAGS		= @CFLAGS@
 DEFS		= @DEFS@
 CHARSET_DEFS	= @CHARSET_DEFS@
 CPPFLAGS	= @CPPFLAGS@
+_O		= .o
 
 LIBS		= @LIBS@ $(RESOLVLIB) $(WAISLIB) $(SITE_LIBS)
 LDFLAGS		= @LDFLAGS@
@@ -58,24 +59,26 @@ LINTOPTS	=
 COMPRESS_PROG	=@COMPRESS_PROG@
 COMPRESS_EXT	=@COMPRESS_EXT@
 
-CHARTRANS_OBJS=UCdomap.o UCAux.o UCAuto.o
-OBJS=  LYClean.o LYShowInfo.o LYEdit.o LYStrings.o \
-LYMail.o HTAlert.o GridText.o LYGetFile.o \
-LYMain.o LYMainLoop.o LYCurses.o LYBookmark.o LYUtils.o \
-LYOptions.o LYReadCFG.o LYSearch.o LYHistory.o \
-LYForms.o LYPrint.o LYrcFile.o LYDownload.o LYNews.o LYKeymap.o \
-HTML.o HTFWriter.o HTInit.o DefaultStyle.o LYUpload.o \
-LYLeaks.o LYexit.o LYJump.o LYList.o LYCgi.o LYTraversal.o \
-LYEditmap.o LYCharSets.o LYCharUtils.o LYMap.o LYCookie.o \
-LYStyle.o LYHash.o LYPrettySrc.o TRSTable.o $(CHARTRANS_OBJS) @LIBOBJS@
-
-C_SRC	= $(OBJS:.o=.c)
+CHARTRANS_OBJS	= UCdomap$(_O) UCAux$(_O) UCAuto$(_O)
+OBJS	= \
+	LYClean$(_O) LYShowInfo$(_O) LYEdit$(_O) LYStrings$(_O) LYMail$(_O) \
+	HTAlert$(_O) GridText$(_O) LYGetFile$(_O) LYMain$(_O) LYMainLoop$(_O) \
+	LYCurses$(_O) LYBookmark$(_O) LYUtils$(_O) LYOptions$(_O) \
+	LYReadCFG$(_O) LYSearch$(_O) LYHistory$(_O) LYForms$(_O) LYPrint$(_O) \
+	LYrcFile$(_O) LYDownload$(_O) LYNews$(_O) LYKeymap$(_O) HTML$(_O) \
+	HTFWriter$(_O) HTInit$(_O) DefaultStyle$(_O) LYUpload$(_O) \
+	LYLeaks$(_O) LYexit$(_O) LYJump$(_O) LYList$(_O) LYCgi$(_O) \
+	LYTraversal$(_O) LYEditmap$(_O) LYCharSets$(_O) LYCharUtils$(_O) \
+	LYMap$(_O) LYCookie$(_O) LYStyle$(_O) LYHash$(_O) LYPrettySrc$(_O) \
+	TRSTable$(_O) $(CHARTRANS_OBJS) @LIBOBJS@
+
+C_SRC	= $(OBJS:$(_O)=.c)
 
 all: lynx$x
 
-.SUFFIXES : .i
+.SUFFIXES : $(_O) .i
 
-.c.o:
+.c$(_O):
 @RULE_CC@
 	@ECHO_CC@$(CC) $(CC_OPTS) -c $(srcdir)/$*.c
 
@@ -112,21 +115,21 @@ distclean: clean
 
 CMN=$(top_srcdir)/WWW/Library/Implementation/
 
-HTFWriter.o:	$(top_srcdir)/userdefs.h
-HTInit.o:	$(top_srcdir)/userdefs.h
-LYCharSets.o:	$(top_srcdir)/userdefs.h
-LYGetFile.o:	$(top_srcdir)/userdefs.h
-LYKeymap.o:	$(top_srcdir)/userdefs.h
-LYMail.o:	$(top_srcdir)/userdefs.h
-LYMain.o:	$(top_srcdir)/userdefs.h $(top_builddir)/lynx_cfg.h
-LYMainLoop.o:	$(top_srcdir)/userdefs.h
-LYOptions.o:	$(top_srcdir)/userdefs.h
-LYReadCFG.o:	$(top_srcdir)/userdefs.h
-LYShowInfo.o:	$(top_builddir)/cfg_defs.h
-LYTraversal.o:	$(top_srcdir)/userdefs.h
-LYUtils.o:	$(top_srcdir)/userdefs.h
-LYrcFile.o:	$(top_srcdir)/userdefs.h
-LYLeaks.o:	$(CMN)LYLeaks.h $(CMN)HTString.h
+HTFWriter$(_O):		$(top_srcdir)/userdefs.h
+HTInit$(_O):		$(top_srcdir)/userdefs.h
+LYCharSets$(_O):	$(top_srcdir)/userdefs.h
+LYGetFile$(_O):		$(top_srcdir)/userdefs.h
+LYKeymap$(_O):		$(top_srcdir)/userdefs.h
+LYMail$(_O):		$(top_srcdir)/userdefs.h
+LYMain$(_O):		$(top_srcdir)/userdefs.h $(top_builddir)/lynx_cfg.h
+LYMainLoop$(_O):	$(top_srcdir)/userdefs.h
+LYOptions$(_O):		$(top_srcdir)/userdefs.h
+LYReadCFG$(_O):		$(top_srcdir)/userdefs.h
+LYShowInfo$(_O):	$(top_builddir)/cfg_defs.h
+LYTraversal$(_O):	$(top_srcdir)/userdefs.h
+LYUtils$(_O):		$(top_srcdir)/userdefs.h
+LYrcFile$(_O):		$(top_srcdir)/userdefs.h
+LYLeaks$(_O):		$(CMN)LYLeaks.h $(CMN)HTString.h
 
 CHRTR= chrtrans/
 
@@ -173,14 +176,14 @@ TABLES= \
 $(TABLES):
 	-cd chrtrans && $(MAKE) tables
 
-UCdomap.o: UCdomap.c chrtrans/UCkd.h chrtrans/makeuctb$x chrtrans/makeuctb.c \
+UCdomap$(_O): UCdomap.c chrtrans/UCkd.h chrtrans/makeuctb$x chrtrans/makeuctb.c \
 	UCdomap.h $(CMN)UCMap.h $(TABLES) $(top_srcdir)/userdefs.h
 
 chrtrans/makeuctb$x:
 	cd chrtrans; make makeuctb$x
 
-UCAux.o : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h
-LYCookie.o: $(top_srcdir)/userdefs.h
+UCAux$(_O) : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h
+LYCookie$(_O): $(top_srcdir)/userdefs.h
 
 depend : $(TABLES)
 	makedepend -fmakefile -- $(CC_OPTS) -- $(C_SRC)
diff --git a/userdefs.h b/userdefs.h
index 9c3ace3e..fe822a70 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -1351,11 +1351,11 @@
  * the version definition with the Project Version on checkout.  Just
  * ignore it. - kw */
 /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.8.4dev.19"
+#define LYNX_VERSION "2.8.4dev.20"
 #define LYNX_WWW_HOME "http://lynx.browser.org/"
 #define LYNX_WWW_DIST "http://lynx.isc.org/current/"
 /* $Format: "#define LYNX_DATE \"$ProjectDate$\""$ */
-#define LYNX_DATE "Mon, 26 Feb 2001 18:41:57 -0800"
+#define LYNX_DATE "Sun, 01 Apr 2001 17:51:46 -0700"
 #define LYNX_DATE_OFF 5		/* truncate the automatically-generated date */
 #define LYNX_DATE_LEN 11	/* truncate the automatically-generated date */