about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES.new60
-rw-r--r--LYMessages_en.h11
-rw-r--r--WWW/Library/Implementation/HTAccess.c2
-rw-r--r--WWW/Library/Implementation/HTFile.c4
-rw-r--r--WWW/Library/Implementation/HTMIME.c6
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c5
-rw-r--r--WWW/Library/Implementation/HTPlain.c6
-rw-r--r--WWW/Library/Implementation/HTTP.c1045
-rw-r--r--WWW/Library/Implementation/SGML.c321
-rw-r--r--WWW/Library/Implementation/SGML.h4
-rw-r--r--WWW/Library/Implementation/UCAux.h22
-rw-r--r--aclocal.m42
-rw-r--r--docs/README.chartrans14
-rw-r--r--docs/win-386.announce28
-rw-r--r--lynx.cfg91
-rw-r--r--samples/lynx.cfg66
-rw-r--r--src/GridText.c92
-rw-r--r--src/HTFWriter.c29
-rw-r--r--src/HTML.c2745
-rw-r--r--src/HTML.h9
-rw-r--r--src/LYCharSets.c28
-rw-r--r--src/LYCharUtils.c2219
-rw-r--r--src/LYCharUtils.h6
-rw-r--r--src/LYClean.c19
-rw-r--r--src/LYCurses.c26
-rw-r--r--src/LYCurses.h4
-rw-r--r--src/LYGlobalDefs.h2
-rw-r--r--src/LYMain.c14
-rw-r--r--src/LYMainLoop.c23
-rw-r--r--src/LYPrint.c33
-rw-r--r--src/LYReadCFG.c9
-rw-r--r--src/LYStrings.c2
-rw-r--r--src/UCAux.c68
-rw-r--r--src/UCdomap.c147
-rw-r--r--src/chrtrans/README.format5
-rw-r--r--src/chrtrans/README.tables6
-rw-r--r--src/chrtrans/cp1253_uni.tbl3
-rw-r--r--src/chrtrans/cp1255_uni.tbl3
-rw-r--r--src/chrtrans/cp1256_uni.tbl3
-rw-r--r--src/chrtrans/cp437_uni.tbl7
-rw-r--r--src/chrtrans/cp737_uni.tbl3
-rw-r--r--src/chrtrans/cp775_uni.tbl3
-rw-r--r--src/chrtrans/cp850_uni.tbl7
-rw-r--r--src/chrtrans/cp852_uni.tbl7
-rw-r--r--src/chrtrans/cp862_uni.tbl2
-rw-r--r--src/chrtrans/cp864_uni.tbl2
-rw-r--r--src/chrtrans/cp869_uni.tbl2
-rw-r--r--src/chrtrans/def7_uni.tbl60
-rw-r--r--src/chrtrans/koi8r_uni.tbl8
-rw-r--r--src/chrtrans/mac_uni.tbl2
-rw-r--r--src/chrtrans/next_uni.tbl7
-rw-r--r--src/chrtrans/utf8_uni.tbl2
-rw-r--r--src/chrtrans/viscii_uni.tbl8
-rw-r--r--src/makefile.dos2
-rw-r--r--userdefs.h64
55 files changed, 3154 insertions, 4214 deletions
diff --git a/CHANGES.new b/CHANGES.new
index ca70566b..2b9c7d08 100644
--- a/CHANGES.new
+++ b/CHANGES.new
@@ -7,22 +7,66 @@ platforms see also INSTALLATION, for some changes for auto-configure and
 simple curses color see also README.configure).  Note that the 2.7 -> 2.7.1
 changes are included here. - KW]
 
+1998-02-13
+* use size_t in SGML_dtd. - TD
+* remove trademark symbol, unused quotes from chrtrans/*.tbl - LP
+* New item to lynx.cfg added:  PREPEND_CHARSET_TO_SOURSE (similar to BASE), we
+  need it to resolve charset for downloaded/printed html sourses which became
+  local.  This is really useful because downloaded and printed texts may
+  happend to have different charsets so assume_local_charset fails.  For
+  downloaded source meta charset added from HTTP charset header (if and only if
+  present).  For printed source meta charset added from display_charset (real
+  charset after chartrans).  If the original source have its own meta charset
+  and we add the second on top - Lynx currently use those on top and ignove
+  others (old) value (that is correct, although non standard like BASE on top). 
+  The compilation default is FALSE (compatibility).  - LP
+* modify ncurses mouse behavior to match slang (use button 3 rather than
+  button 2 for "previous document" (reported by Michael Ritzert) - TD
+* use case-independent comparison for tail-only comparison in override_proxy
+  (patch by pg@sweng.stortek.com) - TD
+* remove unneeded definitions of ALT_CHAR_SET, NCURSES_VERSION in
+  src/makefile.dos - DK
+* correct syntax for the RAW_DOS_KEY_HACK in lynx.cfg, add a little information
+  on how to compile this.  Also patched makefile.dos to make compilation of the
+  raw dos key hack the default when compiling in DOS. - DK
+* change back to boolean since the logic was unused: UCCanTranslateFromTo(),
+  UCCanTranslateUniTo(), and UCCanUniTranslateFrom(). - TD
+* Mods of SGML.c and LYCharUtils.c to improve handling of entities,
+  obsolete stuff removed (not all yet). - LP
+* -localhost mode: disable interpreting BASE HREF= if local_host_only
+  to resolve local html files with BASE (Lynx add base to downloaded
+  sources and this may affect links if looking them with -localhost).
+  (tweak in html.c). - LP
+* Modify HTMLGetEntityUCValue in LYCharSets.c:
+  we begin to move from old style entities[] to unicode-based. - LP
+* added a few comments. - LP
+1998-02-07
+* Fixed a bug in HTTP.c which could cause trashing of authorization info
+  for an origin http(s) server if the request is being proxied. - FM
+* Tweak in HTTP.c so that the reloading variable is not reset until
+  after any resubmissions due to authorization challenges. - FM
+* Tweaks of userdefs.h, lynx.cfg, LYMessages_en.h, LYMain.c, LYMainLoop.c,
+  LYClean.c, LYReadCFG.c, and LYGlobalDefs.h so that the QUIT_DEFAULT_YES
+  compilation symbol can be overridden in lynx.cfg, in keeping with
+  the principle that only strict security-related compilation symbols
+  cannot be overridden at run time. - FM
 1998-02-05
 * adjust formatting, comments & some messages in WWW files to simplify
   comparison with 2.7.2 version.  - TD
 * Update SGML entity to Unicode table in HTMLDTD.c from ftp.unicode.org -
-  lots of new entities, iso-latin-1 now included there (htmldtd.c).
+  lots of new entities, iso-latin-1 now included there.
   See also new files in test/ directory:  sgml.html and unicode.html.
-  Tweak a few typos in test/*.html according to sgml.html - LP
+  Tweak a few typos in test/*.html according to sgml.html.
+  Add a few new entries in def7_uni.tbl according to sgml.html - LP
 * Cleanup iso01-iso09, cp866 tables against ones found at ftp.unicode.org
-* Strip the fat from LYCharSets.c - unneccesary obsoleted tables removed
+* Strip the fat from LYCharSets.c - unnecessary obsoleted tables removed
   and redirected to SevenBitApproximation table (ones which have unicode tables
   override it anyway, those for CJK had exactly the same tables as
   SevenBit..). - LP
-* Remove obsoleted "Other ISO Latin" charset, which work *exactly*
-  the same as "7 bit approximation" (tweaks UCdefs.h and LYCharSet.c)
-  (See the note on 06-14-96 where it comes from). - LP
-* Tweaks UCdomap.c and LyCharSet.c according to 2.7.2 for 1997-10-15 - LP
+* Remove obsolete "Other ISO Latin" charset, which works _exactly_ the same
+  as "7 bit approximation" (See the note on 06-14-96 where it comes from).
+* Sort the list of charsets in Options according to 2.7.2 for 1997-10-15,
+  see the comments in UCinit at the bottom of UCDomap.c - LP
 * add ifdef to HTFile.c to workaround conflicting S_IFIFO vs S_IFSOCK
   (e.g., on apollo, from a report by Dave Eaton <dwe@arde.com>) - TD
 * updated INSTALLATION (patch by HN) - TD
@@ -780,7 +824,7 @@ from the lynx code.  I think the following patch does this.
   paranoid dbx. - KW
 * Try to more consistently remember the charset in effect for a document
   when going to SOURCE view, using new LYUC{Push,Pop}Assumed functions.
-  Note that this is only in effect immediately when swithching to SOURCE
+  Note that this is only in effect immediately when switching to SOURCE
   view; any later reloading while within SOURCE view (including those
   caused by RELOAD, RAW_TOGGLE and other keys, or by Options Screen changes)
   may still revert to the usual assumption about charset, which means a
diff --git a/LYMessages_en.h b/LYMessages_en.h
index 7fb82e4e..0ceb1273 100644
--- a/LYMessages_en.h
+++ b/LYMessages_en.h
@@ -21,17 +21,14 @@
  * the header inclusion statement in your userdefs.h to include
  * one of those with a different name.
  */
-#ifdef QUIT_DEFAULT_YES
-#define REALLY_QUIT "Are you sure you want to quit? [Y] "
+#define REALLY_QUIT_Y "Are you sure you want to quit? [Y] "
 #ifdef VMS
-#define REALLY_EXIT "Really exit from Lynx? [Y] "
+#define REALLY_EXIT_Y "Really exit from Lynx? [Y] "
 #endif /* VMS */
-#else
-#define REALLY_QUIT "Are you sure you want to quit? [N] "
+#define REALLY_QUIT_N "Are you sure you want to quit? [N] "
 #ifdef VMS
-#define REALLY_EXIT "Really exit from Lynx? [N] "
+#define REALLY_EXIT_N "Really exit from Lynx? [N] "
 #endif /* VMS */
-#endif /* QUIT_DEFAULT_YES */
 #define CANCELLED "Cancelled!!!"
 #define CANCELLING "Cancelling!"
 #define NO_CANCEL "Excellent!!!"
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index edb91b51..90b56d3b 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -311,7 +311,7 @@ PUBLIC BOOL override_proxy ARGS1(
 
 	if ((!templ_port || templ_port == port)  &&
 	    (t_len > 0	&&  t_len <= h_len  &&
-	     !strncmp(Host + h_len - t_len, no_proxy, t_len))) {
+             !strncasecomp(Host + h_len - t_len, no_proxy, t_len))) {
 	    FREE(host);
 	    return YES;
 	}
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 0b0a830c..5459cbf6 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -877,7 +877,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3(
 	*cp4 = '\0';
 	cp4 = cp3;
 	chndl = UCGetLYhndl_byMIME(cp3);
-	if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
+	if (UCCanTranslateFromTo(chndl, current_char_set)) {
 	    chartrans_ok = YES;
 	    *cp1 = '\0';
 	    format = HTAtom_for(cp);
@@ -890,7 +890,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3(
 	    **	Got something but we don't recognize it.
 	    */
 	    chndl = UCLYhndl_for_unrec;
-	    if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
+	    if (UCCanTranslateFromTo(chndl, current_char_set)) {
 		chartrans_ok = YES;
 		HTAnchor_setUCInfoStage(anchor, chndl,
 					UCT_STAGE_MIME,
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index f165a6a2..556459c5 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -378,7 +378,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 			    cp4 = cp3;
 			    chndl = UCGetLYhndl_byMIME(cp3);
 			    if (UCCanTranslateFromTo(chndl,
-						     current_char_set) != TQ_NO) {
+						     current_char_set)) {
 				chartrans_ok = YES;
 				*cp1 = '\0';
 				me->format = HTAtom_for(cp);
@@ -391,7 +391,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 						 recognize it */
 				chndl = UCLYhndl_for_unrec;
 				if (UCCanTranslateFromTo(chndl,
-							 current_char_set) != TQ_NO) {
+							 current_char_set)) {
 				    chartrans_ok = YES;
 				    *cp1 = '\0';
 				    me->format = HTAtom_for(cp);
@@ -2284,7 +2284,7 @@ PUBLIC void HTmmdecode ARGS2(
 			    *p = TOLOWER(*p);
 			invalid = ((LYhndl = UCGetLYhndl_byMIME(s+2)) < 0 ||
 				   UCCanTranslateFromTo(LYhndl,
-						 current_char_set) != TQ_NO);
+						 current_char_set));
 			*qm2 = '?';
 		    }
 		    if (!invalid) {
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 58326ed7..e0dbe2e8 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -1215,7 +1215,6 @@ static CONST UC_entity_info extra_entities[] = {
 /* {"smid",	0x????},  shortmid				 # ISOamsr */
 };
 
-
 /*		Attribute Lists
 **		---------------
 **
@@ -2662,9 +2661,9 @@ PUBLIC CONST SGML_dtd HTML_dtd = {
 	tags,
 	HTML_ELEMENTS,
 	entities,
-	sizeof(entities)/sizeof(char*),
+	sizeof(entities)/sizeof(entities[0]),
 	extra_entities,
-	sizeof(extra_entities)/sizeof(UC_entity_info),
+	sizeof(extra_entities)/sizeof(extra_entities[0])
 };
 
 /* This function fills the "tags" part of the HTML_dtd structure with
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index cc121ce6..73feeccc 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -153,7 +153,8 @@ PRIVATE void HTPlain_put_character ARGS2(
     } else if ((unsigned char)c > 160) {
 	if (!HTPassEightBitRaw &&
 	    current_char_set != 0) {
-	    int len, high, low, i, diff = 1;
+	    size_t len, high, low, i;
+	    int diff = 1;
 	    CONST char * name;
 	    UCode_t value = (UCode_t)((unsigned char)c - 160);
 
@@ -528,7 +529,8 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 		/*
 		**  Out of luck, so use the UHHH notation (ugh). - FM
 		*/
-		int len, high, low, i, diff=1;
+		size_t len, high, low, i;
+		int diff = 1;
 		CONST char * name;
 		int value = (int)(code - 160);
 
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 268cb4d0..d1354911 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -1,9 +1,9 @@
-/*	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
-**                   servers.
-** 28 Apr 1997  AJL,FM Do Proxy Authorisation.
+** 27 Jan 1994	PDM  Added Ari Luotonen's Fix for Reload when using proxy
+**		     servers.
+** 28 Apr 1997	AJL,FM Do Proxy Authorisation.
 */
 
 #include "HTUtils.h"
@@ -19,7 +19,7 @@
 
 #define INIT_LINE_SIZE		1024	/* Start with line buffer this big */
 #define LINE_EXTEND_THRESH	256	/* Minimum read size */
-#define VERSION_LENGTH 		20	/* for returned protocol version */
+#define VERSION_LENGTH		20	/* for returned protocol version */
 
 #include "HTParse.h"
 #include "HTTCP.h"
@@ -37,7 +37,7 @@
 
 /* #define TRACE 1 */
 
-struct _HTStream 
+struct _HTStream
 {
   HTStreamClass * isa;
 };
@@ -47,7 +47,7 @@ extern char * HTAppVersion;	/* Application version: please supply */
 extern char * personal_mail_address;	/* User's name/email address */
 extern char * LYUserAgent;	/* Lynx User-Agent string */
 extern BOOL LYNoRefererHeader;	/* Never send Referer header? */
-extern BOOL LYNoRefererForThis;	/* No Referer header for this URL? */
+extern BOOL LYNoRefererForThis; /* No Referer header for this URL? */
 extern BOOL LYNoFromHeader;	/* Never send From header? */
 extern BOOL LYSetCookies;	/* Act on Set-Cookie headers? */
 
@@ -59,9 +59,9 @@ PUBLIC BOOL redirect_post_content = FALSE;  /* Don't convert to GET? */
 
 extern char LYUserSpecifiedURL; /* Is the URL a goto? */
 
-extern BOOL keep_mime_headers;   /* Include mime headers and force source dump */
+extern BOOL keep_mime_headers;	 /* Include mime headers and force source dump */
 extern BOOL no_url_redirection;  /* Don't follow Location: URL for */
-extern char *http_error_file;    /* Store HTTP status code in this file */
+extern char *http_error_file;	 /* Store HTTP status code in this file */
 extern BOOL traversal;		 /* TRUE if we are doing a traversal */
 extern BOOL dump_output_immediately;  /* TRUE if no interactive user */
 
@@ -92,7 +92,7 @@ extern char * LYCookie PARAMS((
 **	arg	is the hypertext reference of the article to be loaded.
 **
 **  On exit,
-**	returns	>=0	If no error, a good socket number
+**	returns >=0	If no error, a good socket number
 **		<0	Error.
 **
 **	The socket must be closed by the caller after the document has been
@@ -100,23 +100,23 @@ extern char * LYCookie PARAMS((
 **
 */
 PRIVATE int HTLoadHTTP ARGS4 (
-	CONST char *, 		arg,
+	CONST char *,		arg,
 	HTParentAnchor *,	anAnchor,
 	HTFormat,		format_out,
 	HTStream*,		sink)
 {
   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? */
@@ -128,7 +128,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, rv;
   BOOL doing_redirect, already_retrying = FALSE, bad_location = FALSE;
@@ -187,16 +187,16 @@ try_again:
       **  Interrupt cleanly.
       */
       if (TRACE)
-          fprintf (stderr,
-                   "HTTP: Interrupted on connect; recovering cleanly.\n");
+	  fprintf (stderr,
+		   "HTTP: Interrupted on connect; recovering cleanly.\n");
       _HTProgress ("Connection interrupted.");
       status = HT_NOT_LOADED;
       goto done;
   }
   if (status < 0) {
-      if (TRACE) 
-          fprintf(stderr, 
-            "HTTP: Unable to connect to remote host for `%s' (errno = %d).\n",
+      if (TRACE)
+	  fprintf(stderr,
+	    "HTTP: Unable to connect to remote host for `%s' (errno = %d).\n",
 	    url, SOCKET_ERRNO);
       HTAlert("Unable to connect to remote host.");
       status = HT_NOT_LOADED;
@@ -210,25 +210,25 @@ try_again:
     char * p1 = (HTParse(url, "", PARSE_PATH|PARSE_PUNCTUATION));
 
     if (do_post) {
-        METHOD = "POST";
-        StrAllocCopy(command, "POST ");
+	METHOD = "POST";
+	StrAllocCopy(command, "POST ");
     } else if (do_head) {
-        METHOD = "HEAD";
-        StrAllocCopy(command, "HEAD ");
+	METHOD = "HEAD";
+	StrAllocCopy(command, "HEAD ");
     } else {
-        METHOD = "GET";
-        StrAllocCopy(command, "GET ");
+	METHOD = "GET";
+	StrAllocCopy(command, "GET ");
     }
 
     /*
-    **  If we are using a proxy gateway don't copy in the first slash
-    **  of say: /gopher://a;lkdjfl;ajdf;lkj/;aldk/adflj
-    **  so that just gopher://.... is sent.
+    **	If we are using a proxy gateway don't copy in the first slash
+    **	of say: /gopher://a;lkdjfl;ajdf;lkj/;aldk/adflj
+    **	so that just gopher://.... is sent.
     */
     if (using_proxy)
-        StrAllocCat(command, p1+1);
+	StrAllocCat(command, p1+1);
     else
-        StrAllocCat(command, p1);
+	StrAllocCat(command, p1);
     FREE(p1);
   }
   if (extensions) {
@@ -249,33 +249,33 @@ try_again:
       }
 
       if (!HTPresentations)
-          HTFormatInit();
+	  HTFormatInit();
       n = HTList_count(HTPresentations);
 
       first_Accept = TRUE;
       len = 0;
       for (i = 0; i < n; i++) {
-          HTPresentation *pres =
+	  HTPresentation *pres =
 			(HTPresentation *)HTList_objectAt(HTPresentations, i);
-          if (pres->rep_out == WWW_PRESENT) {
+	  if (pres->rep_out == WWW_PRESENT) {
 	      if (pres->rep != WWW_SOURCE &&
 		  strcasecomp(HTAtom_name(pres->rep), "www/mime") &&
 		  strcasecomp(HTAtom_name(pres->rep), "www/compressed") &&
 		  pres->quality <= 1.0 && pres->quality >= 0.0) {
 		  if (pres->quality < 1.0) {
 		      if (pres->maxbytes > 0) {
-		          sprintf(temp, ";q=%4.3f;mxb=%ld",
-			  		pres->quality, pres->maxbytes);
+			  sprintf(temp, ";q=%4.3f;mxb=%ld",
+					pres->quality, pres->maxbytes);
 		      } else {
-		          sprintf(temp, ";q=%4.3f", pres->quality);
+			  sprintf(temp, ";q=%4.3f", pres->quality);
 		      }
 		  } else if (pres->maxbytes > 0) {
 		      sprintf(temp, ";mxb=%ld", pres->maxbytes);
 		  } else {
 		      temp[0] = '\0';
 		  }
-                  sprintf(line, "%s%s%s",
-		  		(first_Accept ?
+		  sprintf(line, "%s%s%s",
+				(first_Accept ?
 				   "Accept: " : ", "),
 				HTAtom_name(pres->rep),
 				temp);
@@ -283,28 +283,28 @@ try_again:
 		  if (len > 252 && !first_Accept) {
 		      StrAllocCat(command, crlf);
 		      sprintf(line, "Accept: %s%s",
-		      		    HTAtom_name(pres->rep),
+				    HTAtom_name(pres->rep),
 				    temp);
 		      len = strlen(line);
 		  }
-                  StrAllocCat(command, line);
+		  StrAllocCat(command, line);
 		  first_Accept = FALSE;
 	      }
-          }
+	  }
       }
       sprintf(line, "%s*/*;q=0.01%c%c",
-      		    (first_Accept ?
+		    (first_Accept ?
 		       "Accept: " : ", "), CR, LF);
       StrAllocCat(command, line);
       first_Accept = FALSE;
       len = 0;
 
       sprintf(line, "Accept-Encoding: %s, %s%c%c",
-      		    "gzip", "compress", CR, LF);
+		    "gzip", "compress", CR, LF);
       StrAllocCat(command, line);
 
       if (language && *language) {
-          sprintf(line, "Accept-Language: %s%c%c", language, CR, LF);
+	  sprintf(line, "Accept-Language: %s%c%c", language, CR, LF);
 	  StrAllocCat(command, line);
       }
 
@@ -329,10 +329,10 @@ try_again:
       **  over 406 (Not Acceptable) replies. - FM
       */
       if (!do_post) {
-          sprintf(line, "Negotiate: trans%c%c", CR, LF);
-          StrAllocCat(command, line);
+	  sprintf(line, "Negotiate: trans%c%c", CR, LF);
+	  StrAllocCat(command, line);
       }
-      
+
       /*
       **  When reloading give no-cache pragma to proxy server to make
       **  it refresh its cache. -- Ari L. <luotonen@dxcern.cern.ch>
@@ -340,33 +340,32 @@ try_again:
       **  Also send it as a Cache-Control header for HTTP/1.1. - FM
       */
       if (reloading) {
-          sprintf(line, "Pragma: no-cache%c%c", CR, LF);
-          StrAllocCat(command, line);
-          sprintf(line, "Cache-Control: no-cache%c%c", CR, LF);
-          StrAllocCat(command, line);
+	  sprintf(line, "Pragma: no-cache%c%c", CR, LF);
+	  StrAllocCat(command, line);
+	  sprintf(line, "Cache-Control: no-cache%c%c", CR, LF);
+	  StrAllocCat(command, line);
       }
-      reloading = FALSE;           /* Now turn it off again if on */
 
       if (LYUserAgent && *LYUserAgent) {
-          sprintf(line, "User-Agent: %s%c%c", LYUserAgent, CR, LF);
+	  sprintf(line, "User-Agent: %s%c%c", LYUserAgent, CR, LF);
       } else {
-          sprintf(line, "User-Agent: %s/%s  libwww-FM/%s%c%c",
-                  HTAppName ? HTAppName : "unknown",
+	  sprintf(line, "User-Agent: %s/%s  libwww-FM/%s%c%c",
+		  HTAppName ? HTAppName : "unknown",
 		  HTAppVersion ? HTAppVersion : "0.0",
 		  HTLibraryVersion, CR, LF);
       }
       StrAllocCat(command, line);
 
       if (personal_mail_address && !LYNoFromHeader) {
-          sprintf(line, "From: %s%c%c", personal_mail_address, CR,LF);
-          StrAllocCat(command, line);
+	  sprintf(line, "From: %s%c%c", personal_mail_address, CR,LF);
+	  StrAllocCat(command, line);
       }
 
       if (!(LYUserSpecifiedURL ||
 	    LYNoRefererHeader || LYNoRefererForThis) &&
 	  strcmp(HTLoadedDocumentURL(), "")) {
 	  char *cp = HTLoadedDocumentURL();
-          StrAllocCat(command, "Referer: ");
+	  StrAllocCat(command, "Referer: ");
 	  if (!strncasecomp(cp, "LYNXIMGMAP:", 11)) {
 	      char *cp1 = strchr(cp, '#');
 	      if (cp1)
@@ -377,30 +376,30 @@ try_again:
 	  } else {
 	      StrAllocCat(command, cp);
 	  }
-          sprintf(line, "%c%c", CR, LF);
-          StrAllocCat(command, line);
+	  sprintf(line, "%c%c", CR, LF);
+	  StrAllocCat(command, line);
       }
 
       {
-        char *abspath;
+	char *abspath;
 	char *docname;
-        char *hostname;
-        char *colon;
-        int portnumber;
-        char *auth, *cookie = NULL;
+	char *hostname;
+	char *colon;
+	int portnumber;
+	char *auth, *cookie = NULL;
 	BOOL secure = (strncmp(anAnchor->address, "https", 5) ?
 							FALSE : TRUE);
 
-        abspath = HTParse(url, "", PARSE_PATH|PARSE_PUNCTUATION);
-	docname = HTParse(url, "", PARSE_PATH);
-        hostname = HTParse(url, "", PARSE_HOST);
-        if (hostname &&
-            NULL != (colon = strchr(hostname, ':'))) {
-            *(colon++) = '\0';	/* Chop off port number */
-            portnumber = atoi(colon);
-        } else if (!strncmp(url, "https", 5)) {
+	abspath = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION);
+	docname = HTParse(arg, "", PARSE_PATH);
+	hostname = HTParse(arg, "", PARSE_HOST);
+	if (hostname &&
+	    NULL != (colon = strchr(hostname, ':'))) {
+	    *(colon++) = '\0';	/* Chop off port number */
+	    portnumber = atoi(colon);
+	} else if (!strncmp(arg, "https", 5)) {
 	    portnumber = HTTPS_PORT;
-	} else  {
+	} else	{
 	    portnumber = HTTP_PORT;
 	}
 
@@ -410,10 +409,10 @@ try_again:
 	*/
 	if (using_proxy) {
 	    /*
-	    **  If we are using a proxy, first determine if
-	    **  we should include an Authorization header
-	    **  and/or Cookie header for the ultimate target
-	    **  of this request. - FM & AJL
+	    **	If we are using a proxy, first determine if
+	    **	we should include an Authorization header
+	    **	and/or Cookie header for the ultimate target
+	    **	of this request. - FM & AJL
 	    */
 	    char *host2 = NULL, *path2 = NULL;
 	    int port2 = (strncmp(docname, "https", 5) ?
@@ -429,8 +428,8 @@ try_again:
 		}
 	    }
 	    /*
-	    **  This composeAuth() does file access, i.e., for
-	    **  the ultimate target of the request. - AJL
+	    **	This composeAuth() does file access, i.e., for
+	    **	the ultimate target of the request. - AJL
 	    */
 	    auth_proxy = NO;
 	    if ((auth = HTAA_composeAuth(host2, port2, path2,
@@ -439,7 +438,7 @@ try_again:
 		/*
 		**  If auth is not NULL nor zero-length, it's
 		**  an Authorization header to be included. - FM
-		*/ 
+		*/
 		sprintf(line, "%s%c%c", auth, CR, LF);
 		StrAllocCat(command, line);
 		if (TRACE)
@@ -472,8 +471,8 @@ try_again:
 			    "HTTP: Not sending authorization (yet).\n");
 	    }
 	    /*
-	    **  Add 'Cookie:' header, if it's HTTP or HTTPS
-	    **  document being proxied.
+	    **	Add 'Cookie:' header, if it's HTTP or HTTPS
+	    **	document being proxied.
 	    */
 	    if (!strncmp(docname, "http", 4)) {
 		cookie = LYCookie(host2, path2, port2, secure);
@@ -481,12 +480,12 @@ try_again:
 	    FREE(host2);
 	    FREE(path2);
 	    /*
-	    **  The next composeAuth() will be for the proxy. - AJL
+	    **	The next composeAuth() will be for the proxy. - AJL
 	    */
 	    auth_proxy = YES;
 	} else {
 	    /*
-	    **  Add cookie for a non-proxied request. - FM
+	    **	Add cookie for a non-proxied request. - FM
 	    */
 	    cookie = LYCookie(hostname, abspath, portnumber, secure);
 	    auth_proxy = NO;
@@ -496,27 +495,27 @@ try_again:
 	*/
 	if (cookie != NULL) {
 	    if (*cookie != '$') {
-	        /*
+		/*
 		**  It's a historical cookie, so signal to the
 		**  server that we support modern cookies. - FM
 		*/
 		StrAllocCat(command, "Cookie2: $Version=\"1\"");
 		StrAllocCat(command, crlf);
-	        if (TRACE)
-	            fprintf(stderr,
+		if (TRACE)
+		    fprintf(stderr,
 			    "HTTP: Sending Cookie2: $Version =\"1\"\n");
 	    }
 	    if (*cookie != '\0') {
-	        /*
+		/*
 		**  It's not a zero-length string, so add the header.
 		**  Note that any folding of long strings has been
 		**  done already in LYCookie.c. - FM
 		*/
-	        StrAllocCat(command, "Cookie: ");
-	        StrAllocCat(command, cookie);
+		StrAllocCat(command, "Cookie: ");
+		StrAllocCat(command, cookie);
 		StrAllocCat(command, crlf);
-	        if (TRACE)
-	            fprintf(stderr, "HTTP: Sending Cookie: %s\n", cookie);
+		if (TRACE)
+		    fprintf(stderr, "HTTP: Sending Cookie: %s\n", cookie);
 	    }
 	    FREE(cookie);
 	}
@@ -529,39 +528,39 @@ try_again:
 	**  still be NO, and we check here for whether we want an
 	**  Authorization header. - FM & AJL
 	*/
-        if ((auth = HTAA_composeAuth(hostname,
+	if ((auth = HTAA_composeAuth(hostname,
 				     portnumber,
 				     docname,
 				     auth_proxy)) != NULL &&
 	    *auth != '\0') {
 	    /*
-	    **  If auth is not NULL nor zero-length, it's
-	    **  an Authorization or Proxy-Authorization
-	    **  header to be included. - FM
-	    */ 
-            sprintf(line, "%s%c%c", auth, CR, LF);
-            StrAllocCat(command, line);
+	    **	If auth is not NULL nor zero-length, it's
+	    **	an Authorization or Proxy-Authorization
+	    **	header to be included. - FM
+	    */
+	    sprintf(line, "%s%c%c", auth, CR, LF);
+	    StrAllocCat(command, line);
 	    if (TRACE)
-                fprintf(stderr,
+		fprintf(stderr,
 			(auth_proxy ?
 			 "HTTP: Sending proxy authorization: %s\n" :
 			 "HTTP: Sending authorization: %s\n"),
 			auth);
 	} else if (auth && *auth == '\0') {
 	    /*
-	    **  If auth is a zero-length string, the user either
-	    **  cancelled or goofed at the username and password
-	    **  prompt. - FM
+	    **	If auth is a zero-length string, the user either
+	    **	cancelled or goofed at the username and password
+	    **	prompt. - FM
 	    */
 	    if (!(traversal || dump_output_immediately) &&
-	    	HTConfirm("Proceed without a username and password?")) {
+		HTConfirm("Proceed without a username and password?")) {
 		if (auth_proxy == TRUE) {
 		    show_407 = TRUE;
 		} else {
 		    show_401 = TRUE;
 		}
 	    } else {
-	        if (traversal || dump_output_immediately)
+		if (traversal || dump_output_immediately)
 		    HTAlert("Can't proceed without a username and password.");
 		FREE(command);
 		FREE(hostname);
@@ -569,15 +568,15 @@ try_again:
 		status = HT_NOT_LOADED;
 		goto done;
 	    }
-        } else {
+	} else {
 	    if (TRACE)
-                fprintf(stderr,
+		fprintf(stderr,
 			(auth_proxy ?
 			 "HTTP: Not sending proxy authorization (yet).\n" :
 			 "HTTP: Not sending authorization (yet).\n"));
-        }
-        FREE(hostname);
-        FREE(docname);
+	}
+	FREE(hostname);
+	FREE(docname);
       }
       auth_proxy = NO;
   }
@@ -585,22 +584,22 @@ try_again:
   if (do_post)
     {
       if (TRACE)
-          fprintf (stderr, "HTTP: Doing post, content-type '%s'\n",
-                   anAnchor->post_content_type ? anAnchor->post_content_type
-		   			       : "lose");
+	  fprintf (stderr, "HTTP: Doing post, content-type '%s'\n",
+		   anAnchor->post_content_type ? anAnchor->post_content_type
+					       : "lose");
       sprintf (line, "Content-type: %s%c%c",
-               anAnchor->post_content_type ? anAnchor->post_content_type 
+	       anAnchor->post_content_type ? anAnchor->post_content_type
 					   : "lose", CR, LF);
       StrAllocCat(command, line);
       {
-        int content_length;
-        if (!anAnchor->post_data)
-          content_length = 0;
-        else
-          content_length = strlen (anAnchor->post_data);
-        sprintf (line, "Content-length: %d%c%c",
-                 content_length, CR, LF);
-        StrAllocCat(command, line);
+	int content_length;
+	if (!anAnchor->post_data)
+	  content_length = 0;
+	else
+	  content_length = strlen (anAnchor->post_data);
+	sprintf (line, "Content-length: %d%c%c",
+		 content_length, CR, LF);
+	StrAllocCat(command, line);
       }
 
       StrAllocCat(command, crlf);	/* Blank line means "end" of headers */
@@ -610,9 +609,12 @@ try_again:
   else
       StrAllocCat(command, crlf);	/* Blank line means "end" of headers */
 
-  if (TRACE)
-      fprintf (stderr, "Writing:\n%s----------------------------------\n",
-               command);
+  if (TRACE) {
+      fprintf (stderr,
+	       "Writing:\n%s%s----------------------------------\n",
+	       command,
+	       (anAnchor->post_data ? crlf : ""));
+  }
 
   _HTProgress ("Sending HTTP request.");
 
@@ -620,33 +622,33 @@ try_again:
   FREE(command);
   if (status <= 0) {
       if (status == 0) {
-          if (TRACE)
-              fprintf (stderr, "HTTP: Got status 0 in initial write\n");
-          /* Do nothing. */
+	  if (TRACE)
+	      fprintf (stderr, "HTTP: Got status 0 in initial write\n");
+	  /* Do nothing. */
       } else if ((SOCKET_ERRNO == ENOTCONN ||
-      		  SOCKET_ERRNO == ECONNRESET ||
+		  SOCKET_ERRNO == ECONNRESET ||
 		  SOCKET_ERRNO == EPIPE) &&
 		 !already_retrying &&
 		 /* Don't retry if we're posting. */ !do_post) {
-            /*
-	    **  Arrrrgh, HTTP 0/1 compability problem, maybe.
+	    /*
+	    **	Arrrrgh, HTTP 0/1 compability problem, maybe.
 	    */
-            if (TRACE)
-                fprintf (stderr, 
-                 "HTTP: BONZO ON WRITE Trying again with HTTP0 request.\n");
-            _HTProgress ("Retrying as HTTP0 request.");
-            HTTP_NETCLOSE(s, handle);
-            extensions = NO;
-            already_retrying = TRUE;
-            goto try_again;
+	    if (TRACE)
+		fprintf (stderr,
+		 "HTTP: BONZO ON WRITE Trying again with HTTP0 request.\n");
+	    _HTProgress ("Retrying as HTTP0 request.");
+	    HTTP_NETCLOSE(s, handle);
+	    extensions = NO;
+	    already_retrying = TRUE;
+	    goto try_again;
       } else {
-          if (TRACE)
-              fprintf (stderr,
+	  if (TRACE)
+	      fprintf (stderr,
 	   "HTTP: Hit unexpected network WRITE error; aborting connection.\n");
-          HTTP_NETCLOSE(s, handle);
-          status = -1;
-          HTAlert("Unexpected network write error; connection aborted.");
-          goto done;
+	  HTTP_NETCLOSE(s, handle);
+	  status = -1;
+	  HTAlert("Unexpected network write error; connection aborted.");
+	  goto done;
       }
   }
 
@@ -665,102 +667,102 @@ try_again:
     line_buffer = (char *)calloc(1, (buffer_length * sizeof(char)));
 
     do {/* Loop to read in the first line */
-        /*
+	/*
 	**  Extend line buffer if necessary for those crazy WAIS URLs ;-)
 	*/
-        if (buffer_length - length < LINE_EXTEND_THRESH) {
-            buffer_length = buffer_length + buffer_length;
-            line_buffer = 
-              (char *)realloc(line_buffer, (buffer_length * sizeof(char)));
-        }
-        if (TRACE)
-            fprintf (stderr, "HTTP: Trying to read %d\n",
-                     buffer_length - length - 1);
-        status = HTTP_NETREAD(s, line_buffer + length,
-                              buffer_length - length - 1, handle);
-        if (TRACE)
-            fprintf (stderr, "HTTP: Read %d\n", status);
-        if (status <= 0) {
-            /*
-	     *  Retry if we get nothing back too.
-             *  Bomb out if we get nothing twice.
+	if (buffer_length - length < LINE_EXTEND_THRESH) {
+	    buffer_length = buffer_length + buffer_length;
+	    line_buffer =
+	      (char *)realloc(line_buffer, (buffer_length * sizeof(char)));
+	}
+	if (TRACE)
+	    fprintf (stderr, "HTTP: Trying to read %d\n",
+		     buffer_length - length - 1);
+	status = HTTP_NETREAD(s, line_buffer + length,
+			      buffer_length - length - 1, handle);
+	if (TRACE)
+	    fprintf (stderr, "HTTP: Read %d\n", status);
+	if (status <= 0) {
+	    /*
+	     *	Retry if we get nothing back too.
+	     *	Bomb out if we get nothing twice.
 	     */
-            if (status == HT_INTERRUPTED) {
-                if (TRACE)
-                    fprintf (stderr, "HTTP: Interrupted initial read.\n");
-                _HTProgress ("Connection interrupted.");
-                HTTP_NETCLOSE(s, handle);
+	    if (status == HT_INTERRUPTED) {
+		if (TRACE)
+		    fprintf (stderr, "HTTP: Interrupted initial read.\n");
+		_HTProgress ("Connection interrupted.");
+		HTTP_NETCLOSE(s, handle);
 		status = HT_NO_DATA;
-                goto clean_up;
-            } else if  (status < 0 &&
+		goto clean_up;
+	    } else if  (status < 0 &&
 			(SOCKET_ERRNO == ENOTCONN ||
-			 SOCKET_ERRNO == ECONNRESET || 
+			 SOCKET_ERRNO == ECONNRESET ||
 			 SOCKET_ERRNO == EPIPE) &&
 			!already_retrying && !do_post) {
-                /*
+		/*
 		**  Arrrrgh, HTTP 0/1 compability problem, maybe.
 		*/
-                if (TRACE)
-                    fprintf (stderr,
-		    	"HTTP: BONZO Trying again with HTTP0 request.\n");
-                HTTP_NETCLOSE(s, handle);
-                FREE(line_buffer);
-                FREE(line_kept_clean);
-
-                extensions = NO;
-                already_retrying = TRUE;
-                _HTProgress ("Retrying as HTTP0 request.");
-                goto try_again;
-            } else {
-                if (TRACE)
-                    fprintf (stderr,
+		if (TRACE)
+		    fprintf (stderr,
+			"HTTP: BONZO Trying again with HTTP0 request.\n");
+		HTTP_NETCLOSE(s, handle);
+		FREE(line_buffer);
+		FREE(line_kept_clean);
+
+		extensions = NO;
+		already_retrying = TRUE;
+		_HTProgress ("Retrying as HTTP0 request.");
+		goto try_again;
+	    } else {
+		if (TRACE)
+		    fprintf (stderr,
   "HTTP: Hit unexpected network read error; aborting connection; status %d.\n",
 			   status);
-                HTAlert("Unexpected network read error; connection aborted.");
-                HTTP_NETCLOSE(s, handle);
-                status = -1;
-                goto clean_up;
-            }
-        }
+		HTAlert("Unexpected network read error; connection aborted.");
+		HTTP_NETCLOSE(s, handle);
+		status = -1;
+		goto clean_up;
+	    }
+	}
 
-        bytes_already_read += status;
-        sprintf (line, "Read %d bytes of data.", bytes_already_read);
-        HTProgress (line);
+	bytes_already_read += status;
+	sprintf (line, "Read %d bytes of data.", bytes_already_read);
+	HTProgress (line);
 
 #ifdef UCX  /* UCX returns -1 on EOF */
-        if (status == 0 || status == -1) 
+	if (status == 0 || status == -1)
 #else
-        if (status == 0)
+	if (status == 0)
 #endif
-        {
-            end_of_file = YES;
-            break;
-        }
-        line_buffer[length+status] = 0;
-
-        if (line_buffer) {
-            FREE(line_kept_clean);
-            line_kept_clean = (char *)malloc(buffer_length * sizeof(char));
-            memcpy(line_kept_clean, line_buffer, buffer_length);
-        }
-
-        eol = strchr(line_buffer + length, LF);
-        /* Do we *really* want to do this? */
-        if (eol && eol != line_buffer && *(eol-1) == CR) 
-            *(eol-1) = ' '; 
-
-        length = length + status;
-
-        /* Do we really want to do *this*? */
-        if (eol) 
-            *eol = 0;		/* Terminate the line */
+	{
+	    end_of_file = YES;
+	    break;
+	}
+	line_buffer[length+status] = 0;
+
+	if (line_buffer) {
+	    FREE(line_kept_clean);
+	    line_kept_clean = (char *)malloc(buffer_length * sizeof(char));
+	    memcpy(line_kept_clean, line_buffer, buffer_length);
+	}
+
+	eol = strchr(line_buffer + length, LF);
+	/* Do we *really* want to do this? */
+	if (eol && eol != line_buffer && *(eol-1) == CR)
+	    *(eol-1) = ' ';
+
+	length = length + status;
+
+	/* Do we really want to do *this*? */
+	if (eol)
+	    *eol = 0;		/* Terminate the line */
     }
-    /*  All we need is the first line of the response.  If it's a HTTP/1.0
-    **  response, then the first line will be absurdly short and therefore
-    **  we can safely gate the number of bytes read through this code
-    **  (as opposed to below) to ~1000.
+    /*	All we need is the first line of the response.	If it's a HTTP/1.0
+    **	response, then the first line will be absurdly short and therefore
+    **	we can safely gate the number of bytes read through this code
+    **	(as opposed to below) to ~1000.
     **
-    **  Well, let's try 100.
+    **	Well, let's try 100.
     */
     while (!eol && !end_of_file && bytes_already_read < 100);
   } /* Scope of loop variables */
@@ -776,18 +778,18 @@ try_again:
   **  Kludge to work with old buggy servers and the VMS Help gateway.
   **  They can't handle the third word, so we try again without it.
   */
-  if (extensions &&       /* Old buggy server or Help gateway? */
+  if (extensions &&	  /* Old buggy server or Help gateway? */
       (0==strncmp(line_buffer,"<TITLE>Bad File Request</TITLE>",31) ||
        0==strncmp(line_buffer,"Address should begin with",25) ||
        0==strncmp(line_buffer,"<TITLE>Help ",12) ||
        0==strcmp(line_buffer,
-       		 "Document address invalid or access not authorised"))) {
+		 "Document address invalid or access not authorised"))) {
       FREE(line_buffer);
       FREE(line_kept_clean);
       extensions = NO;
       already_retrying = TRUE;
       if (TRACE)
-          fprintf(stderr, "HTTP: close socket %d to retry with HTTP0\n", s);
+	  fprintf(stderr, "HTTP: close socket %d to retry with HTTP0\n", s);
       HTTP_NETCLOSE(s, handle);
       /* print a progress message */
       _HTProgress ("Retrying as HTTP0 request.");
@@ -803,11 +805,11 @@ try_again:
     server_version[0] = 0;
 
     fields = sscanf(line_buffer, "%20s %d",
-                    server_version,
-                    &server_status);
+		    server_version,
+		    &server_status);
 
     if (TRACE)
-        fprintf (stderr, "HTTP: Scanned %d fields from line_buffer\n", fields);
+	fprintf (stderr, "HTTP: Scanned %d fields from line_buffer\n", fields);
 
     if (http_error_file) {     /* Make the status code externally available */
 	FILE *error_file;
@@ -828,35 +830,35 @@ try_again:
     }
 
     /*
-    **  Rule out a non-HTTP/1.n reply as best we can.
+    **	Rule out a non-HTTP/1.n reply as best we can.
     */
     if (fields < 2 || !server_version[0] || server_version[0] != 'H' ||
-        server_version[1] != 'T' || server_version[2] != 'T' ||
-        server_version[3] != 'P' || server_version[4] != '/' ||
-        server_version[6] != '.') {
+	server_version[1] != 'T' || server_version[2] != 'T' ||
+	server_version[3] != 'P' || server_version[4] != '/' ||
+	server_version[6] != '.') {
 	/*
 	 *  Ugh! An HTTP0 reply,
 	 */
-        HTAtom * encoding;
+	HTAtom * encoding;
 
-        if (TRACE)
-            fprintf (stderr, "--- Talking HTTP0.\n");
+	if (TRACE)
+	    fprintf (stderr, "--- Talking HTTP0.\n");
 
-        format_in = HTFileFormat(url, &encoding, NULL);
+	format_in = HTFileFormat(url, &encoding, NULL);
 	/*
 	**  Treat all plain text as HTML.
-        **  This sucks but its the only solution without
-        **  without looking at content.
-        */
-        if (!strncmp(HTAtom_name(format_in), "text/plain",10)) {
-            if (TRACE)
-                fprintf(stderr,
-                           "HTTP: format_in being changed to text/HTML\n");
-            format_in = WWW_HTML;
-        }
+	**  This sucks but its the only solution without
+	**  without looking at content.
+	*/
+	if (!strncmp(HTAtom_name(format_in), "text/plain",10)) {
+	    if (TRACE)
+		fprintf(stderr,
+			   "HTTP: format_in being changed to text/HTML\n");
+	    format_in = WWW_HTML;
+	}
 	if (!IsUnityEnc(encoding)) {
 	    /*
-	    **  Change the format to that for "www/compressed".
+	    **	Change the format to that for "www/compressed".
 	    */
 	    if (TRACE) {
 		fprintf(stderr,
@@ -872,25 +874,25 @@ try_again:
 	    }
 	}
 
-        start_of_data = line_kept_clean;
+	start_of_data = line_kept_clean;
     } else {
-        /*
+	/*
 	**  Set up to decode full HTTP/1.n response. - FM
 	*/
-        format_in = HTAtom_for("www/mime");
-        if (TRACE)
-            fprintf (stderr, "--- Talking HTTP1.\n");
+	format_in = HTAtom_for("www/mime");
+	if (TRACE)
+	    fprintf (stderr, "--- Talking HTTP1.\n");
 
-        /*
+	/*
 	**  We set start_of_data to "" when !eol here because there
-        **  will be a put_block done below; we do *not* use the value
-        **  of start_of_data (as a pointer) in the computation of
-        **  length (or anything else) when !eol.  Otherwise, set the
+	**  will be a put_block done below; we do *not* use the value
+	**  of start_of_data (as a pointer) in the computation of
+	**  length (or anything else) when !eol.  Otherwise, set the
 	**  value of length to what we have beyond eol (i.e., beyond
 	**  the status line). - FM
 	*/
-        start_of_data = eol ? eol + 1 : "";
-        length = eol ? length - (start_of_data - line_buffer) : 0;
+	start_of_data = eol ? eol + 1 : "";
+	length = eol ? length - (start_of_data - line_buffer) : 0;
 
 	/*
 	**  Trim trailing spaces in line_buffer so that we can use
@@ -902,74 +904,74 @@ try_again:
 	/*
 	**  Take appropriate actions based on the status. - FM
 	*/
-        switch (server_status/100) {
+	switch (server_status/100) {
 	  case 1:
 	    /*
-	    **  HTTP/1.1 Informational statuses.
-	    **  100 Continue.
-	    **  101 Switching Protocols.
-	    **  > 101 is unknown.
-	    **  We should never get these, and they have only
-	    **  the status line and possibly other headers,
-	    **  so we'll deal with them by showing the full
-	    **  header to the user as text/plain. - FM
+	    **	HTTP/1.1 Informational statuses.
+	    **	100 Continue.
+	    **	101 Switching Protocols.
+	    **	> 101 is unknown.
+	    **	We should never get these, and they have only
+	    **	the status line and possibly other headers,
+	    **	so we'll deal with them by showing the full
+	    **	header to the user as text/plain. - FM
 	    */
 	    HTAlert("Got unexpected Informational Status.");
 	    do_head = TRUE;
 	    break;
 
-          case 2:
+	  case 2:
 	    /*
-	    **  Good: Got MIME object! (Successful) - FM
+	    **	Good: Got MIME object! (Successful) - FM
 	    */
 	    if (do_head) {
-	        /*
+		/*
 		 *  If HEAD was requested, show headers (and possibly
 		 *  bogus body) for all 2xx status codes as text/plain - KW
 		 */
 		HTProgress(line_buffer);
-	        break;
+		break;
 	    }
 	    switch (server_status) {
 	      case 204:
-	        /*
+		/*
 		 *  No Content.
 		 */
-	        HTAlert(line_buffer);
-                HTTP_NETCLOSE(s, handle);
-	        status = HT_NO_DATA;
-	        goto clean_up;
+		HTAlert(line_buffer);
+		HTTP_NETCLOSE(s, handle);
+		status = HT_NO_DATA;
+		goto clean_up;
 		break;
 
 	      case 205:
-	        /*
+		/*
 		 *  Reset Content.  The server has fulfilled the
 		 *  request but nothing is returned and we should
 		 *  reset any form content.  We'll instruct the
 		 *  user to do that, and restore the current
 		 *  document. - FM
 		 */
-	        HTAlert("Request fulfilled.  Reset Content.");
-                HTTP_NETCLOSE(s, handle);
-	        status = HT_NO_DATA;
-	        goto clean_up;
+		HTAlert("Request fulfilled.  Reset Content.");
+		HTTP_NETCLOSE(s, handle);
+		status = HT_NO_DATA;
+		goto clean_up;
 		break;
 
 	      case 206:
-	        /*
+		/*
 		 *  Partial Content.  We didn't send a Range
-		 *  so something went wrong somewhere.  Show
+		 *  so something went wrong somewhere.	Show
 		 *  the status message and restore the current
 		 *  document. - FM
 		 */
-	        HTAlert(line_buffer);
-                HTTP_NETCLOSE(s, handle);
-	        status = HT_NO_DATA;
-	        goto clean_up;
+		HTAlert(line_buffer);
+		HTTP_NETCLOSE(s, handle);
+		status = HT_NO_DATA;
+		goto clean_up;
 		break;
 
 	      default:
-	        /*
+		/*
 		 *  200 OK.
 		 *  201 Created.
 		 *  202 Accepted.
@@ -979,33 +981,33 @@ try_again:
 		 */
 		HTProgress(line_buffer);
 	    } /* case 2 switch */
-            break;
+	    break;
 
-          case 3:
+	  case 3:
 	    /*
-	    **  Various forms of Redirection. - FM
-	    **  300 Multiple Choices.
-	    **  301 Moved Permanently.
-	    **  302 Found (temporary; we can, and do, use GET).
-	    **  303 See Other (temporary; always use GET).
-	    **  304 Not Modified.
-	    **  305 Use Proxy.
-	    **  306 Set Proxy.
-	    **  307 Temporary Redirect with method retained.
-	    **  > 308 is unknown.
+	    **	Various forms of Redirection. - FM
+	    **	300 Multiple Choices.
+	    **	301 Moved Permanently.
+	    **	302 Found (temporary; we can, and do, use GET).
+	    **	303 See Other (temporary; always use GET).
+	    **	304 Not Modified.
+	    **	305 Use Proxy.
+	    **	306 Set Proxy.
+	    **	307 Temporary Redirect with method retained.
+	    **	> 308 is unknown.
 	    */
 	    if (no_url_redirection || do_head || keep_mime_headers) {
-	        /*
+		/*
 		 *  If any of these flags are set, we do not redirect,
 		 *  but instead show what was returned to the user as
 		 *  text/plain. - FM
 		 */
 		HTProgress(line_buffer);
-	        break;
+		break;
 	    }
 
 	    if (server_status == 300) { /* Multiple Choices */
-	        /*
+		/*
 		 *  For client driven content negotiation.  The server
 		 *  should be sending some way for the user-agent to
 		 *  make a selection, so we'll show the user whatever
@@ -1025,9 +1027,9 @@ try_again:
 		if (!dump_output_immediately &&
 		    format_out == HTAtom_for("www/download")) {
 		    /*
-		     *  Convert a download request to
-		     *  a presentation request for
-		     *  interactive users. - FM
+		     *	Convert a download request to
+		     *	a presentation request for
+		     *	interactive users. - FM
 		     */
 		    format_out = WWW_PRESENT;
 		}
@@ -1035,21 +1037,21 @@ try_again:
 	    }
 
 	    if (server_status == 304) { /* Not Modified */
-	        /*
+		/*
 		 *  We didn't send an "If-Modified-Since" header,
 		 *  so this status is inappropriate.  We'll deal
 		 *  with it by showing the full header to the user
 		 *  as text/plain. - FM
 		 */
 		HTAlert("Got unexpected 304 Not Modified status.");
-	        do_head = TRUE;
+		do_head = TRUE;
 		break;
 	    }
 
 	    if (server_status == 305 ||
 		server_status == 306 ||
 		server_status > 307) {
-	        /*
+		/*
 		 *  Show user the content, if any, for 305, 306,
 		 *  or unknown status. - FM
 		 */
@@ -1062,44 +1064,44 @@ try_again:
 		if (!dump_output_immediately &&
 		    format_out == HTAtom_for("www/download")) {
 		    /*
-		     *  Convert a download request to
-		     *  a presentation request for
-		     *  interactive users. - FM
+		     *	Convert a download request to
+		     *	a presentation request for
+		     *	interactive users. - FM
 		     */
 		    format_out = WWW_PRESENT;
 		}
 		break;
 	    }
 
-            /*
-	     *  We do not load the file, but read the headers for
-	     *  the "Location:", check out that redirecting_url
-	     *  and if it's acceptible (e.g., not a telnet URL
-	     *  when we have that disabled), initiate a new fetch.
-	     *  If that's another redirecting_url, we'll repeat the
-	     *  checks, and fetch initiations if acceptible, until
-	     *  we reach the actual URL, or the redirection limit
-	     *  set in HTAccess.c is exceeded.  If the status was 301
-	     *  indicating that the relocation is permanent, we set
-	     *  the permanent_redirection flag to make it permanent
-	     *  for the current anchor tree (i.e., will persist until
-	     *  the tree is freed or the client exits).  If the
-	     *  redirection would include POST content, we seek
-	     *  confirmation from an interactive user, with option to
-	     *  use 303 for 301 (but not for 307), and otherwise refuse
-	     *  the redirection.  We also don't allow permanent
-	     *  redirection if we keep POST content.  If we don't find
-	     *  the Location header or it's value is zero-length, we
-	     *  display whatever the server returned, and the user
-	     *  should RELOAD that to try again, or make a selection
-	     *  from it if it contains links, or Left-Arrow to the
-	     *  previous document. - FM
+	    /*
+	     *	We do not load the file, but read the headers for
+	     *	the "Location:", check out that redirecting_url
+	     *	and if it's acceptible (e.g., not a telnet URL
+	     *	when we have that disabled), initiate a new fetch.
+	     *	If that's another redirecting_url, we'll repeat the
+	     *	checks, and fetch initiations if acceptible, until
+	     *	we reach the actual URL, or the redirection limit
+	     *	set in HTAccess.c is exceeded.	If the status was 301
+	     *	indicating that the relocation is permanent, we set
+	     *	the permanent_redirection flag to make it permanent
+	     *	for the current anchor tree (i.e., will persist until
+	     *	the tree is freed or the client exits).  If the
+	     *	redirection would include POST content, we seek
+	     *	confirmation from an interactive user, with option to
+	     *	use 303 for 301 (but not for 307), and otherwise refuse
+	     *	the redirection.  We also don't allow permanent
+	     *	redirection if we keep POST content.  If we don't find
+	     *	the Location header or it's value is zero-length, we
+	     *	display whatever the server returned, and the user
+	     *	should RELOAD that to try again, or make a selection
+	     *	from it if it contains links, or Left-Arrow to the
+	     *	previous document. - FM
 	     */
 	    {
 	      char *cp;
 
 	      if ((dump_output_immediately || traversal) &&
-	      	  do_post &&
+		  do_post &&
 		  server_status != 303 &&
 		  server_status != 302 &&
 		  server_status != 301) {
@@ -1123,35 +1125,35 @@ try_again:
 	      while ((status = HTTP_NETREAD(s, line_buffer,
 					    (INIT_LINE_SIZE - 1),
 					    handle)) > 0) {
-	          line_buffer[status] = '\0';
+		  line_buffer[status] = '\0';
 		  StrAllocCat(line_kept_clean, line_buffer);
 	      }
 	      HTTP_NETCLOSE(s, handle);
-              if (status == HT_INTERRUPTED) {
+	      if (status == HT_INTERRUPTED) {
 		  /*
 		   *  Impatient user. - FM
 		   */
-                  if (TRACE)
-                      fprintf (stderr, "HTTP: Interrupted followup read.\n");
-                  _HTProgress ("Connection interrupted.");
-                  status = HT_INTERRUPTED;
-                  goto clean_up;
-              }
+		  if (TRACE)
+		      fprintf (stderr, "HTTP: Interrupted followup read.\n");
+		  _HTProgress ("Connection interrupted.");
+		  status = HT_INTERRUPTED;
+		  goto clean_up;
+	      }
 	      doing_redirect = TRUE;
 	      if (server_status == 301) { /* Moved Permanently */
-	          HTProgress(line_buffer);
+		  HTProgress(line_buffer);
 		  if (do_post) {
-	              /*
+		      /*
 		       *  Don't make the redirection permanent
 		       *  if we have POST content. - FM
 		       */
 		      if (TRACE)
-		          fprintf(stderr,
+			  fprintf(stderr,
 	 "HTTP: Have POST content. Treating 301 (Permanent) as Temporary.\n");
 		      HTAlert(
 	 "Have POST content. Treating Permanent Redirection as Temporary.\n");
 		  } else {
-	              permanent_redirection = TRUE;
+		      permanent_redirection = TRUE;
 		  }
 	      }
 
@@ -1159,25 +1161,25 @@ try_again:
 	      **  Look for "Set-Cookie:" and "Set-Cookie2:" headers. - FM
 	      */
 	      if (LYSetCookies == TRUE) {
-	          char *value = NULL;
+		  char *value = NULL;
 		  char *SetCookie = NULL;
 		  char *SetCookie2 = NULL;
-	          cp = line_kept_clean;
+		  cp = line_kept_clean;
 		  while (*cp) {
 		      /*
 		      **  Assume a CRLF pair terminates
 		      **  the header section. - FM
 		      */
 		      if (*cp == CR) {
-		          if (*(cp+1) == LF &&
+			  if (*(cp+1) == LF &&
 			      *(cp+2) == CR && *(cp+3) == LF) {
 			      break;
-			  } 
+			  }
 		      }
 		      if (TOUPPER(*cp) != 'S') {
-		          cp++;
-		      } else if (!strncasecomp(cp, "Set-Cookie:", 11))  {
-		          char *cp1 = NULL, *cp2 = NULL;
+			  cp++;
+		      } else if (!strncasecomp(cp, "Set-Cookie:", 11))	{
+			  char *cp1 = NULL, *cp2 = NULL;
 			  cp += 11;
 Cookie_continuation:
 			  /*
@@ -1191,11 +1193,11 @@ Cookie_continuation:
 			  if (((cp1 = strchr(cp, LF)) != NULL) ||
 			      (cp2 = strchr(cp, CR)) != NULL) {
 			      if (*cp1) {
-			          *cp1 = '\0';
+				  *cp1 = '\0';
 				  if ((cp2 = strchr(cp, CR)) != NULL)
 				      *cp2 = '\0';
 			      } else {
-			          *cp2 = '\0';
+				  *cp2 = '\0';
 			      }
 			  }
 			  if (*cp == '\0') {
@@ -1246,7 +1248,7 @@ Cookie_continuation:
 			  }
 			  FREE(value);
 		      } else if (!strncasecomp(cp, "Set-Cookie2:", 12))  {
-		          char *cp1 = NULL, *cp2 = NULL;
+			  char *cp1 = NULL, *cp2 = NULL;
 			  cp += 12;
 Cookie2_continuation:
 			  /*
@@ -1260,11 +1262,11 @@ Cookie2_continuation:
 			  if (((cp1 = strchr(cp, LF)) != NULL) ||
 			      (cp2 = strchr(cp, CR)) != NULL) {
 			      if (*cp1) {
-			          *cp1 = '\0';
+				  *cp1 = '\0';
 				  if ((cp2 = strchr(cp, CR)) != NULL)
 				      *cp2 = '\0';
 			      } else {
-			          *cp2 = '\0';
+				  *cp2 = '\0';
 			      }
 			  }
 			  if (*cp == '\0') {
@@ -1273,7 +1275,7 @@ Cookie2_continuation:
 			      if (cp2)
 				  *cp2 = CR;
 			      if (value != NULL) {
-			          HTMIME_TrimDoubleQuotes(value);
+				  HTMIME_TrimDoubleQuotes(value);
 				  if (SetCookie2 == NULL) {
 				      StrAllocCopy(SetCookie2, value);
 				  } else {
@@ -1315,7 +1317,7 @@ Cookie2_continuation:
 			  }
 			  FREE(value);
 		      } else {
-		          cp++;
+			  cp++;
 		      }
 		  }
 		  FREE(value);
@@ -1331,25 +1333,25 @@ Cookie2_continuation:
 	       */
 	      cp = line_kept_clean;
 	      while (*cp) {
-	        if (TOUPPER(*cp) != 'L') {
+		if (TOUPPER(*cp) != 'L') {
 		    cp++;
-	        } else if (!strncasecomp(cp, "Location:", 9)) {
-	            char *cp1 = NULL, *cp2 = NULL;
-	            cp += 9;
+		} else if (!strncasecomp(cp, "Location:", 9)) {
+		    char *cp1 = NULL, *cp2 = NULL;
+		    cp += 9;
 		    /*
-		     *  Trim leading spaces. - FM
+		     *	Trim leading spaces. - FM
 		     */
 		    while (isspace((unsigned char)*cp))
-		        cp++;
+			cp++;
 		    /*
-		     *  Accept CRLF, LF, or CR as end of header. - FM
+		     *	Accept CRLF, LF, or CR as end of header. - FM
 		     */
 		    if (((cp1 = strchr(cp, LF)) != NULL) ||
-		        (cp2 = strchr(cp, CR)) != NULL) {
+			(cp2 = strchr(cp, CR)) != NULL) {
 			if (*cp1) {
 			    *cp1 = '\0';
 			    if ((cp2 = strchr(cp, CR)) != NULL)
-			        *cp2 = '\0';
+				*cp2 = '\0';
 			} else {
 			    *cp2 = '\0';
 			}
@@ -1361,17 +1363,17 @@ Cookie2_continuation:
 			HTMIME_TrimDoubleQuotes(redirecting_url);
 			if (*redirecting_url == '\0') {
 			    /*
-			     *  The "Location:" value is zero-length, and
-			     *  thus is probably something in the body, so
-			     *  we'll show the user what was returned. - FM
+			     *	The "Location:" value is zero-length, and
+			     *	thus is probably something in the body, so
+			     *	we'll show the user what was returned. - FM
 			     */
 			    if (TRACE)
-			        fprintf(stderr,
+				fprintf(stderr,
 					"HTTP: 'Location:' is zero-length!\n");
 			    if (cp1)
-			        *cp1 = LF;
+				*cp1 = LF;
 			    if (cp2)
-			        *cp2 = CR;
+				*cp2 = CR;
 			    bad_location = TRUE;
 			    FREE(redirecting_url);
 			    HTAlert(
@@ -1386,28 +1388,28 @@ Cookie2_continuation:
 			 *  seek the document at that Location. - FM
 			 */
 			HTProgress(line_buffer);
-                        if (TRACE)
-                            fprintf(stderr,
-			    	    "HTTP: Picked up location '%s'\n",
+			if (TRACE)
+			    fprintf(stderr,
+				    "HTTP: Picked up location '%s'\n",
 				    redirecting_url);
 			if (cp1)
-		            *cp1 = LF;
-		        if (cp2)
-		            *cp2 = CR;
+			    *cp1 = LF;
+			if (cp2)
+			    *cp2 = CR;
 			if (server_status == 305) { /* Use Proxy */
 			    /*
-			     *  Make sure the proxy field ends with
-			     *  a slash. - FM
+			     *	Make sure the proxy field ends with
+			     *	a slash. - FM
 			     */
 			    if (redirecting_url[strlen(redirecting_url)-1]
-			    	!= '/')
+				!= '/')
 				StrAllocCat(redirecting_url, "/");
 			    /*
-			     *  Append our URL. - FM
+			     *	Append our URL. - FM
 			     */
 			    StrAllocCat(redirecting_url, anAnchor->address);
 			    if (TRACE)
-			        fprintf(stderr,
+				fprintf(stderr,
 					"HTTP: Proxy URL is '%s'\n",
 					redirecting_url);
 			}
@@ -1415,13 +1417,13 @@ Cookie2_continuation:
 			    server_status == 303 ||
 			    server_status == 302) {
 			    /*
-			     *  We don't have POST content (nor support PUT
-			     *  or DELETE), or the status is "See Other"  or
-			     *  "General Redirection" and we can convert to
-			     *  GET, so go back and check out the new URL. - FM
+			     *	We don't have POST content (nor support PUT
+			     *	or DELETE), or the status is "See Other"  or
+			     *	"General Redirection" and we can convert to
+			     *	GET, so go back and check out the new URL. - FM
 			     */
-		            status = HT_REDIRECTING;
-		            goto clean_up;
+			    status = HT_REDIRECTING;
+			    goto clean_up;
 			}
 			/*
 			 *  Make sure the user wants to redirect
@@ -1430,41 +1432,41 @@ Cookie2_continuation:
 			switch (HTConfirmPostRedirect(redirecting_url,
 						      server_status)) {
 			    /*
-			     *  User failed to confirm.
-			     *  Abort the fetch.
+			     *	User failed to confirm.
+			     *	Abort the fetch.
 			     */
 			    case 0:
-			        doing_redirect = FALSE;
+				doing_redirect = FALSE;
 				FREE(redirecting_url);
 				status = HT_NO_DATA;
 				goto clean_up;
-				      
+
 			    /*
-			     *  User wants to treat as GET with no content.
-			     *  Go back to check out the URL.
+			     *	User wants to treat as GET with no content.
+			     *	Go back to check out the URL.
 			     */
 			    case 303:
 				status = HT_REDIRECTING;
 				goto clean_up;
 
 			    /*
-			     *  Set the flag to retain the POST
-			     *  content and go back to check out
-			     *  the URL. - FM
+			     *	Set the flag to retain the POST
+			     *	content and go back to check out
+			     *	the URL. - FM
 			     */
 			    default:
 				status = HT_REDIRECTING;
 				redirect_post_content = TRUE;
 				goto clean_up;
-  			}
+			}
 		    }
-	            break;
-	        } else {
+		    break;
+		} else {
 		    /*
-		     *  Keep looking for the Location header. - FM
+		     *	Keep looking for the Location header. - FM
 		     */
-	            cp++;
-	        }
+		    cp++;
+		}
 	      }
 
 	      /*
@@ -1472,8 +1474,8 @@ Cookie2_continuation:
 	       *  header, so we'll show the user what we got, if
 	       *  anything. - FM
 	       */
-              if (TRACE)
-                  fprintf (stderr, "HTTP: Failed to pick up location.\n");
+	      if (TRACE)
+		  fprintf (stderr, "HTTP: Failed to pick up location.\n");
 	      doing_redirect = FALSE;
 	      permanent_redirection = FALSE;
 	      start_of_data = line_kept_clean;
@@ -1499,13 +1501,13 @@ Cookie2_continuation:
 	      break;
 	   }
 
-          case 4:
+	  case 4:
 	    /*
-	    **  "I think I goofed!" (Client Error) - FM
+	    **	"I think I goofed!" (Client Error) - FM
 	    */
-            switch (server_status) {
-              case 401:  /* Unauthorized */
-	        /*
+	    switch (server_status) {
+	      case 401:  /* Unauthorized */
+		/*
 		 *  Authorization for orgin server required.
 		 *  If show_401 is set, proceed to showing the
 		 *  401 body.  Otherwise, if we can set up
@@ -1520,42 +1522,42 @@ Cookie2_continuation:
 		if (HTAA_shouldRetryWithAuth(start_of_data, length,
 					     (void *)handle, s, NO)) {
 
-                    HTTP_NETCLOSE(s, handle);
-                    if (dump_output_immediately && !authentication_info[0]) {
-                        fprintf(stderr,
-		      		"HTTP: Access authorization required.\n");
-                        fprintf(stderr,
-		      		"       Use the -auth=id:pw parameter.\n");
-                        status = HT_NO_DATA;
-                        goto clean_up;
-                    }
-
-                    if (TRACE) 
-                        fprintf(stderr, "%s %d %s\n",
-                              "HTTP: close socket", s,
-                              "to retry with Access Authorization");
-
-                    _HTProgress (
-		    	"Retrying with access authorization information.");
+		    HTTP_NETCLOSE(s, handle);
+		    if (dump_output_immediately && !authentication_info[0]) {
+			fprintf(stderr,
+				"HTTP: Access authorization required.\n");
+			fprintf(stderr,
+				"       Use the -auth=id:pw parameter.\n");
+			status = HT_NO_DATA;
+			goto clean_up;
+		    }
+
+		    if (TRACE)
+			fprintf(stderr, "%s %d %s\n",
+			      "HTTP: close socket", s,
+			      "to retry with Access Authorization");
+
+		    _HTProgress (
+			"Retrying with access authorization information.");
 		    FREE(line_buffer);
 		    FREE(line_kept_clean);
-                    goto try_again;
-                    break;
+		    goto try_again;
+		    break;
 		} else if (!(traversal || dump_output_immediately) &&
-		           HTConfirm("Show the 401 message body?")) {
+			   HTConfirm("Show the 401 message body?")) {
 		    break;
-                } else {
+		} else {
 		    if (traversal || dump_output_immediately)
-		        HTAlert(
+			HTAlert(
 	"Can't retry with authorization!  Contact the server's WebMaster.");
 		    HTTP_NETCLOSE(s, handle);
-                    status = -1;
-                    goto clean_up;
+		    status = -1;
+		    goto clean_up;
 		}
 		break;
 
 	      case 407:
-	        /*
+		/*
 		 *  Authorization for proxy server required.
 		 *  If we are not in fact using a proxy, or
 		 *  show_407 is set, proceed to showing the
@@ -1571,29 +1573,29 @@ Cookie2_continuation:
 		if (HTAA_shouldRetryWithAuth(start_of_data, length,
 					     (void *)handle, s, YES)) {
 
-                    HTTP_NETCLOSE(s, handle);
-                    if (dump_output_immediately && !proxyauth_info[0]) {
-                        fprintf(stderr,
-		      		"HTTP: Proxy authorization required.\n");
-                        fprintf(stderr,
-		      		"       Use the -pauth=id:pw parameter.\n");
-                        status = HT_NO_DATA;
-                        goto clean_up;
-                    }
-
-                    if (TRACE) 
-                        fprintf(stderr, "%s %d %s\n",
-                              "HTTP: close socket", s,
-                              "to retry with Proxy Authorization");
-
-                    _HTProgress (
-		    	"Retrying with proxy authorization information.");
+		    HTTP_NETCLOSE(s, handle);
+		    if (dump_output_immediately && !proxyauth_info[0]) {
+			fprintf(stderr,
+				"HTTP: Proxy authorization required.\n");
+			fprintf(stderr,
+				"       Use the -pauth=id:pw parameter.\n");
+			status = HT_NO_DATA;
+			goto clean_up;
+		    }
+
+		    if (TRACE)
+			fprintf(stderr, "%s %d %s\n",
+			      "HTTP: close socket", s,
+			      "to retry with Proxy Authorization");
+
+		    _HTProgress (
+			"Retrying with proxy authorization information.");
 		    FREE(line_buffer);
 		    FREE(line_kept_clean);
-                    goto try_again;
-                    break;
+		    goto try_again;
+		    break;
 		} else if (!(traversal || dump_output_immediately) &&
-		           HTConfirm("Show the 407 message body?")) {
+			   HTConfirm("Show the 407 message body?")) {
 		    if (!dump_output_immediately &&
 			format_out == HTAtom_for("www/download")) {
 			/*
@@ -1604,29 +1606,29 @@ Cookie2_continuation:
 			format_out = WWW_PRESENT;
 		    }
 		    break;
-                } else {
+		} else {
 		    if (traversal || dump_output_immediately)
-		        HTAlert(
+			HTAlert(
     "Can't retry with proxy authorization!  Contact the server's WebMaster.");
 		    HTTP_NETCLOSE(s, handle);
-                    status = -1;
-                    goto clean_up;
+		    status = -1;
+		    goto clean_up;
 		}
 		break;
 
 	      case 408:
-	        /*
+		/*
 		 *  Request Timeout.  Show the status message
 		 *  and restore the current document. - FM
 		 */
-	        HTAlert(line_buffer);
-                HTTP_NETCLOSE(s, handle);
-	        status = HT_NO_DATA;
-	        goto done;
+		HTAlert(line_buffer);
+		HTTP_NETCLOSE(s, handle);
+		status = HT_NO_DATA;
+		goto done;
 		break;
 
-              default:
-                /*
+	      default:
+		/*
 		 *  400 Bad Request.
 		 *  402 Payment Required.
 		 *  403 Forbidden.
@@ -1655,28 +1657,28 @@ Cookie2_continuation:
 		if (!dump_output_immediately &&
 		    format_out == HTAtom_for("www/download")) {
 		    /*
-		     *  Convert a download request to
-		     *  a presentation request for
-		     *  interactive users. - FM
+		     *	Convert a download request to
+		     *	a presentation request for
+		     *	interactive users. - FM
 		     */
 		    format_out = WWW_PRESENT;
 		}
-                break;
-            } /* case 4 switch */
-            break;
+		break;
+	    } /* case 4 switch */
+	    break;
 
-          case 5:
+	  case 5:
 	    /*
-	    **  "I think YOU goofed!" (server error)
-	    **  500 Internal Server Error
-	    **  501 Not Implemented
-	    **  502 Bad Gateway
-	    **  503 Service Unavailable
-	    **  504 Gateway Timeout
-	    **  505 HTTP Version Not Supported
-	    **  > 505 is unknown.
-	    **  Should always include a message, which
-	    **  we always should display. - FM
+	    **	"I think YOU goofed!" (server error)
+	    **	500 Internal Server Error
+	    **	501 Not Implemented
+	    **	502 Bad Gateway
+	    **	503 Service Unavailable
+	    **	504 Gateway Timeout
+	    **	505 HTTP Version Not Supported
+	    **	> 505 is unknown.
+	    **	Should always include a message, which
+	    **	we always should display. - FM
 	    */
 	    HTAlert(line_buffer);
 	    if (traversal) {
@@ -1693,15 +1695,15 @@ Cookie2_continuation:
 		 */
 		format_out = WWW_PRESENT;
 	    }
-            break;
+	    break;
 
-          default:
+	  default:
 	    /*
-	    **  Bad or unknown server_status number.
-	    **  Take a chance and hope there is
-	    **  something to display. - FM
+	    **	Bad or unknown server_status number.
+	    **	Take a chance and hope there is
+	    **	something to display. - FM
 	    */
-            HTAlert("Unknown status reply from server!");
+	    HTAlert("Unknown status reply from server!");
 	    HTAlert(line_buffer);
 	    if (traversal) {
 		HTTP_NETCLOSE(s, handle);
@@ -1717,10 +1719,10 @@ Cookie2_continuation:
 		 */
 		format_out = WWW_PRESENT;
 	    }
-            break;
-        } /* Switch on server_status/100 */
+	    break;
+	} /* Switch on server_status/100 */
 
-      }	/* Full HTTP reply */
+      } /* Full HTTP reply */
   } /* scope of fields */
 
   /*
@@ -1736,15 +1738,15 @@ Cookie2_continuation:
   }
 
   target = HTStreamStack(format_in,
-                         format_out,
-                         sink, anAnchor);
+			 format_out,
+			 sink, anAnchor);
 
   if (!target || target == NULL) {
       char buffer[1024];	/* @@@@@@@@ */
 
       HTTP_NETCLOSE(s, handle);
       sprintf(buffer, "Sorry, no known way of converting %s to %s.",
-              HTAtom_name(format_in), HTAtom_name(format_out));
+	      HTAtom_name(format_in), HTAtom_name(format_out));
       _HTProgress (buffer);
       status = -1;
       goto clean_up;
@@ -1770,31 +1772,31 @@ Cookie2_continuation:
       goto clean_up;
   }
 
-  if (rv == -2) { 
+  if (rv == -2) {
       /*
       **  Aw hell, a REAL error, maybe cuz it's a dumb HTTP0 server
       */
       (*target->isa->_abort)(target, NULL);
       HTTP_NETCLOSE(s, handle);
       if (!already_retrying && !do_post) {
-          if (TRACE)
-              fprintf (stderr, "HTTP: Trying again with HTTP0 request.\n");
-          /*
-          **  May as well consider it an interrupt -- right?
-          */
-          FREE(line_buffer);
-          FREE(line_kept_clean);
-          extensions = NO;
-          already_retrying = TRUE;
-          _HTProgress ("Retrying as HTTP0 request.");
-          goto try_again;
+	  if (TRACE)
+	      fprintf (stderr, "HTTP: Trying again with HTTP0 request.\n");
+	  /*
+	  **  May as well consider it an interrupt -- right?
+	  */
+	  FREE(line_buffer);
+	  FREE(line_kept_clean);
+	  extensions = NO;
+	  already_retrying = TRUE;
+	  _HTProgress ("Retrying as HTTP0 request.");
+	  goto try_again;
       } else {
-          status = HT_NOT_LOADED;
+	  status = HT_NOT_LOADED;
 	  goto clean_up;
       }
   }
 
-  /* 
+  /*
   **  Free if complete transmission (socket was closed before return).
   **  Close socket if partial transmission (was freed on abort).
   */
@@ -1811,9 +1813,9 @@ Cookie2_continuation:
       */
       /* Lou's old comment:  - FM */
       /* OK, now we've got the redirection URL temporarily stored
-         in external variable redirecting_url, exported from HTMIME.c,
-         since there's no straightforward way to do this in the library
-         currently.  Do the right thing. */
+	 in external variable redirecting_url, exported from HTMIME.c,
+	 since there's no straightforward way to do this in the library
+	 currently.  Do the right thing. */
       status = HT_REDIRECTING;
   } else {
       /*
@@ -1835,6 +1837,7 @@ done:
   */
   do_head = FALSE;
   do_post = FALSE;
+  reloading = FALSE;
   return status;
 }
 
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index fedd0f40..61f01f1c 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -5,7 +5,7 @@
 **	SGML file, create this object which is a parser. The object
 **	is (currently) created by being passed a DTD structure,
 **	and a target HTStructured oject at which to throw the parsed stuff.
-**	
+**
 **	 6 Feb 93  Binary seraches used. Intreface modified.
 */
 
@@ -37,7 +37,7 @@
 #define FREE(x) if (x) {free(x); x = NULL;}
 
 PUBLIC HTCJKlang HTCJK = NOCJK; 	/* CJK enum value.		*/
-PUBLIC BOOL HTPassEightBitRaw = FALSE;	/* Pass 161-172,174-255 raw.	*/ 
+PUBLIC BOOL HTPassEightBitRaw = FALSE;	/* Pass 161-172,174-255 raw.	*/
 PUBLIC BOOL HTPassEightBitNum = FALSE;	/* Pass ^ numeric entities raw. */
 PUBLIC BOOL HTPassHighCtrlRaw = FALSE;	/* Pass 127-160,173,&#127; raw. */
 PUBLIC BOOL HTPassHighCtrlNum = FALSE;	/* Pass &#128;-&#159; raw.	*/
@@ -52,7 +52,7 @@ extern int LYlowest_eightbit[];
 
 #define MAX_ATTRIBUTES 36	/* Max number of attributes per element */
 
-	
+
 /*		Element Stack
 **		-------------
 **	This allows us to return down the stack reselcting styles.
@@ -71,7 +71,7 @@ struct _HTElement {
 struct _HTStream {
 
     CONST HTStreamClass *	isa;		/* inherited from HTStream */
-    
+
     CONST SGML_dtd		*dtd;
     HTStructuredClass		*actions;	/* target class  */
     HTStructured		*target;	/* target object */
@@ -112,8 +112,8 @@ struct _HTStream {
     HTParentAnchor *		node_anchor;
     LYUCcharset *		inUCI;		/* pointer to anchor UCInfo */
     int 			inUCLYhndl;	/* charset we are fed	    */
-    LYUCcharset *		outUCI;		/* anchor UCInfo for target */
-    int				outUCLYhndl;	/* charset for target	    */
+    LYUCcharset *		outUCI; 	/* anchor UCInfo for target */
+    int 			outUCLYhndl;	/* charset for target	    */
     char			utf_count;
     UCode_t			utf_char;
     char			utf_buf[8];
@@ -144,13 +144,13 @@ PRIVATE void set_chartrans_handling ARGS3(
 	chndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_STRUCTURED);
 	if (chndl < 0)
 	    /*
-	    **  That wasn't set either, so seek the HText default. - FM
+	    **	That wasn't set either, so seek the HText default. - FM
 	    */
 	    chndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_HTEXT);
 	if (chndl < 0)
 	    /*
-	    **  That wasn't set either, so assume the current display
-	    **  character set. - FM
+	    **	That wasn't set either, so assume the current display
+	    **	character set. - FM
 	    */
 	    chndl = current_char_set;
 	/*
@@ -173,18 +173,18 @@ PRIVATE void set_chartrans_handling ARGS3(
 						      UCT_STAGE_STRUCTURED);
     }
     /*
-    **  Set the in->out transformation parameters. - FM
+    **	Set the in->out transformation parameters. - FM
     */
     UCSetTransParams(&context->T,
 		     context->inUCLYhndl, context->inUCI,
 		     context->outUCLYhndl, context->outUCI);
     /*
-    **  This is intended for passing the SGML parser's input
-    **  charset as an argument in each call to the HTML
-    **  parser's start tag function, but it would be better
-    **  to call a Lynx_HTML_parser function to set an element
-    **  in its HTStructured object, itself, if this were
-    **  needed. - FM
+    **	This is intended for passing the SGML parser's input
+    **	charset as an argument in each call to the HTML
+    **	parser's start tag function, but it would be better
+    **	to call a Lynx_HTML_parser function to set an element
+    **	in its HTStructured object, itself, if this were
+    **	needed. - FM
     */
     if (HTCJK != NOCJK) {
 	context->current_tag_charset = -1;
@@ -200,7 +200,7 @@ PRIVATE void set_chartrans_handling ARGS3(
 	context->current_tag_charset = UCGetLYhndl_byMIME("unicode-1-1-utf-8");
     } else {
 	context->current_tag_charset = 0;
-    }	
+    }
 }
 
 PRIVATE void change_chartrans_handling ARGS1(
@@ -261,14 +261,14 @@ PRIVATE void handle_attribute_name ARGS2(
     int high, low, i, diff;
 
     /*
-    **  Ignore unknown tag. - KW
+    **	Ignore unknown tag. - KW
     */
     if (tag == context->unknown_tag) {
 	return;
     }
 
     /*
-    **  Binary search for attribute name.
+    **	Binary search for attribute name.
     */
     for (low = 0, high = tag->number_of_attributes;
 	 high > low;
@@ -286,9 +286,9 @@ PRIVATE void handle_attribute_name ARGS2(
 #endif
 	    return;
 	} /* if */
-	
+
     } /* for */
-    
+
     if (TRACE)
 	fprintf(stderr, "SGML: Unknown attribute %s for tag %s\n",
 	    s, context->current_tag->name);
@@ -327,7 +327,13 @@ PRIVATE void handle_attribute_value ARGS2(
 
 
 /*
-**  translate some Unicodes to Lynx special codes and output them.
+**  Translate some Unicodes to Lynx special codes and output them.
+**  Special codes - ones those output depend on parsing.
+**
+**  Additional issue, like handling bidirectional text if nesseccery
+**  may be called from here:  zwnj (8204), zwj (8205), lrm (8206), rlm (8207)
+**  - currently they are passed to def7_uni.tbl as regular characters.
+**
 */
 PRIVATE BOOL put_special_unicodes ARGS2(
 	HTStream *,	context,
@@ -346,13 +352,20 @@ PRIVATE BOOL put_special_unicodes ARGS2(
     } else if (code == 8194 || code == 8195 || code == 8201) {
 	/*
 	**  Use Lynx special character for ensp, emsp or thinsp.
+	**
+	**  Originally, Lynx use space '32' as word delimiter and omits this
+	**  space at end of line if word is wrapped to the next line.  There
+	**  are several other spaces in the Unicode repertoire and we should
+	**  teach Lynx to understand them, not only as regular characters but
+	**  in the context of line wrapping.  Unfortunately, if we use
+	**  HT_EM_SPACE we override the chartrans tables for those spaces
+	**  (e.g., emsp= double space) with a single '32' for all (but do line
+	**  wrapping more fancy).  In the future we need HT_SPACE with a
+	**  transferred parameter (Unicode number) which falls back to
+	**  chartrans if line wrapping is not the case.
+	**
 	*/
 	PUTC(HT_EM_SPACE);
-    } else if (code == 8211 || code == 8212) {
-	/*
-	**  Use ASCII hyphen for ndash/endash or mdash/emdash.
-	*/
-	PUTC('-');
     } else {
 	/*
 	**  Return NO if nothing done.
@@ -391,49 +404,14 @@ PRIVATE void handle_entity ARGS2(
 	HTStream *,	context,
 	char,		term)
 {
-    CONST char ** entities = context->dtd->entity_names;
     UCode_t code;
     long uck;
     CONST char *s = context->string->data;
     int high, low, i, diff;
 
-    /*
-    **	Use Lynx special characters for nbsp (160), ensp (8194),
-    **	emsp (8195), thinsp (8201), and shy (173). - FM
-    */
-    if (!strcmp(s, "nbsp")) {
-	PUTC(HT_NON_BREAK_SPACE);
-	FoundEntity = TRUE;
-	return;
-    }
-    if (!strcmp(s, "ensp") || !strcmp(s, "emsp") || !strcmp(s, "thinsp")) {
-	PUTC(HT_EM_SPACE);
-	FoundEntity = TRUE;
-	return;
-    }
-    if (!strcmp(s, "shy")) {
-	PUTC(LY_SOFT_HYPHEN);
-	FoundEntity = TRUE;
-	return;
-    }
-
-#ifdef NOTUSED_FOTEMODS
-    /*
-    **	For ndash or endash (8211), and mdash or emdash (8212),
-    **	use an ASCII hyphen (32). - FM
-    */
-    if (!strcmp(s, "ndash") ||
-	!strcmp(s, "endash") ||
-	!strcmp(s, "mdash") ||
-	!strcmp(s, "endash")) {
-	PUTC('-');
-	FoundEntity = TRUE;
-	return;
-    }
-#endif /* NOTUSED_FOTEMODS */
 
     /*
-    **	Handle all other entities normally. - FM
+    **	Handle named entities.
     */
     FoundEntity = FALSE;
     if ((code = HTMLGetEntityUCValue(s)) != 0) {
@@ -441,12 +419,13 @@ PRIVATE void handle_entity ARGS2(
 	**  We got a Unicode value for the entity name.
 	**  Check for special Unicodes. - FM
 	*/
-	if (put_special_unicodes(context, code)) {  
+	if (put_special_unicodes(context, code)) {
 	    FoundEntity = TRUE;
 	    return;
 	}
 	/*
-	**  Seek a translation from the chartrans tables.
+	**  No special unicodes -
+	**  seek a translation from the chartrans tables.
 	*/
 	if ((uck = UCTransUniChar(code, context->outUCLYhndl)) >= 32 &&
 	    uck < 256 &&
@@ -499,55 +478,12 @@ PRIVATE void handle_entity ARGS2(
 	    return;
 	}
     }
-#ifdef NOTUSED_FOTEMODS
-    /*
-    **	Ignore zwnj (8204) and zwj (8205), if we get to here.
-    **	Note that zwnj may have been handled as <WBR>
-    **	by the calling function. - FM
-    */
-    if (!strcmp(s, "zwnj") ||
-	!strcmp(s, "zwj")) {
-	if (TRACE) {
-	    fprintf(stderr, "handle_entity: Ignoring '%s'.\n", s);
-	}
-	FoundEntity = TRUE;
-	return;
-    }
-
-    /*
-    **  Ignore lrm (8206), and rln (8207), if we get to here. - FM
-    */
-    if (!strcmp(s, "lrm") ||
-	!strcmp(s, "rlm")) {
-	if (TRACE) {
-	    fprintf(stderr, "handle_entity: Ignoring '%s'.\n", s);
-	}
-	FoundEntity = TRUE;
-	return;
-    }
-#endif /* NOTUSED_FOTEMODS */
-
-    /*
-    **	We haven't succeeded yet, so try the old LYCharSets
-    **	arrays for translation strings. - FM
-    */
-    for (low = 0, high = context->dtd->number_of_entities;
-	 high > low;
-	 diff < 0 ? (low = i+1) : (high = i)) {  /* Binary search */
-	i = (low + (high-low)/2);
-	diff = strcmp(entities[i], s);	/* Case sensitive! */
-	if (diff == 0) {		/* success: found it */
-	    (*context->actions->put_entity)(context->target, i);
-	    FoundEntity = TRUE;
-	    return;
-	}
-    }
 
     /*
     **	If entity string not found, display as text.
     */
     if (TRACE)
-	fprintf(stderr, "SGML: Unknown entity '%s'\n", s); 
+	fprintf(stderr, "SGML: Unknown entity '%s'\n", s);
     PUTC('&');
     {
 	CONST char *p;
@@ -732,7 +668,7 @@ PRIVATE void do_close_stacked ARGS1(
 PRIVATE int is_on_stack ARGS2(
 	HTStream *,	context,
 	HTTag *,	old_tag)
-{ 
+{
    HTElement * stacked = context->element_stack;
     int i = 1;
     for (; stacked; stacked = stacked->next, i++) {
@@ -837,11 +773,11 @@ PRIVATE void end_element ARGS2(
 #ifdef WIND_DOWN_STACK
     while (context->element_stack) { /* Loop is error path only */
 #else
-    if (context->element_stack) { /* Substitute and remove one stack element */ 
+    if (context->element_stack) { /* Substitute and remove one stack element */
 #endif /* WIND_DOWN_STACK */
 	HTElement * N = context->element_stack;
 	HTTag * t = N->tag;
-	
+
 	if (old_tag != t) {		/* Mismatch: syntax error */
 	    if (context->element_stack->next) { /* This is not the last level */
 		if (TRACE) fprintf(stderr,
@@ -854,7 +790,7 @@ PRIVATE void end_element ARGS2(
 		return; 		/* Ignore */
 	    }
 	}
-	
+
 	context->element_stack = N->next;		/* Remove from stack */
 	FREE(N);
 	(*context->actions->end_element)(context->target,
@@ -865,9 +801,9 @@ PRIVATE void end_element ARGS2(
 #else
 	return;
 #endif /* WIND_DOWN_STACK */
-	
+
 	/* Syntax error path only */
-	
+
     }
     if (TRACE)
 	fprintf(stderr, "SGML: Extra end tag </%s> found and ignored.\n",
@@ -941,7 +877,7 @@ PRIVATE void start_element ARGS1(
 		return;
 	    }
 	}
-    
+
 	if (context->element_stack &&
 	    canclose_check == close_error && !(valid =
 					       element_valid_within(
@@ -1120,7 +1056,7 @@ PRIVATE void SGML_free ARGS1(
     **	Free the strings and context structure. - FM
     */
     HTChunkFree(context->string);
-    for (i = 0; i < MAX_ATTRIBUTES; i++) 
+    for (i = 0; i < MAX_ATTRIBUTES; i++)
 	FREE(context->value[i]);
     FREE(context);
 }
@@ -1158,7 +1094,7 @@ PRIVATE void SGML_abort ARGS2(
     **	Free the strings and context structure. - FM
     */
     HTChunkFree(context->string);
-    for (i = 0; i < MAX_ATTRIBUTES; i++) 
+    for (i = 0; i < MAX_ATTRIBUTES; i++)
 	FREE(context->value[i]);
     FREE(context);
 }
@@ -1172,7 +1108,7 @@ PRIVATE void SGML_abort ARGS2(
 **   particular SGML context.
 */
 
-#ifdef CALLERDATA		  
+#ifdef CALLERDATA
 PUBLIC void* SGML_callerData ARGS1(
 	HTStream *,	context)
 {
@@ -1218,7 +1154,7 @@ PRIVATE void SGML_character ARGS2(
 	*/
 	if ((unsigned char)c > 127) {
 	    /*
-	    **  We have an octet from a multibyte character. - FM
+	    **	We have an octet from a multibyte character. - FM
 	    */
 	    if (context->utf_count > 0 && (c & 0xc0) == 0x80) {
 		context->utf_char = (context->utf_char << 6) | (c & 0x3f);
@@ -1227,9 +1163,9 @@ PRIVATE void SGML_character ARGS2(
 		(context->utf_buf_p)++;
 		if (context->utf_count == 0) {
 		    /*
-		    **  We have all of the bytes, so terminate
-		    **  the buffer and set 'clong' to the UCode_t
-		    **  value. - FM
+		    **	We have all of the bytes, so terminate
+		    **	the buffer and set 'clong' to the UCode_t
+		    **	value. - FM
 		    */
 		    *(context->utf_buf_p) = '\0';
 		    clong = context->utf_char;
@@ -1289,20 +1225,10 @@ PRIVATE void SGML_character ARGS2(
 	}
     }
 
-#ifdef NOTDEFINED
-    /*
-    **  If we have a koi8-r input and do not have
-    **  koi8-r as the output, save the raw input
-    **  in saved_char_in before we potentially
-    **  convert it to Unicode. - FM
-    */
-    if (context->T.strip_raw_char_in)
-	saved_char_in = c;
-#endif /* NOTDEFINED */
 
     /*
-    **  If we want the raw input converted
-    **  to Unicode, try that now. - FM
+    **	If we want the raw input converted
+    **	to Unicode, try that now. - FM
     */
     if (context->T.trans_to_uni &&
 	((unsign_c >= 127) ||
@@ -1418,7 +1344,7 @@ top1:
     **	or HTCJK set. - FM
     */
 #define PASSHICTRL (context->T.transp || \
-                    unsign_c >= LYlowest_eightbit[context->inUCLYhndl])
+		    unsign_c >= LYlowest_eightbit[context->inUCLYhndl])
     if (c == 127 &&
 	!(PASSHICTRL || HTCJK != NOCJK))
 	return;
@@ -1437,7 +1363,7 @@ top1:
     switch(context->state) {
 
     case S_in_kanji:
-        /*
+	/*
 	**  Note that if we don't have a CJK input, then this
 	**  is not the second byte of a CJK di-byte, and we're
 	**  trashing the input.  That's why 8-bit characters
@@ -1455,13 +1381,13 @@ top1:
 	if (HTCJK != NOCJK && (c & 0200) != 0) {
 	    /*
 	    **	Setting up for Kanji multibyte handling (based on
-	    **  Takuya ASADA's (asada@three-a.co.jp) CJK Lynx).
-	    **  Note that if the input is not in fact CJK, the
-	    **  next byte also will be mishandled, as explained
-	    **  above.  Toggle raw mode off in such cases, or
-	    **  select the "7 bit approximations" display
-	    **  character set, which is largely equivalent
-	    **  to having raw mode off with CJK. - FM
+	    **	Takuya ASADA's (asada@three-a.co.jp) CJK Lynx).
+	    **	Note that if the input is not in fact CJK, the
+	    **	next byte also will be mishandled, as explained
+	    **	above.	Toggle raw mode off in such cases, or
+	    **	select the "7 bit approximations" display
+	    **	character set, which is largely equivalent
+	    **	to having raw mode off with CJK. - FM
 	    */
 	    context->state = S_in_kanji;
 	    PUTC(c);
@@ -1525,7 +1451,7 @@ top1:
 	    saved_char_in = '\0';
 /******************************************************************
  *   I. LATIN-1 OR UCS2  TO  DISPLAY CHARSET
- ******************************************************************/  
+ ******************************************************************/
 	} else if ((chk = (context->T.trans_from_uni && unsign_c >= 160)) &&
 		   (uck = UCTransUniChar(unsign_c,
 					 context->outUCLYhndl)) >= 32 &&
@@ -1536,7 +1462,7 @@ top1:
 			uck, FROMASCII((char)uck));
 	    }
 	    /*
-	    **  We got one octet from the conversions, so use it. - FM
+	    **	We got one octet from the conversions, so use it. - FM
 	    */
 	    PUTC(FROMASCII((char)uck));
 	} else if (chk &&
@@ -1548,9 +1474,9 @@ top1:
 		   */
 		   (uck = UCTransUniCharStr(replace_buf, 60, clong,
 					    context->outUCLYhndl,
-					    0) >= 0)) { 
+					    0) >= 0)) {
 	    /*
-	    **  Got a replacement string.
+	    **	Got a replacement string.
 	    **	No further tests for valididy - assume that whoever
 	    **	defined replacement strings knew what she was doing. - KW
 	    */
@@ -1636,7 +1562,7 @@ top1:
 	}
 	break;
 
-    /*	
+    /*
     **	In litteral mode, waits only for specific end tag (for
     **	compatibility with old servers, and for Lynx). - FM
     */
@@ -1646,7 +1572,7 @@ top1:
 					   '/' :
 			context->element_stack->tag->name[string->size-2])) {
 	    int i;
-	    
+
 	    /*
 	    **	If complete match, end litteral.
 	    */
@@ -1665,7 +1591,7 @@ top1:
 	    for (i = 0; i < string->size; i++)	/* recover */
 	       PUTC(string->data[i]);
 	    string->size = 0;
-	    context->state = S_text;	
+	    context->state = S_text;
 	}
 	break;
 
@@ -1677,11 +1603,11 @@ top1:
 	    /*
 	    **	Setting up for possible numeric entity.
 	    */
-	    context->state = S_cro;  /* &# is Char Ref Open */ 
+	    context->state = S_cro;  /* &# is Char Ref Open */
 	    break;
 	}
 	context->state = S_entity;   /* Fall through! */
-	
+
     /*
     **	Handle possible named entity.
     */
@@ -1719,9 +1645,9 @@ top1:
 		"SGML_character: Handling 'zwnj' entity as 'WBR' element.\n");
 		}
 		if (c != ';') {
-		    sprintf(temp, "<WBR>%c", c); 
+		    sprintf(temp, "<WBR>%c", c);
 		} else {
-		    sprintf(temp, "<WBR>"); 
+		    sprintf(temp, "<WBR>");
 		}
 		if (context->recover == NULL) {
 		    StrAllocCopy(context->recover, temp);
@@ -1953,9 +1879,9 @@ top1:
 		    **	the standard semi-colon. - FM
 		    */
 		    if (c != ';') {
-			sprintf(temp, "<WBR>%c", c); 
+			sprintf(temp, "<WBR>%c", c);
 		    } else {
-			sprintf(temp, "<WBR>"); 
+			sprintf(temp, "<WBR>");
 		    }
 		    /*
 		    **	Add the replacement string to the
@@ -1972,17 +1898,12 @@ top1:
 		    context->state = S_text;
 		    break;
 		}
-		if (code == 160 || code == 173) {
+
 		    /*
-		    **	We *always* should interpret these as Latin1 here!
-		    **	Output the Lynx special character for nbsp and
-		    **	then recycle the terminator or break. - FM
+		**  Check for special Unicodes.
 		    */
-		    if (code == 160) {
-			PUTC(HT_NON_BREAK_SPACE);
-		    } else {
-			PUTC(LY_SOFT_HYPHEN);
-		    }
+			if (put_special_unicodes(context, code)) {
+
 		    string->size = 0;
 		    context->isHex = FALSE;
 		    context->state = S_text;
@@ -1991,7 +1912,8 @@ top1:
 		    break;
 		}
 		/*
-		**  Seek a translation from the chartrans tables.
+		**  No special unicodes -
+		**  seek a translation from the chartrans tables.
 		*/
 		if ((uck = UCTransUniChar(code,
 					  context->outUCLYhndl)) >= 32 &&
@@ -2023,7 +1945,7 @@ top1:
 			   */
 			   (uck = UCTransUniCharStr(replace_buf, 60, code,
 						    context->outUCLYhndl,
-						    0) >= 0)) { 
+						    0) >= 0)) {
 		    for (p = replace_buf; *p; p++) {
 			PUTC(*p);
 		    }
@@ -2114,11 +2036,6 @@ top1:
 			**  ensp, emsp or thinsp. - FM
 			*/
 			PUTC(HT_EM_SPACE);
-		    } else if (code == 8211 || code == 8212) {
-			/*
-			**  ndash or mdash. - FM
-			*/
-			PUTC('-');
 		    } else {
 			/*
 			**  Unhandled or illegal value.  Recover the
@@ -2148,7 +2065,7 @@ top1:
 		    PUTC(FROMASCII((char)code));
 		} else {
 		    /*
-		    **  Handle as named entity. - FM
+		    **	Handle as named entity. - FM
 		    */
 		    code -= 160;
 		    EntityName = HTMLGetEntityName(code);
@@ -2230,7 +2147,7 @@ top1:
 
     /*
     **	Tag
-    */	    
+    */
     case S_tag: 				/* new tag */
 	if (unsign_c < 127 && (string->size ?
 		  isalnum((unsigned char)c) : isalpha((unsigned char)c))) {
@@ -2311,8 +2228,8 @@ top1:
 		*/
 	    }
 	    context->current_tag = t;
-	    
-	    /* 
+
+	    /*
 	    **	Clear out attributes.
 	    */
 	    {
@@ -2322,7 +2239,7 @@ top1:
 	    }
 	    string->size = 0;
 	    context->current_attribute_number = INVALID;
-	    
+
 	    if (c == '>') {
 		if (context->current_tag->name)
 		    start_element(context);
@@ -2619,7 +2536,7 @@ top1:
 	HTChunkPutc(string, c);
 	context->state = S_attr; /* Get attribute */
 	break;
-	
+
 				/* accumulating value */
     case S_attr:
 	if (WHITE(c) || (c == '>') || (c == '=')) {	/* End of word */
@@ -2637,7 +2554,7 @@ top1:
 	    HTChunkPutc(string, c);
 	}
 	break;
-		
+
     case S_attr_gap:		/* Expecting attribute or '=' or '>' */
 	if (WHITE(c))
 	    break;		/* Gap after attribute */
@@ -2653,8 +2570,8 @@ top1:
 	HTChunkPutc(string, c);
 	context->state = S_attr;		/* Get next attribute */
 	break;
-	
-    case S_equals:		/* After attr = */ 
+
+    case S_equals:		/* After attr = */
 	if (WHITE(c))
 	    break;		/* Before attribute value */
 	if (c == '>') { 	/* End of tag */
@@ -2664,7 +2581,7 @@ top1:
 		start_element(context);
 	    context->state = S_text;
 	    break;
-	    
+
 	} else if (c == '\'') {
 	    context->state = S_squoted;
 	    break;
@@ -2676,7 +2593,7 @@ top1:
 	HTChunkPutc(string, c);
 	context->state = S_value;
 	break;
-	
+
     case S_value:
 	if (WHITE(c) || (c == '>')) {		/* End of word */
 	    HTChunkTerminate(string) ;
@@ -2712,7 +2629,7 @@ top1:
 	    HTChunkPutc(string, c);
 	}
 	break;
-		
+
     case S_squoted:		/* Quoted attribute value */
 	if (c == '\'') {	/* End of attribute value */
 	    HTChunkTerminate(string) ;
@@ -2749,7 +2666,7 @@ top1:
 	    HTChunkPutc(string, c);
 	}
 	break;
-	
+
     case S_dquoted:		/* Quoted attribute value */
 	if (c == '"' || 	/* Valid end of attribute value */
 	    (soft_dquotes &&	/*  If emulating old Netscape bug, treat '>' */
@@ -2790,7 +2707,7 @@ top1:
 	    HTChunkPutc(string, c);
 	}
 	break;
-	
+
     case S_end: 				/* </ */
 	if (unsign_c < 127 && isalnum((unsigned char)c)) {
 	    HTChunkPutc(string, c);
@@ -2806,7 +2723,7 @@ top1:
 	    }
 	    if (!t || t == context->unknown_tag) {
 		if (TRACE)
-		    fprintf(stderr, "Unknown end tag </%s>\n", string->data); 
+		    fprintf(stderr, "Unknown end tag </%s>\n", string->data);
 	    } else {
 		BOOL tag_OK = (c == '>' || WHITE(c));
 		context->current_tag = t;
@@ -3178,15 +3095,15 @@ PRIVATE void SGML_write ARGS3(
 /*	Structured Object Class
 **	-----------------------
 */
-PUBLIC CONST HTStreamClass SGMLParser = 
-{		
+PUBLIC CONST HTStreamClass SGMLParser =
+{
 	"SGMLParser",
 	SGML_free,
 	SGML_abort,
-	SGML_character, 
+	SGML_character,
 	SGML_string,
 	SGML_write,
-}; 
+};
 
 /*	Create SGML Engine
 **	------------------
@@ -3217,7 +3134,7 @@ PUBLIC HTStream* SGML_new  ARGS3(
     context->state = S_text;
     context->element_stack = 0; 		/* empty */
     context->inSELECT = FALSE;
-#ifdef CALLERDATA		  
+#ifdef CALLERDATA
     context->callerData = (void*) callerData;
 #endif /* CALLERDATA */
     for (i = 0; i < MAX_ATTRIBUTES; i++)
@@ -3270,15 +3187,15 @@ PUBLIC HTStream* SGML_new  ARGS3(
 ////////////////////////////////////////////////////////////////////////
 Copyright (c) 1993 Electrotechnical Laboratry (ETL)
 
-Permission to use, copy, modify, and distribute this material 
-for any purpose and without fee is hereby granted, provided 
-that the above copyright notice and this permission notice 
-appear in all copies, and that the name of ETL not be 
-used in advertising or publicity pertaining to this 
-material without the specific, prior written permission 
+Permission to use, copy, modify, and distribute this material
+for any purpose and without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies, and that the name of ETL not be
+used in advertising or publicity pertaining to this
+material without the specific, prior written permission
 of an authorized representative of ETL.
-ETL MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
-OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
+ETL MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
+OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
 WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
 /////////////////////////////////////////////////////////////////////////
 Content-Type:	program/C; charset=US-ASCII
@@ -3298,7 +3215,7 @@ PUBLIC void JISx0201TO0208_EUC ARGS4(
 	register unsigned char *,	OHI,
 	register unsigned char *,	OLO)
 {
-    static char *table[] = { 
+    static char *table[] = {
 	"\xA1\xA3", "\xA1\xD6", "\xA1\xD7", "\xA1\xA2", "\xA1\xA6", "\xA5\xF2",
 	"\xA5\xA1", "\xA5\xA3", "\xA5\xA5", "\xA5\xA7", "\xA5\xA9",
 	"\xA5\xE3", "\xA5\xE5", "\xA5\xE7", "\xA5\xC3", "\xA1\xBC",
diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h
index 30f0d170..5daafc73 100644
--- a/WWW/Library/Implementation/SGML.h
+++ b/WWW/Library/Implementation/SGML.h
@@ -141,9 +141,9 @@ typedef struct {
     HTTag *             tags;           /* Must be in strcmp order by name */
     int                 number_of_tags;
     CONST char **       entity_names;   /* Must be in strcmp order by name */
-    int                 number_of_entities;
+    size_t              number_of_entities;
     CONST UC_entity_info * extra_entity_info; /* strcmp order by name */
-    int                 number_of_extra_entities;
+    size_t              number_of_extra_entities;
 } SGML_dtd;
 
 
diff --git a/WWW/Library/Implementation/UCAux.h b/WWW/Library/Implementation/UCAux.h
index 5b2d52ce..b350e617 100644
--- a/WWW/Library/Implementation/UCAux.h
+++ b/WWW/Library/Implementation/UCAux.h
@@ -1,25 +1,9 @@
 #ifndef UCAUX_H
 #define UCAUX_H
 
-/*
- *  A type for a "Translation Quality" (actually, Transcoding Quality).
- *  This is a fuzzy concept since we are just looking at the charset
- *  not what characters are actually there, so it's just a guess for
- *  "common" cases.  TQ_NO must be 0 since callers of functions that
- *  return this type may treat result as a boolean flag.
- *  The functions returning this type could be improved to use more
- *  knowledge from the translation tables.
- */
-typedef enum {
-    TQ_NO	= 0,		/* must be 0 */
-    TQ_POOR	= 1,
-    TQ_GOOD	= 2,
-    TQ_EXCELLENT = 3
-} UCTQ_t;
-
-extern UCTQ_t UCCanUniTranslateFrom PARAMS((int from));
-extern UCTQ_t UCCanTranslateUniTo PARAMS((int to));
-extern UCTQ_t UCCanTranslateFromTo PARAMS((int from, int to));
+extern BOOL UCCanUniTranslateFrom PARAMS((int from));
+extern BOOL UCCanTranslateUniTo PARAMS((int to));
+extern BOOL UCCanTranslateFromTo PARAMS((int from, int to));
 extern BOOL UCNeedNotTranslate PARAMS((
 	int		from,
 	int		to));
diff --git a/aclocal.m4 b/aclocal.m4
index 6f387109..d928f51d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -298,7 +298,7 @@ if test ".$ac_cv_func_initscr" != .yes ; then
 	])
 
 	# Check for library containing initscr
-	test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+	test "$cf_term_lib" != predefined && \ test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
 	for cf_curs_lib in curses ncurses cursesX jcurses unknown
 	do
 		AC_CHECK_LIB($cf_curs_lib,initscr,[break])
diff --git a/docs/README.chartrans b/docs/README.chartrans
index 69c1ad4d..f77a1115 100644
--- a/docs/README.chartrans
+++ b/docs/README.chartrans
@@ -6,22 +6,20 @@ Lynx CHARTRANS
    character set, *IF* the document charset is known by a translation 
    table (compiled in at installation).
 
- - Old method for specifying translations of Latin1 characters and
-   SGML entities still supported. (IBMPC-charsets.announce is still
-   relevant.)
-
  - New method to define character sets: used for input charset as well
    as display character set, translation tables compiled in from 
    separate files (one per charset).  One table is designated as default
    and can be used for fallback translation to 7-bit replacements for
    display.
 
+ - New method for specifying translations of SGML entities.
+
  - Unicode (UTF8) support: can (attempt to) decode and translate UTF8 to
    display character set, or pass through UTF to display (if terminal
    or console understands UTF8).  [raw display of UTF only tested with Slang 
    so far, does not always position everything correctly on screen]
 
- - Support for CHARSET attribute on A tag (and sometimesLINK), as in HTML
+ - Support for CHARSET attribute on A tag (and sometimes LINK), as in HTML
    i18n RFC 2070 and W3C HTML 4.0 drafts.  A link can suggest the target's
    charset in this way.
 
@@ -48,7 +46,7 @@ Additions/changes to user interface:
    -assume_local_charset=... assume this as charset of local file: docs 
    also available as ASSUME_CHARSET etc. in lynx.cfg
    In "Advanced User" mode, ASSUME_CHARSET can be changed during a session
-   from the Optios Screen.
+   from the Options Screen.
 
  - The "Raw" toggle (from -raw flag, '@' key, or Options screen)
    o  toggles the assumption "Default remote charset is same as Display
@@ -138,7 +136,7 @@ HOW TO INSTALL:
      not xterm, not a dialup *into* the Linux box), you can compile
      with -DEXP_CHARTRANS_AUTOSWITCH.  This is very useful for testing
      the various Display Character Sets, Lynx will try to automatically
-     chage the console state.  You need to have the Linux kbd package
+     change the console state.  You need to have the Linux kbd package
      installed, with a working `setfont' command executable by the user,
      and the right font files - check the source in src/UCAuto.c for
      the files used and/or to change them!  
@@ -165,6 +163,6 @@ HOW TO INSTALL:
 
     Suggestions for improvement would be welcome, as well as 
     contributed translation tables (for stuff that is not available
-    at ftp://dkuug.dk or ftp://unicode.org).
+    at ftp://dkuug.dk or ftp://ftp.unicode.org).
 
 KW  1997-11-06
diff --git a/docs/win-386.announce b/docs/win-386.announce
new file mode 100644
index 00000000..2f36fb23
--- /dev/null
+++ b/docs/win-386.announce
@@ -0,0 +1,28 @@
+Ports have been added for Win32 (95/NT) and 386 DOS computers with a
+packet driver.  I created four new defines to accomplish this.
+
+_WINDOWS Defined for Win32 specific code (Mostly TCP related)
+DJGPP    Defined for 386 specific code (Mostly TCP related)
+DOSPATH  Defined for any DOS'ish computer
+NOSIGHUP Defined for computers not supporting sighup signal calls.
+
+To make the Win32 version you need Borland C++ 4.52 or complete
+compatable and the win32.zip package unziped into the lynx directory.
+This code expects you to have BC make in your path at the console
+prompt and also to be able to compile from the console as well.
+I can provide an IDE if needed but did not want to force on into the
+standard Lynx package.  Text mode compiling is much faster anyhow (IMHO).
+The current default configuration is to have the Character Translation
+code linked in.  For this to be successful you need to go into
+src\chrtrans and run makew32.  After that you can come back to the
+Lynx root and run make -f makefile.w32.
+
+The DJGPP version is a little screwy.  You need DJGPP 2.0, the djgpp.zip
+package unziped into the lynx directory and some paitence.  I kludged it
+to compile with long filenames under Win95 so some fooling around may be
+required.  To compile, run djgpp.bat that was extracted from the zip
+file.  There is currently a problem with compiling HTML.c and I have
+contacted the author of DJGPP for help with getting this port further.
+
+Wayne Buttles
+lynx-port@fdisk.com
diff --git a/lynx.cfg b/lynx.cfg
index cdcc5f0f..7c989e02 100644
--- a/lynx.cfg
+++ b/lynx.cfg
@@ -155,21 +155,21 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # for setting CHARACTER_SET here, and a corresponding MIME name (for
 # recognizing properly labelled charset parameters in HTTP headers etc.).
 # Not all Display Character Set names correspond to exactly one valid MIME
-# charset (for example "Other ISO Latin", "Chinese", "Transparent"), in
-# that case an appropriate valid (and more specific) MIME name should be
-# used where required.  The actions of the -raw switch and LYK_RAW_TOGGLE
-# ('@') are dependent on the character set.  For the Asian (CJK) sets the
+# charset (for example "Chinese", "Transparent"), in that case
+# an appropriate valid (and more specific) MIME name should be used
+# where required.  The actions of the -raw switch and LYK_RAW_TOGGLE ('@')
+# are dependent on the character set.  For the Asian (CJK) sets the
 # corresponding charset is assumed in documents, i.e., raw or CJK mode is
 # ON by default, so that -raw or the initial LYK_RAW_TOGGLE will turn the
 # mode OFF.  The toggling also can be done via the 'o'ptions menu.  In raw
 # CJK mode, 8-bit characters are not reverse translated in relation to the
 # entity conversion arrays, i.e., they are assumed to be appropriate for
 # the current character set.  It should be toggled OFF when an Asian (CJK)
-# character set is selected but the document is not CJK.  
+# character set is selected but the document is not CJK.
 # The default for "raw mode" (before it is changed by -raw or LYK_RAW_TOGGLE),
-# if the display character set is not a CJK character set, depends on the 
-# display character set as well as the ASSUME_CHARSET value (see below) from 
-# either this file or an -assume_charset command line option.  The mode 
+# if the display character set is not a CJK character set, depends on the
+# display character set as well as the ASSUME_CHARSET value (see below) from
+# either this file or an -assume_charset command line option.  The mode
 # defaults to ON if the ASSUME_CHARSET value corresponds to the display
 # character set, otherwise to OFF.
 # It can be toggled ON if you believe the document has a charset which does
@@ -191,15 +191,16 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #    Chinese				euc-cn
 #    DEC Multinational			dec-mcs
 #    DosArabic (cp864)			cp864
-#    DosBaltRim (cp775)			cp775
+#    DosBaltRim (cp775) 		cp775
 #    DosCyrillic (cp866)		cp866
 #    DosGreek (cp737)			cp737
 #    DosGreek2 (cp869)			cp869
 #    DosHebrew (cp862)			cp862
 #    DosLatin1 (cp850)			cp850
 #    DosLatin2 (cp852)			cp852
-#    DosLatinUS (cp437)			cp437
+#    DosLatinUS (cp437) 		cp437
 #    ISO 8859-10			iso-8859-10
+#    ISO 8859-5 Cyrillic		iso-8859-5
 #    ISO 8859-6 Arabic			iso-8859-6
 #    ISO 8859-7 Greek			iso-8859-7
 #    ISO 8859-8 Hebrew			iso-8859-8
@@ -208,27 +209,25 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #    ISO Latin 2			iso-8859-2
 #    ISO Latin 3			iso-8859-3
 #    ISO Latin 4			iso-8859-4
-#    ISO 8859-5 Cyrillic		iso-8859-5
 #    Japanese (EUC)			euc-jp
 #    Japanese (SJIS)			shift_jis
 #    KOI8-R Cyrillic			koi8-r
 #    Korean				euc-kr
 #    Macintosh (8 bit)			macintosh
-#    NeXT character set			next
-#    Other ISO Latin			x-iso-8859-other
+#    NeXT character set 		next
 #    RFC 1345 Mnemonic			mnemonic
-#    RFC 1345 w/o Intro			mnemonic+ascii+0
+#    RFC 1345 w/o Intro 		mnemonic+ascii+0
 #    Taipei (Big5)			big5
 #    Transparent			x-transparent
 #    UNICODE UTF 8			utf-8
 #    Vietnamese (VISCII)		viscii
-#    WinArabic (cp1256)			windows-1256
+#    WinArabic (cp1256) 		windows-1256
 #    WinBaltRim (cp1257)		windows-1257
 #    WinCyrillic (cp1251)		windows-1251
 #    WinGreek (cp1253)			windows-1253
-#    WinHebrew (cp1255)			windows-1255
-#    WinLatin1 (cp1252)			windows-1252
-#    WinLatin2 (cp1250)			windows-1250
+#    WinHebrew (cp1255) 		windows-1255
+#    WinLatin1 (cp1252) 		windows-1252
+#    WinLatin2 (cp1250) 		windows-1250
 #
 #CHARACTER_SET:ISO Latin 1
 
@@ -236,7 +235,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # explicitly specify a charset.  Normally Lynx assumes that 8-bit
 # characters in those documents are encoded according to iso-8859-1
 # (the official default for the HTTP protocol).  When ASSUME_CHARSET
-# given here or by an -assume_charset command line flag is in effect, 
+# given here or by an -assume_charset command line flag is in effect,
 # Lynx will treat documents as if they were encoded accordingly.
 # See above on how this interacts with "raw mode" and the Display
 # Character Set.
@@ -247,19 +246,34 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 
 # ASSUME_LOCAL_CHARSET is like ASSUME_CHARSET but only applies to local
 # files.  If no setting is given here or by an -assume_local_charset
-# command line option, the value for ASSUME_CHARSET or -assume_charset 
+# command line option, the value for ASSUME_CHARSET or -assume_charset
 # is used.
 # This option may interfere with "raw mode" toggling when local files
 # are viewed (it is "stronger" than the effective change of the charset
 # assumption caused by changing "raw mode"), so only use when necessary.
-# 
+#
 #ASSUME_LOCAL_CHARSET:iso-8859-1
 
+# If PREPEND_CHARSET_TO_SOURCE is set to TRUE, Lynx will prepend a
+# META CHARSET to text/html source files when
+# they are retrieved for 'd'ownloading or passed to 'p'rint functions.
+# For 'd'ownload option charset will be added only if HTTP charset present.
+# The compilation default is FALSE.
+# It is generally desired to have charset information for every
+# local html file, but META CHARSET string may cause
+# compatibility problems with other browsers, so
+# if you use all CHARACTER_SET, ASSUME_CHARSET, ASSUME_LOCAL_CHARSET
+# unchanged from theirs default value iso-8859-1 you usually
+# need not change the compilation default for PREPEND_CHARSET_TO_SOURCE.
+# Note that the prepending is not done for -source dumps.
+#
+#PREPEND_CHARSET_TO_SOURCE:FALSE
+
 # If Lynx encounters a charset parameter it doesn't recognize, it will
 # replace the value given by ASSUME_UNREC_CHARSET (or a corresponding
 # -assume_unrec_charset command line option) for it.  This can be used
 # to deal with charsets unknown to Lynx, if they are "sufficiently
-# similar" to one that Lynx does know about, by forcing the same 
+# similar" to one that Lynx does know about, by forcing the same
 # treatment.  There is no default, and you probably should leave this
 # undefined unless necessary.
 #
@@ -679,7 +693,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # The compilation default set in userdefs.h can be changed here.  If
 # the default is TRUE, posting can still be disallowed via the
 # -restrictions command line switch.
-# 
+#
 #NEWS_POSTING:TRUE
 
 # LYNX_SIG_FILE defines the name of a file containing a signature which
@@ -804,7 +818,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # The user can re-define the default bookmark file, as well as a set
 # of sub-bookmark files if multiple bookmark file support is enabled
 # (see below), via the 'o'ptions menu, and can save those definitions
-# in the .lynxrc file. 
+# in the .lynxrc file.
 #
 #DEFAULT_BOOKMARK_FILE:lynx_bookmarks.html
 
@@ -951,7 +965,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #  ftp://space.mit.edu/pub/davis/most).  The most -k switch suppresses the
 #  invocation of hexadecimal display mode if 8-bit or control characters
 #  are present.  The +s switch invokes secure mode.
-#PRINTER:Use Most to view:most -k +s %s:TRUE:23 
+#PRINTER:Use Most to view:most -k +s %s:TRUE:23
 
 # Downloader definitions
 # any number of downloaders may be defined by using multiple
@@ -994,9 +1008,8 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #DOWNLOADER:Use Most to view:most +s %s:TRUE
 #  (don't use most's -k switch, so that binaries will invoke hexadecimal mode)
 #DOWNLOADER:Use Kermit to download to the local terminal:kermit -i -s %s -a %s:TRUE
-#DOWNLOADER:Use Zmodem to download to the local terminal:sz %s:TRUE
-#    (example script in lieu of :sz %s: for offering a suggested filename)
-#  :set %s %s;td=/tmp/Lsz$$;mkdir $td;ln -s $1 $td/"$2";sz $td/"$2";rm -r $td:
+#DOWNLOADER:Use Zmodem to download to the local terminal:set %s %s;td=/tmp/Lsz$$;mkdir $td;ln -s $1 $td/"$2";sz $td/"$2";rm -r $td:TRUE
+#  (example script replace :sz %s: for offering a suggested filename)
 
 # Unix ONLY:
 #===========
@@ -1098,6 +1111,13 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #
 #SUBSTITUTE_UNDERSCORES:FALSE
 
+# If QUIT_DEFAULT_YES is TRUE then when the QUIT command is entered, any
+# response other than n or N will confirm.  It should be FALSE if you
+# prefer the more conservative action of requiring an explicit Y or y to
+# confirm.  The default defined here will override that in userdefs.h.
+#
+#QUIT_DEFAULT_YES:TRUE
+
 # If HISTORICAL_COMMENTS is TRUE, Lynx will revert to the "Historical"
 # behavior of treating any '>' as a terminator for comments, instead of
 # seeking a valid '-->' terminator (note that white space can be present
@@ -1137,14 +1157,14 @@ MINIMAL_COMMENTS:TRUE
 #
 #SOFT_DQUOTES:FALSE
 
-# If STRIP_DOTDOT_URLS is TRUE, Lynx emulates the invalid behavior of many 
+# If STRIP_DOTDOT_URLS is TRUE, Lynx emulates the invalid behavior of many
 # browsers to strip a leading "../" segment from relative URLs in HTML
 # documents with a http or https base URL, if this would otherwise lead to
 # an absolute URLs with those characters still in it.  Such URLs are normally
-# erroneous and not what is intended by page authors.  Lynx will issue 
+# erroneous and not what is intended by page authors.  Lynx will issue
 # a warning message when this occurs.
 #
-# If STRIP_DOTDOT_URLS is FALSE, Lynx will use those URLs for requests 
+# If STRIP_DOTDOT_URLS is FALSE, Lynx will use those URLs for requests
 # without taking any special actions or issuing Warnings, in most cases
 # this will result in an error response from the server.
 #
@@ -1175,7 +1195,7 @@ MINIMAL_COMMENTS:TRUE
 # "-enable_scrollback" command line switch.
 #
 #ENABLE_SCROLLBACK:FALSE
- 
+
 # If SCAN_FOR_BURIED_NEWS_REFS is set to TRUE, Lynx will scan the bodies
 # of news articles for buried article and URL references and convert them
 # to links.  The compilation default is TRUE, but some email addresses
@@ -1647,7 +1667,7 @@ MINIMAL_COMMENTS:TRUE
 # COLOR:Integer:Foreground:Background
 #
 # The Integer value is interpreted as follows:
-#     0 - normal               - normal text 
+#     0 - normal               - normal text
 #     1 - bold                 - hyperlinks, see also BOLD_* options above
 #     2 - reverse              - statusline
 #     3 - bold + reverse		(not used)
@@ -1709,7 +1729,8 @@ MINIMAL_COMMENTS:TRUE
 # EXTERNAL:ftp:wget %s &:TRUE
 
 # Raw DOS Key hack
-# This will bypass the DOS key hack if is compiled in.
+# If RAW_DOS_KEY_HACK is set to FALSE, it will bypass the DOS key hack.
+# The DOS key hack is only present if compiled with -DRAWDOSKEYHACK
 # The hack is as follows:
 # if (c == 0) c = '/';
 # if (c > 255) {      /* handle raw dos keys */
@@ -1724,5 +1745,5 @@ MINIMAL_COMMENTS:TRUE
 #		}
 #	}
 #
-# RAW_DOS_KEY_HACK = TRUE
+# RAW_DOS_KEY_HACK:TRUE
 
diff --git a/samples/lynx.cfg b/samples/lynx.cfg
index cdcc5f0f..a0a89ef1 100644
--- a/samples/lynx.cfg
+++ b/samples/lynx.cfg
@@ -155,21 +155,21 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # for setting CHARACTER_SET here, and a corresponding MIME name (for
 # recognizing properly labelled charset parameters in HTTP headers etc.).
 # Not all Display Character Set names correspond to exactly one valid MIME
-# charset (for example "Other ISO Latin", "Chinese", "Transparent"), in
-# that case an appropriate valid (and more specific) MIME name should be
-# used where required.  The actions of the -raw switch and LYK_RAW_TOGGLE
-# ('@') are dependent on the character set.  For the Asian (CJK) sets the
+# charset (for example "Chinese", "Transparent"), in that case
+# an appropriate valid (and more specific) MIME name should be used
+# where required.  The actions of the -raw switch and LYK_RAW_TOGGLE ('@')
+# are dependent on the character set.  For the Asian (CJK) sets the
 # corresponding charset is assumed in documents, i.e., raw or CJK mode is
 # ON by default, so that -raw or the initial LYK_RAW_TOGGLE will turn the
 # mode OFF.  The toggling also can be done via the 'o'ptions menu.  In raw
 # CJK mode, 8-bit characters are not reverse translated in relation to the
 # entity conversion arrays, i.e., they are assumed to be appropriate for
 # the current character set.  It should be toggled OFF when an Asian (CJK)
-# character set is selected but the document is not CJK.  
+# character set is selected but the document is not CJK.
 # The default for "raw mode" (before it is changed by -raw or LYK_RAW_TOGGLE),
-# if the display character set is not a CJK character set, depends on the 
-# display character set as well as the ASSUME_CHARSET value (see below) from 
-# either this file or an -assume_charset command line option.  The mode 
+# if the display character set is not a CJK character set, depends on the
+# display character set as well as the ASSUME_CHARSET value (see below) from
+# either this file or an -assume_charset command line option.  The mode
 # defaults to ON if the ASSUME_CHARSET value corresponds to the display
 # character set, otherwise to OFF.
 # It can be toggled ON if you believe the document has a charset which does
@@ -191,15 +191,16 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #    Chinese				euc-cn
 #    DEC Multinational			dec-mcs
 #    DosArabic (cp864)			cp864
-#    DosBaltRim (cp775)			cp775
+#    DosBaltRim (cp775) 		cp775
 #    DosCyrillic (cp866)		cp866
 #    DosGreek (cp737)			cp737
 #    DosGreek2 (cp869)			cp869
 #    DosHebrew (cp862)			cp862
 #    DosLatin1 (cp850)			cp850
 #    DosLatin2 (cp852)			cp852
-#    DosLatinUS (cp437)			cp437
+#    DosLatinUS (cp437) 		cp437
 #    ISO 8859-10			iso-8859-10
+#    ISO 8859-5 Cyrillic		iso-8859-5
 #    ISO 8859-6 Arabic			iso-8859-6
 #    ISO 8859-7 Greek			iso-8859-7
 #    ISO 8859-8 Hebrew			iso-8859-8
@@ -208,27 +209,25 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #    ISO Latin 2			iso-8859-2
 #    ISO Latin 3			iso-8859-3
 #    ISO Latin 4			iso-8859-4
-#    ISO 8859-5 Cyrillic		iso-8859-5
 #    Japanese (EUC)			euc-jp
 #    Japanese (SJIS)			shift_jis
 #    KOI8-R Cyrillic			koi8-r
 #    Korean				euc-kr
 #    Macintosh (8 bit)			macintosh
-#    NeXT character set			next
-#    Other ISO Latin			x-iso-8859-other
+#    NeXT character set 		next
 #    RFC 1345 Mnemonic			mnemonic
-#    RFC 1345 w/o Intro			mnemonic+ascii+0
+#    RFC 1345 w/o Intro 		mnemonic+ascii+0
 #    Taipei (Big5)			big5
 #    Transparent			x-transparent
 #    UNICODE UTF 8			utf-8
 #    Vietnamese (VISCII)		viscii
-#    WinArabic (cp1256)			windows-1256
+#    WinArabic (cp1256) 		windows-1256
 #    WinBaltRim (cp1257)		windows-1257
 #    WinCyrillic (cp1251)		windows-1251
 #    WinGreek (cp1253)			windows-1253
-#    WinHebrew (cp1255)			windows-1255
-#    WinLatin1 (cp1252)			windows-1252
-#    WinLatin2 (cp1250)			windows-1250
+#    WinHebrew (cp1255) 		windows-1255
+#    WinLatin1 (cp1252) 		windows-1252
+#    WinLatin2 (cp1250) 		windows-1250
 #
 #CHARACTER_SET:ISO Latin 1
 
@@ -236,7 +235,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # explicitly specify a charset.  Normally Lynx assumes that 8-bit
 # characters in those documents are encoded according to iso-8859-1
 # (the official default for the HTTP protocol).  When ASSUME_CHARSET
-# given here or by an -assume_charset command line flag is in effect, 
+# given here or by an -assume_charset command line flag is in effect,
 # Lynx will treat documents as if they were encoded accordingly.
 # See above on how this interacts with "raw mode" and the Display
 # Character Set.
@@ -247,19 +246,19 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 
 # ASSUME_LOCAL_CHARSET is like ASSUME_CHARSET but only applies to local
 # files.  If no setting is given here or by an -assume_local_charset
-# command line option, the value for ASSUME_CHARSET or -assume_charset 
+# command line option, the value for ASSUME_CHARSET or -assume_charset
 # is used.
 # This option may interfere with "raw mode" toggling when local files
 # are viewed (it is "stronger" than the effective change of the charset
 # assumption caused by changing "raw mode"), so only use when necessary.
-# 
+#
 #ASSUME_LOCAL_CHARSET:iso-8859-1
 
 # If Lynx encounters a charset parameter it doesn't recognize, it will
 # replace the value given by ASSUME_UNREC_CHARSET (or a corresponding
 # -assume_unrec_charset command line option) for it.  This can be used
 # to deal with charsets unknown to Lynx, if they are "sufficiently
-# similar" to one that Lynx does know about, by forcing the same 
+# similar" to one that Lynx does know about, by forcing the same
 # treatment.  There is no default, and you probably should leave this
 # undefined unless necessary.
 #
@@ -679,7 +678,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # The compilation default set in userdefs.h can be changed here.  If
 # the default is TRUE, posting can still be disallowed via the
 # -restrictions command line switch.
-# 
+#
 #NEWS_POSTING:TRUE
 
 # LYNX_SIG_FILE defines the name of a file containing a signature which
@@ -804,7 +803,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # The user can re-define the default bookmark file, as well as a set
 # of sub-bookmark files if multiple bookmark file support is enabled
 # (see below), via the 'o'ptions menu, and can save those definitions
-# in the .lynxrc file. 
+# in the .lynxrc file.
 #
 #DEFAULT_BOOKMARK_FILE:lynx_bookmarks.html
 
@@ -951,7 +950,7 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #  ftp://space.mit.edu/pub/davis/most).  The most -k switch suppresses the
 #  invocation of hexadecimal display mode if 8-bit or control characters
 #  are present.  The +s switch invokes secure mode.
-#PRINTER:Use Most to view:most -k +s %s:TRUE:23 
+#PRINTER:Use Most to view:most -k +s %s:TRUE:23
 
 # Downloader definitions
 # any number of downloaders may be defined by using multiple
@@ -1098,6 +1097,13 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #
 #SUBSTITUTE_UNDERSCORES:FALSE
 
+# If QUIT_DEFAULT_YES is TRUE then when the QUIT command is entered, any
+# response other than n or N will confirm.  It should be FALSE if you
+# prefer the more conservative action of requiring an explicit Y or y to
+# confirm.  The default defined here will override that in userdefs.h.
+#
+#QUIT_DEFAULT_YES:TRUE
+
 # If HISTORICAL_COMMENTS is TRUE, Lynx will revert to the "Historical"
 # behavior of treating any '>' as a terminator for comments, instead of
 # seeking a valid '-->' terminator (note that white space can be present
@@ -1137,14 +1143,14 @@ MINIMAL_COMMENTS:TRUE
 #
 #SOFT_DQUOTES:FALSE
 
-# If STRIP_DOTDOT_URLS is TRUE, Lynx emulates the invalid behavior of many 
+# If STRIP_DOTDOT_URLS is TRUE, Lynx emulates the invalid behavior of many
 # browsers to strip a leading "../" segment from relative URLs in HTML
 # documents with a http or https base URL, if this would otherwise lead to
 # an absolute URLs with those characters still in it.  Such URLs are normally
-# erroneous and not what is intended by page authors.  Lynx will issue 
+# erroneous and not what is intended by page authors.  Lynx will issue
 # a warning message when this occurs.
 #
-# If STRIP_DOTDOT_URLS is FALSE, Lynx will use those URLs for requests 
+# If STRIP_DOTDOT_URLS is FALSE, Lynx will use those URLs for requests
 # without taking any special actions or issuing Warnings, in most cases
 # this will result in an error response from the server.
 #
@@ -1175,7 +1181,7 @@ MINIMAL_COMMENTS:TRUE
 # "-enable_scrollback" command line switch.
 #
 #ENABLE_SCROLLBACK:FALSE
- 
+
 # If SCAN_FOR_BURIED_NEWS_REFS is set to TRUE, Lynx will scan the bodies
 # of news articles for buried article and URL references and convert them
 # to links.  The compilation default is TRUE, but some email addresses
@@ -1647,7 +1653,7 @@ MINIMAL_COMMENTS:TRUE
 # COLOR:Integer:Foreground:Background
 #
 # The Integer value is interpreted as follows:
-#     0 - normal               - normal text 
+#     0 - normal               - normal text
 #     1 - bold                 - hyperlinks, see also BOLD_* options above
 #     2 - reverse              - statusline
 #     3 - bold + reverse		(not used)
diff --git a/src/GridText.c b/src/GridText.c
index b7080263..7df08b26 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -771,7 +771,7 @@ PRIVATE int display_line ARGS2(
 		    addch('_');
 		    i++;
 		} else {
-		    lynx_start_underline_color ();
+		    start_underline();
 		}
 		break;
 
@@ -780,16 +780,16 @@ PRIVATE int display_line ARGS2(
 		    addch('_');
 		    i++;
 		} else {
-		    lynx_stop_underline_color ();
+		    stop_underline();
 		}
 		break;
 
 	    case LY_BOLD_START_CHAR:
-		lynx_start_bold_color ();
+		start_bold();
 		break;
 
 	    case LY_BOLD_END_CHAR:
-		lynx_stop_bold_color ();
+		stop_bold ();
 		break;
 #endif
 
@@ -883,8 +883,8 @@ PRIVATE int display_line ARGS2(
     addch('\n');
 
 #ifndef USE_COLOR_STYLE
-    lynx_stop_underline_color ();
-    lynx_stop_bold_color ();
+    stop_underline();
+    stop_bold();
 #else
     while (current_style < line->numstyles)
     {
@@ -984,8 +984,8 @@ PRIVATE void display_title ARGS1(
 		}
 		tmp[j] = '\0';
 	    }
-	    FREE(title);
-	    title = (char *)tmp;
+	    StrAllocCopy(title, (CONST char *)tmp);
+	    FREE(tmp);
 	}
     }
     move(0, 0);
@@ -1035,7 +1035,8 @@ PRIVATE void display_page ARGS3(
     TextAnchor *Anchor_ptr = NULL;
     FormInfo *FormInfo_ptr;
     BOOL display_flag = FALSE;
-    HTAnchor *link_dest, *link_dest_intl = NULL;
+    HTAnchor *link_dest;
+    HTAnchor *link_dest_intl = NULL;
     static int last_nlinks = 0;
     static int charset_last_displayed = -1;
 
@@ -1052,7 +1053,7 @@ PRIVATE void display_page ARGS3(
 	    refresh();
 	    clear();
 	}
-	addstr("\n\nError accessing document.\nNo data available!\n");
+	addstr("\n\nError accessing document!\nNo data available!\n");
 	refresh();
 	nlinks = 0;  /* set number of links to 0 */
 	return;
@@ -1399,15 +1400,7 @@ PRIVATE void display_page ARGS3(
 			    link_dest_intl = NULL;
 			if (link_dest_intl) {
 			    char *cp2 = HTAnchor_address(link_dest_intl);
-#if 0
-			    cp = strchr(cp2, '#');
-			    if (cp && cp != cp2 &&
-				0!=strncmp(cp2, "LYNXIMGMAP:", 11)) {
-				StrAllocCopy(cp_AnchorAddress, cp);
-				FREE(cp2);
-			    } else
-#endif
-				cp_AnchorAddress = cp2;
+			    cp_AnchorAddress = cp2;
 			} else
 #endif
 			    cp_AnchorAddress = HTAnchor_address(link_dest);
@@ -1642,10 +1635,6 @@ PRIVATE void split_line ARGS2(
 	      previous->styles[previous->numstyles-2].direction == STACK_ON) ||
 	     (previous->styles[LastStyle].direction == ABS_OFF &&
 	      previous->styles[previous->numstyles-2].direction == ABS_ON) ||
-#if 0
-	     (previous->styles[LastStyle].direction == STACK_ON &&
-	      previous->styles[previous->numstyles-2].direction == STACK_OFF) ||
-#endif
 	     (previous->styles[LastStyle].direction == ABS_ON &&
 	      previous->styles[previous->numstyles-2].direction == ABS_OFF)
 		)) {
@@ -2417,7 +2406,7 @@ PUBLIC void HText_appendCharacter ARGS2(
 	/*
 	 *  Can split here. - FM
 	 */
-	text->permissible_split = (int)line->size;
+	text->permissible_split = (int)text->last_line->size;
 	/*
 	 *  There are some pages written in
 	 *  different kanji codes. - TA
@@ -2538,7 +2527,7 @@ check_IgnoreExcess:
 	    /*
 	     *  Can split here. - FM
 	     */
-	    text->permissible_split = (int)line->size;
+	    text->permissible_split = (int)text->last_line->size;
 	}
     }
 }
@@ -2642,6 +2631,7 @@ PUBLIC int HText_beginAnchor ARGS3(
     a->next = 0;
     a->anchor = anc;
     a->extent = 0;
+    a->link_type = HYPERTEXT_ANCHOR;
     text->last_anchor = a;
 
 #ifndef DONT_TRACK_INTERNAL_LINKS
@@ -2652,10 +2642,8 @@ PUBLIC int HText_beginAnchor ARGS3(
 #endif
 	if (HTAnchor_followMainLink((HTAnchor*)anc)) {
 	a->number = ++(text->last_anchor_number);
-	a->link_type = HYPERTEXT_ANCHOR;
     } else {
 	a->number = 0;
-	a->link_type = HYPERTEXT_ANCHOR;
     }
 
     /*
@@ -3061,7 +3049,7 @@ PUBLIC void HText_endAnchor ARGS2(
 	    }
 	} else {
 	    /*
-	     *  The anchor's content does not restricted to only
+	     *  The anchor's content is not restricted to only
 	     *  white and special characters, so we'll show it
 	     *  as a link. - FM
 	     */
@@ -3501,8 +3489,9 @@ PUBLIC int HTGetLinkInfo ARGS6(
 	char **,	hightext,
 	char **,	lname)
 {
-    TextAnchor * a;
-    HTAnchor *link_dest, *link_dest_intl = NULL;
+    TextAnchor *a;
+    HTAnchor *link_dest;
+    HTAnchor *link_dest_intl = NULL;
     int anchors_this_line = 0, anchors_this_screen = 0;
     int prev_anchor_line = -1, prev_prev_anchor_line = -1;
 
@@ -3630,21 +3619,9 @@ PUBLIC int HTGetLinkInfo ARGS6(
 			}
 			if (link_dest_intl) {
 			    char *cp2 = HTAnchor_address(link_dest_intl);
-#if 0
-			    char *cp = strchr(cp2, '#');
-			    if (cp && cp != cp2 &&
-				0!=strncmp(cp2, "LYNXIMGMAP:", 11)) {
-				StrAllocCopy(*lname, cp);
-				FREE(cp2);
-				return(WWW_INTERN_LINK_TYPE);
-			    } else {
-#endif
-				FREE(*lname);
-				*lname = cp2;
-				return(WWW_INTERN_LINK_TYPE);
-#if 0
-			    }
-#endif
+			    FREE(*lname);
+			    *lname = cp2;
+			    return(WWW_INTERN_LINK_TYPE);
 			} else
 #endif
 			    cp_freeme = HTAnchor_address(link_dest);
@@ -5054,11 +5031,11 @@ PUBLIC void www_user_search ARGS3(
 	}
 
 	if (case_sensitive && LYno_attr_char_strstr(line->data, target)) {
-	    tentative_result=count;
+	    tentative_result = count;
 	    break;
 	} else if (!case_sensitive &&
 		   LYno_attr_char_case_strstr(line->data, target)) {
-	    tentative_result=count;
+	    tentative_result = count;
 	    break;
 	} else if (line == HTMainText->last_line) {  /* next line */
 	    break;
@@ -5217,7 +5194,7 @@ PUBLIC void www_user_search ARGS3(
 		break;
 	    } else if (!case_sensitive &&
 		       LYno_attr_char_case_strstr(line->data, target)) {
-	        tentative_result=count;
+	        tentative_result = count;
 		break;
 	    } else if (count > start_line) {  /* next line */
 		_user_message(STRING_NOT_FOUND, target);
@@ -6785,11 +6762,11 @@ PRIVATE double get_trans_q ARGS2(
     int,		cs_from,
     char *,		givenmime)
 {
-    double dq = 0.0, df = 1.0;
-    UCTQ_t tq;
+    double df = 1.0;
+    BOOL tq;
     char *p;
     if (!givenmime || !(*givenmime))
-	return dq;
+	return 0.0;
     if ((p = strchr(givenmime,';')) != NULL) {
 	*p++ = '\0';
     }
@@ -6799,9 +6776,8 @@ PRIVATE double get_trans_q ARGS2(
     else
 	tq = UCCanTranslateFromTo(cs_from,
 				  UCGetLYhndl_byMIME(givenmime));
-    if (tq <= TQ_NO)
-	return dq;
-    dq = 1.0;
+    if (!tq)
+	return 0.0;
     if (p && *p) {
 	char *pair, *field = p, *pval, *ptok;
 	/* Get all the parameters to the Charset */
@@ -7083,9 +7059,9 @@ PUBLIC void HText_SubmitForm ARGS4(
 		    /* those specials will be trivial */
 		} else if (UCNeedNotTranslate(form_ptr->value_cs, target_cs)) {
 		    /* already ok */
-		} else if (UCCanTranslateFromTo(form_ptr->value_cs, target_cs) != TQ_NO) {
+		} else if (UCCanTranslateFromTo(form_ptr->value_cs, target_cs)) {
 		    /* also ok */
-		} else if (UCCanTranslateFromTo(target_cs, form_ptr->value_cs) != TQ_NO) {
+		} else if (UCCanTranslateFromTo(target_cs, form_ptr->value_cs)) {
 		    target_cs = form_ptr->value_cs;	/* try this */
 		    target_csname = NULL; /* will be set after loop */
 		} else {
@@ -7103,9 +7079,9 @@ PUBLIC void HText_SubmitForm ARGS4(
 		    /* those specials will be trivial */
 		} else if (UCNeedNotTranslate(form_ptr->name_cs, target_cs)) {
 		    /* already ok */
-		} else if (UCCanTranslateFromTo(form_ptr->name_cs, target_cs) != TQ_NO) {
+		} else if (UCCanTranslateFromTo(form_ptr->name_cs, target_cs)) {
 		    /* also ok */
-		} else if (UCCanTranslateFromTo(target_cs, form_ptr->name_cs) != TQ_NO) {
+		} else if (UCCanTranslateFromTo(target_cs, form_ptr->name_cs)) {
 		    target_cs = form_ptr->value_cs;	/* try this */
 		    target_csname = NULL; /* will be set after loop */
 		} else {
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 04c624a2..19d13a1f 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -890,6 +890,35 @@ Prepend_BASE:
 		anchor->address, (temp ? temp : anchor->address));
 	FREE(temp);
     }
+        if (LYPrependCharsetToSource &&
+	!strncasecomp(pres->rep->name, "text/html", 9) &&
+	!anchor->content_encoding) {
+	/*
+	 *  Add the document's charset as a META CHARSET tag
+	 *  at the top of the file, so HTTP charset header
+	 *  will not be forgotten when a document saved as local file.
+	 *  We add this line only(!) if HTTP charset present. - LP
+	 *  Note that the markup will be technically invalid if a DOCTYPE
+	 *  declaration, or HTML or HEAD tags, are present, and thus the
+	 *  file may need editing for perfection. - FM
+	 */
+
+/* ++++ Not checked in detail - whether we may use anchor->charset
+or should find something else in HTAnchor.c or HTMime.c - LP.
++++++++++ */
+
+	char *temp = NULL;
+
+	if (anchor->charset && *anchor->charset) {
+	    StrAllocCopy(temp, anchor->charset);
+	    collapse_spaces(temp);
+		fprintf(ret_obj->fp,
+		"<META HTTP-EQUIV=\"Content-Type\" "
+		"CONTENT=\"text/html; charset=%s\">\n\n",
+		temp);
+	}
+	FREE(temp);
+    }
     return ret_obj;
 }
 
diff --git a/src/HTML.c b/src/HTML.c
index 831d02b1..9ea85b1f 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -76,8 +76,8 @@ extern HTStyleSheet * styleSheet;	/* Application-wide */
 
 /*	Module-wide style cache
 */
-PRIVATE int 		got_styles = 0;
-PRIVATE HTStyle *styles[HTML_ELEMENTS+31]; /* adding 24 nested list styles  */
+PRIVATE int		got_styles = 0;
+PUBLIC  HTStyle *styles[HTML_ELEMENTS+31]; /* adding 24 nested list styles  */
 					   /* and 3 header alignment styles */
 					   /* and 3 div alignment styles    */
 PRIVATE HTStyle *default_style;
@@ -98,26 +98,21 @@ PRIVATE void HTML_end_element PARAMS((HTStructured *me,
 /*		Forward declarations of routines
 */
 PRIVATE void get_styles NOPARAMS;
-PRIVATE void actually_set_style PARAMS((HTStructured * me));
 PRIVATE void change_paragraph_style PARAMS((HTStructured * me,
 					    HTStyle * style));
 
-/*	Style buffering avoids dummy paragraph begin/ends.
-*/
-#define UPDATE_STYLE if (me->style_change) { actually_set_style(me); }
-
 /*	Set an internal flag that the next call to a stack-affecting method
 **	is only internal and the stack manipulation should be skipped. - kw
 */
 #define SET_SKIP_STACK(el_num) if (HTML_dtd.tags[el_num].contents != SGML_EMPTY) \
-                          			{ me->skip_stack++; }
+						{ me->skip_stack++; }
 
 extern int hash_code PARAMS((char* i));
 
 PUBLIC void strtolower ARGS1(char*, i)
 {
-        if (!i) return;
-        while (*i) { *i=tolower(*i); i++; }
+	if (!i) return;
+	while (*i) { *i=tolower(*i); i++; }
 }
 
 /*		Flattening the style structure
@@ -132,16 +127,16 @@ a sequence of styles.
 /*
 **  If style really needs to be set, call this.
 */
-PRIVATE void actually_set_style ARGS1(HTStructured *, me)
+PUBLIC void actually_set_style ARGS1(HTStructured *, me)
 {
     if (!me->text) {			/* First time through */
 	LYGetChartransInfo(me);
 	UCSetTransParams(&me->T,
 		     me->UCLYhndl, me->UCI,
 			 HTAnchor_getUCLYhndl(me->node_anchor,
-			 		      UCT_STAGE_HTEXT),
+					      UCT_STAGE_HTEXT),
 			 HTAnchor_getUCInfoStage(me->node_anchor,
-			 			 UCT_STAGE_HTEXT));
+						 UCT_STAGE_HTEXT));
 	me->text = HText_new2(me->node_anchor, me->target);
 	HText_beginAppend(me->text);
 	HText_setStyle(me->text, me->new_style);
@@ -161,7 +156,7 @@ PRIVATE void actually_set_style ARGS1(HTStructured *, me)
 PRIVATE void change_paragraph_style ARGS2(HTStructured *, me, HTStyle *,style)
 {
     if (me->new_style != style) {
-    	me->style_change = YES;
+	me->style_change = YES;
 	me->new_style = style;
     }
     me->in_word = NO;
@@ -169,7 +164,7 @@ PRIVATE void change_paragraph_style ARGS2(HTStructured *, me, HTStyle *,style)
 
 /*_________________________________________________________________________
 **
-**			A C T I O N 	R O U T I N E S
+**			A C T I O N	R O U T I N E S
 */
 
 /*	Character handling
@@ -178,19 +173,19 @@ PRIVATE void change_paragraph_style ARGS2(HTStructured *, me, HTStyle *,style)
 PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 {
     /*
-     *  Ignore all non-MAP content when just
-     *  scanning a document for MAPs. - FM
+     *	Ignore all non-MAP content when just
+     *	scanning a document for MAPs. - FM
      */
     if (LYMapsOnly)
-        return;
+	return;
 
     /*
-     *  Do EOL conversion if needed. - FM
+     *	Do EOL conversion if needed. - FM
      *
-     *  Convert EOL styles:
-     *   macintosh:  cr    --> lf
-     *   ascii:      cr-lf --> lf
-     *   unix:       lf    --> lf
+     *	Convert EOL styles:
+     *	 macintosh:  cr    --> lf
+     *	 ascii:      cr-lf --> lf
+     *	 unix:	     lf    --> lf
      */
     if ((me->lastraw == '\r') && c == '\n') {
 	me->lastraw = -1;
@@ -201,59 +196,59 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 	c = '\n';
 
     /*
-     *  Handle SGML_LITTERAL tags that have HTChunk elements. - FM
+     *	Handle SGML_LITTERAL tags that have HTChunk elements. - FM
      */
     switch (me->sp[0].tag_number) {
 
     case HTML_COMMENT:
-    	return;	/* Do Nothing */
+	return; /* Do Nothing */
 
     case HTML_TITLE:
-        if (c == LY_SOFT_HYPHEN)
+	if (c == LY_SOFT_HYPHEN)
 	    return;
 	if (c != '\n' && c != '\t' && c != '\r')
-    	    HTChunkPutc(&me->title, c);
+	    HTChunkPutc(&me->title, c);
 	else
-    	    HTChunkPutc(&me->title, ' ');
+	    HTChunkPutc(&me->title, ' ');
 	return;
 
     case HTML_STYLE:
 	HTChunkPutc(&me->style_block, c);
-        return;
+	return;
 
     case HTML_SCRIPT:
 	HTChunkPutc(&me->script, c);
-        return;
+	return;
 
     case HTML_OBJECT:
-    	HTChunkPutc(&me->object, c);
+	HTChunkPutc(&me->object, c);
 	return;
 
     case HTML_TEXTAREA:
-    	HTChunkPutc(&me->textarea, c);
+	HTChunkPutc(&me->textarea, c);
 	return;
 
     case HTML_SELECT:
     case HTML_OPTION:
-    	HTChunkPutc(&me->option, c);
+	HTChunkPutc(&me->option, c);
 	return;
 
     case HTML_MATH:
-    	HTChunkPutc(&me->math, c);
+	HTChunkPutc(&me->math, c);
 	return;
 
     default:
 	if (me->inSELECT) {
 	    /*
-	     *  If we are within a SELECT not caught by the cases
-	     *  above - HTML_SELECT or HTML_OPTION may not be the
-	     *  last element pushed on the style stack if there were
-	     *  invalid markup tags within a SELECT element.  For error
-	     *  recovery, treat text as part of the OPTION text, it is
-	     *  probably meant to show up as user-visible text.
-	     *  Having A as an open element while in SELECT is really sick,
-	     *  don't make anchor text part of the option text in that case
-	     *  since the option text will probably just be discarded. - kw
+	     *	If we are within a SELECT not caught by the cases
+	     *	above - HTML_SELECT or HTML_OPTION may not be the
+	     *	last element pushed on the style stack if there were
+	     *	invalid markup tags within a SELECT element.  For error
+	     *	recovery, treat text as part of the OPTION text, it is
+	     *	probably meant to show up as user-visible text.
+	     *	Having A as an open element while in SELECT is really sick,
+	     *	don't make anchor text part of the option text in that case
+	     *	since the option text will probably just be discarded. - kw
 	     */
 	    if (me->sp[0].tag_number == HTML_A)
 		break;
@@ -264,7 +259,7 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
     } /* end first switch */
 
     /*
-     *  Handle all other tag content. - FM
+     *	Handle all other tag content. - FM
      */
     switch (me->sp[0].tag_number) {
 
@@ -298,16 +293,16 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 	break;
 
     default:
-        /*
+	/*
 	 *  Free format text.
 	 */
 	if (!strcmp(me->sp->style->name,"Preformatted")) {
 	    if (c != '\r' &&
-	        !(c == '\n' && me->inLABEL && !me->inP) &&
+		!(c == '\n' && me->inLABEL && !me->inP) &&
 		!(c == '\n' && !me->inPRE)) {
 		me->inP = TRUE;
 		me->inLABEL = FALSE;
-	        HText_appendCharacter(me->text, c);
+		HText_appendCharacter(me->text, c);
 	    }
 	    me->inPRE = TRUE;
 
@@ -316,30 +311,30 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 	    if (c != '\r') {
 		me->inP = TRUE;
 		me->inLABEL = FALSE;
-	        HText_appendCharacter(me->text, c);
+		HText_appendCharacter(me->text, c);
 	    }
 
 	} else {
 	    if (me->style_change) {
-	        if ((c == '\n') || (c == ' '))
+		if ((c == '\n') || (c == ' '))
 		    return;	/* Ignore it */
-	        UPDATE_STYLE;
+		UPDATE_STYLE;
 	    }
 	    if (c == '\n') {
-	        if (me->in_word) {
-	            if (HText_getLastChar(me->text) != ' ') {
+		if (me->in_word) {
+		    if (HText_getLastChar(me->text) != ' ') {
 			me->inP = TRUE;
 			me->inLABEL = FALSE;
-		        HText_appendCharacter(me->text, ' ');
+			HText_appendCharacter(me->text, ' ');
 		    }
 		    me->in_word = NO;
-	        }
+		}
 
 	    } else if (c == ' ' || c == '\t') {
-	        if (HText_getLastChar(me->text) != ' ') {
+		if (HText_getLastChar(me->text) != ' ') {
 		    me->inP = TRUE;
 		    me->inLABEL = FALSE;
-	            HText_appendCharacter(me->text, ' ');
+		    HText_appendCharacter(me->text, ' ');
 		}
 
 	    } else if (c == '\r') {
@@ -348,14 +343,14 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 	    } else {
 		me->inP = TRUE;
 		me->inLABEL = FALSE;
-	        HText_appendCharacter(me->text, c);
-	        me->in_word = YES;
+		HText_appendCharacter(me->text, c);
+		me->in_word = YES;
 	    }
 	}
     } /* end second switch */
 
     if (c == '\n' || c == '\t') {
-     	HText_setLastChar(me->text, ' '); /* set it to a generic seperater */
+	HText_setLastChar(me->text, ' '); /* set it to a generic seperater */
 
 	/*
 	 *  \r's are ignored.  In order to keep collapsing spaces
@@ -363,9 +358,9 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 	 *  seperater if there was one
 	 */
     } else if (c == '\r' && HText_getLastChar(me->text) == ' ') {
-     	HText_setLastChar(me->text, ' '); /* set it to a generic seperater */
+	HText_setLastChar(me->text, ' '); /* set it to a generic seperater */
     } else {
-     	HText_setLastChar(me->text, c);
+	HText_setLastChar(me->text, c);
     }
 }
 
@@ -383,19 +378,19 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
     switch (me->sp[0].tag_number) {
 
     case HTML_COMMENT:
-    	break;					/* Do Nothing */
+	break;					/* Do Nothing */
 
     case HTML_TITLE:
-    	HTChunkPuts(&me->title, s);
+	HTChunkPuts(&me->title, s);
 	break;
 
     case HTML_STYLE:
 	HTChunkPuts(&me->style_block, s);
-        break;
+	break;
 
     case HTML_SCRIPT:
-    	HTChunkPuts(&me->script, s);
-        break;
+	HTChunkPuts(&me->script, s);
+	break;
 
     case HTML_PRE:				/* Formatted text */
     case HTML_LISTING:				/* Litteral text */
@@ -404,32 +399,32 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
 	/*
 	 *  We guarrantee that the style is up-to-date in begin_litteral
 	 */
-    	HText_appendText(me->text, s);
+	HText_appendText(me->text, s);
 	break;
 
     case HTML_OBJECT:
-    	HTChunkPuts(&me->object, s);
+	HTChunkPuts(&me->object, s);
 	break;
 
     case HTML_TEXTAREA:
-    	HTChunkPuts(&me->textarea, s);
+	HTChunkPuts(&me->textarea, s);
 	break;
 
     case HTML_SELECT:
     case HTML_OPTION:
-    	HTChunkPuts(&me->option, s);
+	HTChunkPuts(&me->option, s);
 	break;
 
     case HTML_MATH:
-    	HTChunkPuts(&me->math, s);
+	HTChunkPuts(&me->math, s);
 	break;
 
     default:					/* Free format text? */
 	if (!me->sp->style->freeFormat) {
 	    /*
-	     *  If we are within a preformatted text style not caught
-	     *  by the cases above (HTML_PRE or similar may not be the
-	     *  last element pushed on the style stack). - kw
+	     *	If we are within a preformatted text style not caught
+	     *	by the cases above (HTML_PRE or similar may not be the
+	     *	last element pushed on the style stack). - kw
 	     */
 	    HText_appendText(me->text, s);
 	    break;
@@ -447,9 +442,9 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
 	    for (; *p; p++) {
 		if (*p == 13 && p[1] != 10) {
 		    /*
-		     *  Treat any '\r' which is not followed by '\n'
-		     *  as '\n', to account for macintosh lineend in
-		     *  ALT attributes etc. - kw
+		     *	Treat any '\r' which is not followed by '\n'
+		     *	as '\n', to account for macintosh lineend in
+		     *	ALT attributes etc. - kw
 		     */
 		    c = '\n';
 		} else {
@@ -462,7 +457,7 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
 		}
 		if (c == '\n') {
 		    if (me->in_word) {
-		        if (HText_getLastChar(me->text) != ' ')
+			if (HText_getLastChar(me->text) != ' ')
 			    HText_appendCharacter(me->text, ' ');
 			me->in_word = NO;
 		    }
@@ -479,21 +474,21 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
 		}
 
 		/* set the Last Character */
-    		if (c == '\n' || c == '\t') {
+		if (c == '\n' || c == '\t') {
 		    /* set it to a generic seperater */
-        	    HText_setLastChar(me->text, ' ');
-    		} else if (c == '\r' &&
+		    HText_setLastChar(me->text, ' ');
+		} else if (c == '\r' &&
 			   HText_getLastChar(me->text) == ' ') {
 		    /*
-		     *  \r's are ignored.  In order to keep collapsing
-		     *  spaces correctly, we must default back to the
-		     *  previous seperator, if there was one.  So we
-		     *  set LastChar to a generic seperater.
+		     *	\r's are ignored.  In order to keep collapsing
+		     *	spaces correctly, we must default back to the
+		     *	previous seperator, if there was one.  So we
+		     *	set LastChar to a generic seperater.
 		     */
-       		    HText_setLastChar(me->text, ' ');
-    		} else {
-       		    HText_setLastChar(me->text, c);
-    		}
+		    HText_setLastChar(me->text, ' ');
+		} else {
+		    HText_setLastChar(me->text, c);
+		}
 
 	    } /* for */
 	}
@@ -509,27 +504,27 @@ PUBLIC void HTML_write ARGS3(HTStructured *, me, CONST char*, s, int, l)
     CONST char* e = s+l;
 
     if (LYMapsOnly)
-        return;
+	return;
 
     for (p = s; s < e; p++)
-        HTML_put_character(me, *p);
+	HTML_put_character(me, *p);
 }
 
 /*
  *  "Internal links" are hyperlinks whose source and destination are
  *  within the same document, and for which the destination is given
  *  as a URL Reference with an empty URL, but possibly with a non-empty
- *  #fragment.  (This terminology re URL-Reference vs. URL follows the
+ *  #fragment.	(This terminology re URL-Reference vs. URL follows the
  *  Fielding URL syntax and semantics drafts).
  *  Differences:
  *  (1) The document's base (in whatever way it is given) is not used for
- *      resolving internal link references.
+ *	resolving internal link references.
  *  (2) Activating an internal link should not result in a new retrieval
- *      of a copy of the document.
+ *	of a copy of the document.
  *  (3) Internal links are the only way to refer with a hyperlink to a document
- *      (or a location in it) which is only known as the result of a POST
- *      request (doesn't have a URL from which the document can be retrieved
- *      with GET), and can only be used from within that document.
+ *	(or a location in it) which is only known as the result of a POST
+ *	request (doesn't have a URL from which the document can be retrieved
+ *	with GET), and can only be used from within that document.
  *
  * *If DONT_TRACK_INTERNAL_LINKS is not defined, we keep track of whether a
  *  link destination was given as an internal link.  This information is
@@ -540,12 +535,12 @@ PUBLIC void HTML_write ARGS3(HTStructured *, me, CONST char*, s, int, l)
  *  of the base URL.
  *  Examples:  (replace [...] to have a valid absolute URL)
  *  In document retrieved from [...]/mypath/mydoc.htm w/ base [...]/otherpath/
- *  a. HREF="[...]/mypath/mydoc.htm"      -> [...]/mypath/mydoc.htm
+ *  a. HREF="[...]/mypath/mydoc.htm"	  -> [...]/mypath/mydoc.htm
  *  b. HREF="[...]/mypath/mydoc.htm#frag" -> [...]/mypath/mydoc.htm#frag
- *  c. HREF="mydoc.htm"                   -> [...]/otherpath/mydoc.htm
- *  d. HREF="mydoc.htm#frag"              -> [...]/otherpath/mydoc.htm#frag
- *  e. HREF=""                -> [...]/mypath/mydoc.htm      (marked internal)
- *  f. HREF="#frag"           -> [...]/mypath/mydoc.htm#frag (marked internal)
+ *  c. HREF="mydoc.htm" 		  -> [...]/otherpath/mydoc.htm
+ *  d. HREF="mydoc.htm#frag"		  -> [...]/otherpath/mydoc.htm#frag
+ *  e. HREF=""		      -> [...]/mypath/mydoc.htm      (marked internal)
+ *  f. HREF="#frag"	      -> [...]/mypath/mydoc.htm#frag (marked internal)
  *
  * *If DONT_TRACK_INTERNAL_LINKS is defined, URL-less URL-References are
  *  resolved differently from URL-References with a non-empty URL (using the
@@ -562,7 +557,7 @@ PUBLIC void HTML_write ARGS3(HTStructured *, me, CONST char*, s, int, l)
 #ifndef DONT_TRACK_INTERNAL_LINKS
 /* A flag is used to keep track of whether an "URL reference" encountered
    had a real "URL" or not. In the latter case, it will be marked as
-   "internal".  The flag is set before we start messing around with the
+   "internal".	The flag is set before we start messing around with the
    string (resolution of relative URLs etc.). This variable only used
    locally here, don't confuse with LYinternal_flag which is for
    for overriding non-caching similar to LYoverride_no_cache. - kw */
@@ -589,15 +584,13 @@ char prevailing_class[TEMPSTRINGSIZE];
     int hcode;
 #endif
 
-#define CHECK_ID(code) LYCheckForID(me, present, value, (int)code)
-
 /*	Start Element
 **	-------------
 */
 PRIVATE void HTML_start_element ARGS6(
 	HTStructured *, 	me,
 	int,			element_number,
-	CONST BOOL*,	 	present,
+	CONST BOOL*,		present,
 	CONST char **,		value,
 	int,			tag_charset,
 	char **,		include)
@@ -607,20 +600,21 @@ PRIVATE void HTML_start_element ARGS6(
     char *href = NULL;
     char *map_href = NULL;
     char *title = NULL;
-    char *I_value = NULL, *I_name = NULL;
+    char *I_value = NULL;
+    char *I_name = NULL;
     char *temp = NULL;
     int dest_char_set  = -1;
     HTParentAnchor *dest = NULL;	     /* An anchor's destination */
-    BOOL dest_ismap = FALSE;	     	     /* Is dest an image map script? */
+    BOOL dest_ismap = FALSE;		     /* Is dest an image map script? */
     BOOL UseBASE = TRUE;		     /* Resoved vs. BASE if present? */
-    HTChildAnchor *ID_A = NULL;		     /* HTML_foo_ID anchor */
+    HTChildAnchor *ID_A = NULL; 	     /* HTML_foo_ID anchor */
     int url_type = 0, i = 0;
     BOOL intern_flag = FALSE;
     char *cp = NULL;
     int ElementNumber = element_number;
 
     if (LYMapsOnly) {
-        if (!(ElementNumber == HTML_MAP || ElementNumber == HTML_AREA ||
+	if (!(ElementNumber == HTML_MAP || ElementNumber == HTML_AREA ||
 	      ElementNumber == HTML_BASE)) {
 	    return;
 	}
@@ -635,70 +629,66 @@ PRIVATE void HTML_start_element ARGS6(
 
 /* this should be done differently */
 #if defined(USE_COLOR_STYLE)
-        strcat (Style_className, ";");
-        strcat (Style_className, HTML_dtd.tags[element_number].name);
-        strcpy (myHash, HTML_dtd.tags[element_number].name);
-        if (class_string[0])
-        {
-                strcat (Style_className, ".");
-                strcat (Style_className, class_string);
-                strcat (myHash, ".");
-                strcat (myHash, class_string);
+	strcat (Style_className, ";");
+	strcat (Style_className, HTML_dtd.tags[element_number].name);
+	strcpy (myHash, HTML_dtd.tags[element_number].name);
+	if (class_string[0])
+	{
+		strcat (Style_className, ".");
+		strcat (Style_className, class_string);
+		strcat (myHash, ".");
+		strcat (myHash, class_string);
 #ifdef PREVAIL
-                strcpy (prevailing_class, class_string);
+		strcpy (prevailing_class, class_string);
 #endif
-        }
+	}
 #ifdef PREVAIL
-        else if (prevailing_class[0])
-        {
-                strcat (Style_className, ".");
-                strcat (Style_className, prevailing_class);
-                strcat (myHash, ".");
-                strcat (myHash, prevailing_class);
-        }
+	else if (prevailing_class[0])
+	{
+		strcat (Style_className, ".");
+		strcat (Style_className, prevailing_class);
+		strcat (myHash, ".");
+		strcat (myHash, prevailing_class);
+	}
 #endif /* PREVAIL */
-        class_string[0]='\0';
-        strtolower(myHash);
-        hcode=hash_code(myHash);
-        strtolower(Style_className);
-
-        if (TRACE)
-        {
-                fprintf(stderr, "CSSTRIM:%s -> %d", myHash, hcode);
-                if (hashStyles[hcode].code!=hcode)
-                {
-                        char *rp=strrchr(myHash, '.');
-                        fprintf(stderr, " (undefined) %s\n", myHash);
-                        if (rp)
-                        {
-                                int hcd;
-                                *rp='\0'; /* trim the class */
-                                hcd = hash_code(myHash);
-                                fprintf(stderr, "CSS:%s -> %d", myHash, hcd);
-                                if (hashStyles[hcd].code!=hcd)
-                                        fprintf(stderr, " (undefined) %s\n", myHash);
-                                else
-                                        fprintf(stderr, " ca=%d\n", hashStyles[hcd].color);
-                        }
-                }
-                else
-                        fprintf(stderr, " ca=%d\n", hashStyles[hcode].color);
-        }
+	class_string[0]='\0';
+	strtolower(myHash);
+	hcode=hash_code(myHash);
+	strtolower(Style_className);
+
+	if (TRACE)
+	{
+		fprintf(stderr, "CSSTRIM:%s -> %d", myHash, hcode);
+		if (hashStyles[hcode].code!=hcode)
+		{
+			char *rp=strrchr(myHash, '.');
+			fprintf(stderr, " (undefined) %s\n", myHash);
+			if (rp)
+			{
+				int hcd;
+				*rp='\0'; /* trim the class */
+				hcd = hash_code(myHash);
+				fprintf(stderr, "CSS:%s -> %d", myHash, hcd);
+				if (hashStyles[hcd].code!=hcd)
+					fprintf(stderr, " (undefined) %s\n", myHash);
+				else
+					fprintf(stderr, " ca=%d\n", hashStyles[hcd].color);
+			}
+		}
+		else
+			fprintf(stderr, " ca=%d\n", hashStyles[hcode].color);
+	}
 
     if (displayStyles[element_number + STARTAT].color > -2) /* actually set */
     {
-        if (TRACE)
-                fprintf(stderr, "CSSTRIM: start_element: top <%s>\n", HTML_dtd.tags[element_number].name);
-        HText_characterStyle(me->text, hcode, 1);
+	if (TRACE)
+		fprintf(stderr, "CSSTRIM: start_element: top <%s>\n", HTML_dtd.tags[element_number].name);
+	HText_characterStyle(me->text, hcode, 1);
     }
 #endif /* USE_COLOR_STYLE */
 
-#if 0
-	me->inStyle[element_number]=1; /* this is a goodthing(tm) */
-#endif
-
     /*
-     *  Handle the start tag. - FM
+     *	Handle the start tag. - FM
      */
     switch (ElementNumber) {
 
@@ -709,20 +699,20 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_BASE:
-        if (present && present[HTML_BASE_HREF] &&
+	if (present && present[HTML_BASE_HREF] && !local_host_only &&
 	    value[HTML_BASE_HREF] && *value[HTML_BASE_HREF]) {
 	    char *base = NULL;
 	    char *related = NULL;
 
 	    StrAllocCopy(base, value[HTML_BASE_HREF]);
 	    if (!(url_type = LYLegitimizeHREF(me, (char**)&base,
-	    				      TRUE, TRUE))) {
-	        if (TRACE)
+					      TRUE, TRUE))) {
+		if (TRACE)
 		    fprintf(stderr,
-		    	    "HTML: BASE '%s' is not an absolute URL.\n",
+			    "HTML: BASE '%s' is not an absolute URL.\n",
 			    (base ? base : ""));
 		if (me->inBadBASE == FALSE)
-	            HTAlert(BASE_NOT_ABSOLUTE);
+		    HTAlert(BASE_NOT_ABSOLUTE);
 		me->inBadBASE = TRUE;
 	    }
 
@@ -746,40 +736,40 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Get parent's address for defaulted fields.
+	     *	Get parent's address for defaulted fields.
 	     */
 	    StrAllocCopy(related, me->node_anchor->address);
 
 	    /*
-	     *  Create the access field.
+	     *	Create the access field.
 	     */
 	    if ((temp = HTParse(base, related,
-	    			PARSE_ACCESS+PARSE_PUNCTUATION)) &&
+				PARSE_ACCESS+PARSE_PUNCTUATION)) &&
 		*temp != '\0') {
-	        StrAllocCopy(me->base_href, temp);
+		StrAllocCopy(me->base_href, temp);
 	    } else {
 		FREE(temp);
-	        StrAllocCopy(me->base_href, (temp = HTParse(related, "",
+		StrAllocCopy(me->base_href, (temp = HTParse(related, "",
 					 PARSE_ACCESS+PARSE_PUNCTUATION)));
 	    }
 	    FREE(temp);
 
 	    /*
-	     *  Create the host[:port] field.
+	     *	Create the host[:port] field.
 	     */
 	    if ((temp = HTParse(base, "",
-	    			PARSE_HOST+PARSE_PUNCTUATION)) &&
-	    	!strncmp(temp, "//", 2)) {
-	        StrAllocCat(me->base_href, temp);
+				PARSE_HOST+PARSE_PUNCTUATION)) &&
+		!strncmp(temp, "//", 2)) {
+		StrAllocCat(me->base_href, temp);
 		if (!strcmp(me->base_href, "file://")) {
 		    StrAllocCat(me->base_href, "localhost");
 		}
 	    } else {
-	        if (!strcmp(me->base_href, "file:")) {
+		if (!strcmp(me->base_href, "file:")) {
 		    StrAllocCat(me->base_href, "//localhost");
 		} else if (strcmp(me->base_href, "news:")) {
 		    FREE(temp);
-	            StrAllocCat(me->base_href, (temp = HTParse(related, "",
+		    StrAllocCat(me->base_href, (temp = HTParse(related, "",
 					    PARSE_HOST+PARSE_PUNCTUATION)));
 		}
 	    }
@@ -787,25 +777,25 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(related);
 
 	    /*
-	     *  Create the path field.
+	     *	Create the path field.
 	     */
 	    if ((temp = HTParse(base, "",
-	    			PARSE_PATH+PARSE_PUNCTUATION)) &&
+				PARSE_PATH+PARSE_PUNCTUATION)) &&
 		*temp != '\0') {
-	        StrAllocCat(me->base_href, temp);
+		StrAllocCat(me->base_href, temp);
 	    } else if (!strcmp(me->base_href, "news:")) {
-	        StrAllocCat(me->base_href, "*");
+		StrAllocCat(me->base_href, "*");
 	    } else if (!strncmp(me->base_href, "news:", 5) ||
-	    	       !strncmp(me->base_href, "nntp:", 5) ||
+		       !strncmp(me->base_href, "nntp:", 5) ||
 		       !strncmp(me->base_href, "snews:", 6)) {
-	        StrAllocCat(me->base_href, "/*");
+		StrAllocCat(me->base_href, "/*");
 	    } else {
-	        StrAllocCat(me->base_href, "/");
+		StrAllocCat(me->base_href, "/");
 	    }
 	    FREE(temp);
 	    FREE(base);
 
-            me->inBASE = TRUE;
+	    me->inBASE = TRUE;
 	    StrAllocCopy(me->node_anchor->content_base, me->base_href);
 	}
 	break;
@@ -816,7 +806,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_TITLE:
-        HTChunkClear(&me->title);
+	HTChunkClear(&me->title);
 	break;
 
     case HTML_LINK:
@@ -824,7 +814,7 @@ PRIVATE void HTML_start_element ARGS6(
 	if (present && present[HTML_LINK_HREF]) {
 	    CHECK_FOR_INTERN(value[HTML_LINK_HREF]);
 	    /*
-	     *  Prepare to do housekeeping on the reference. - FM
+	     *	Prepare to do housekeeping on the reference. - FM
 	     */
 	    if (!value[HTML_LINK_HREF]) {
 		if (me->inBASE && me->base_href && *me->base_href) {
@@ -838,7 +828,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Check whether a base tag is in effect. - FM
+	     *	Check whether a base tag is in effect. - FM
 	     */
 	    if ((me->inBASE && *href != '\0' && *href != '#') &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
@@ -850,31 +840,31 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((*href != '\0' && *href != '#' &&
-			         me->inBASE) ?
+				 me->inBASE) ?
 			       me->base_href : me->node_anchor->address));
 
 	    /*
-	     *  Handle links with a REV attribute. - FM
+	     *	Handle links with a REV attribute. - FM
 	     */
 	    if (present &&
-	        present[HTML_LINK_REV] && value[HTML_LINK_REV]) {
+		present[HTML_LINK_REV] && value[HTML_LINK_REV]) {
 		/*
 		 *  Handle REV="made" or REV="owner". - LM & FM
 		 */
-	        if (!strcasecomp("made", value[HTML_LINK_REV]) ||
+		if (!strcasecomp("made", value[HTML_LINK_REV]) ||
 		    !strcasecomp("owner", value[HTML_LINK_REV])) {
 		    /*
-		     *  Load the owner element. - FM
+		     *	Load the owner element. - FM
 		     */
 		    if (!is_url(href)) {
-		        temp = HTParse(href,
+			temp = HTParse(href,
 				       (me->inBASE ?
 				     me->base_href : me->node_anchor->address),
-				        PARSE_ALL);
+					PARSE_ALL);
 			StrAllocCopy(href, temp);
 			FREE(temp);
 			LYFillLocalFileURL((char **)&href,
@@ -884,16 +874,16 @@ PRIVATE void HTML_start_element ARGS6(
 		    }
 		    HTAnchor_setOwner(me->node_anchor, href);
 		    if (TRACE)
-		        fprintf(stderr,
+			fprintf(stderr,
 				"HTML: DOC OWNER '%s' found\n", href);
 		    FREE(href);
 
 		    /*
-		     *  Load the RevTitle element if a TITLE attribute
-		     *  and value are present. - FM
+		     *	Load the RevTitle element if a TITLE attribute
+		     *	and value are present. - FM
 		     */
 		    if (present && present[HTML_LINK_TITLE] &&
-		        value[HTML_LINK_TITLE] &&
+			value[HTML_LINK_TITLE] &&
 			*value[HTML_LINK_TITLE] != '\0') {
 			StrAllocCopy(title, value[HTML_LINK_TITLE]);
 			TRANSLATE_AND_UNESCAPE_ENTITIES(&title, TRUE, FALSE);
@@ -908,17 +898,17 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Handle REL links. - FM
+	     *	Handle REL links. - FM
 	     */
 	    if (present &&
-	        present[HTML_LINK_REL] && value[HTML_LINK_REL]) {
+		present[HTML_LINK_REL] && value[HTML_LINK_REL]) {
 		/*
 		 *  Ignore style sheets, for now. - FM
 		 */
 		if (!strcasecomp(value[HTML_LINK_REL], "StyleSheet") ||
 		    !strcasecomp(value[HTML_LINK_REL], "Style")) {
 		    if (TRACE) {
-		        fprintf(stderr,
+			fprintf(stderr,
 				"HTML: StyleSheet link found.\n");
 		    }
 #ifdef LINKEDSTYLES
@@ -1004,11 +994,11 @@ PRIVATE void HTML_start_element ARGS6(
 		    !strcasecomp(value[HTML_LINK_REL], "Chapter") ||
 		    !strcasecomp(value[HTML_LINK_REL], "Documentation") ||
 		    !strcasecomp(value[HTML_LINK_REL], "Biblioentry") ||
- 		    !strcasecomp(value[HTML_LINK_REL], "Bibliography")) {
+		    !strcasecomp(value[HTML_LINK_REL], "Bibliography")) {
 		    StrAllocCopy(title, value[HTML_LINK_REL]);
 		} else {
 		    if (TRACE) {
-		        fprintf(stderr,
+			fprintf(stderr,
 				"HTML: LINK with REL=\"%s\" ignored.\n",
 				 value[HTML_LINK_REL]);
 		    }
@@ -1019,17 +1009,17 @@ PRIVATE void HTML_start_element ARGS6(
 	} else if (present &&
 		   present[HTML_LINK_REL] && value[HTML_LINK_REL]) {
 	    /*
-	     *  If no HREF was specified, handle special REL links
-	     *  with self-designated HREFs. - FM
+	     *	If no HREF was specified, handle special REL links
+	     *	with self-designated HREFs. - FM
 	     */
 	    if (!strcasecomp(value[HTML_LINK_REL], "Home")) {
-	        StrAllocCopy(href, LynxHome);
+		StrAllocCopy(href, LynxHome);
 	    } else if (!strcasecomp(value[HTML_LINK_REL], "Help")) {
-	        StrAllocCopy(href, helpfile);
+		StrAllocCopy(href, helpfile);
 	    } else if (!strcasecomp(value[HTML_LINK_REL], "Index")) {
-	        StrAllocCopy(href, indexfile);
+		StrAllocCopy(href, indexfile);
 	    } else {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr,
 			    "HTML: LINK with REL=\"%s\" and no HREF ignored.\n",
 			    value[HTML_LINK_REL]);
@@ -1040,9 +1030,9 @@ PRIVATE void HTML_start_element ARGS6(
 	}
 	if (href) {
 	    /*
-	     *  Create a title (link name) from the TITLE value,
-	     *  if present, or default to the REL value that was
-	     *  loaded into title. - FM
+	     *	Create a title (link name) from the TITLE value,
+	     *	if present, or default to the REL value that was
+	     *	loaded into title. - FM
 	     */
 	    if (present && present[HTML_LINK_TITLE] &&
 		value[HTML_LINK_TITLE] && *value[HTML_LINK_TITLE] != '\0') {
@@ -1052,13 +1042,13 @@ PRIVATE void HTML_start_element ARGS6(
 		LYTrimTail(title);
 	    }
 	    if (!(title && *title)) {
-	        FREE(href);
+		FREE(href);
 		FREE(title);
 		break;
 	    }
 
 	    if (me->inA) {
-	        /*
+		/*
 		 *  Ugh!  The LINK tag, which is a HEAD element,
 		 *  is in an Anchor, which is BODY element.  All
 		 *  we can do is close the Anchor and cross our
@@ -1069,25 +1059,25 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Create anchors for the links that simulate
-	     *  a toolbar. - FM
+	     *	Create anchors for the links that simulate
+	     *	a toolbar. - FM
 	     */
 	    me->CurrentA = HTAnchor_findChildAndLink(
 				me->node_anchor,	/* Parent */
-		    		NULL,			/* Tag */
-		    		href,			/* Addresss */
-		    		INTERN_LT);		/* Type */
+				NULL,			/* Tag */
+				href,			/* Addresss */
+				INTERN_LT);		/* Type */
 	    if ((dest = HTAnchor_parent(
 			    HTAnchor_followMainLink((HTAnchor*)me->CurrentA)
-			    	      )) != NULL) {
+				      )) != NULL) {
 		if (!HTAnchor_title(dest))
 		    HTAnchor_setTitle(dest, title);
 		dest = NULL;
-	        if (present[HTML_LINK_CHARSET] &&
+		if (present[HTML_LINK_CHARSET] &&
 		    value[HTML_LINK_CHARSET] && *value[HTML_LINK_CHARSET] != '\0') {
 		    dest_char_set = UCGetLYhndl_byMIME(value[HTML_LINK_CHARSET]);
 		    if (dest_char_set < 0)
-		        dest_char_set = UCLYhndl_for_unrec;
+			dest_char_set = UCLYhndl_for_unrec;
 		}
 		if (dest && dest_char_set >= 0)
 		    HTAnchor_setUCInfoStage(dest, dest_char_set,
@@ -1110,7 +1100,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 	    HText_beginAnchor(me->text, me->inUnderline, me->CurrentA);
 	    if (me->inBoldH == FALSE)
-	        HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
+		HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
 #ifdef USE_COLOR_STYLE
 	    if (present && present[HTML_LINK_CLASS] &&
 	    value && *value[HTML_LINK_CLASS]!='\0')
@@ -1128,12 +1118,10 @@ PRIVATE void HTML_start_element ARGS6(
 		HText_characterStyle(me->text, hash_code(tmp), 0);
 	    }
 	    else
-		HTML_put_string(me, title);
-#else
-	    HTML_put_string(me, title);
 #endif
+	    HTML_put_string(me, title);
 	    if (me->inBoldH == FALSE)
-	        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+		HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 	    HText_endAnchor(me->text, 0);
 	}
 	FREE(href);
@@ -1148,46 +1136,46 @@ PRIVATE void HTML_start_element ARGS6(
 	    char * isindex_href = NULL;
 
 	    /*
-	     *  Lynx was supporting ACTION, which never made it into
-	     *  the HTTP 2.0 specs.  HTTP 3.0 uses HREF, so we'll
-	     *  use that too, but allow use of ACTION as an alternate
-	     *  until people have fully switched over. - FM
+	     *	Lynx was supporting ACTION, which never made it into
+	     *  the HTML 2.0 specs.  HTML 3.0 uses HREF, so we'll
+	     *	use that too, but allow use of ACTION as an alternate
+	     *	until people have fully switched over. - FM
 	     */
 	    if (present[HTML_ISINDEX_HREF] && value[HTML_ISINDEX_HREF])
-	        StrAllocCopy(isindex_href, value[HTML_ISINDEX_HREF]);
+		StrAllocCopy(isindex_href, value[HTML_ISINDEX_HREF]);
 	    else
-	        StrAllocCopy(isindex_href, value[HTML_ISINDEX_ACTION]);
+		StrAllocCopy(isindex_href, value[HTML_ISINDEX_ACTION]);
 	    url_type = LYLegitimizeHREF(me, (char**)&isindex_href,
-	    				TRUE, TRUE);
+					TRUE, TRUE);
 
 	    /*
-	     *  Check whether a base tag is in effect.
+	     *	Check whether a base tag is in effect.
 	     */
 	    if (me->inBASE && *isindex_href != '\0' && *isindex_href != '#')
 		action = HTParse(isindex_href, me->base_href, PARSE_ALL);
 	    if (!(action && *action))
-	        action = HTParse(isindex_href,
+		action = HTParse(isindex_href,
 				 me->node_anchor->address, PARSE_ALL);
 	    FREE(isindex_href);
 
 	    if (action && *action) {
-   	        HTAnchor_setIndex(me->node_anchor, action);
+		HTAnchor_setIndex(me->node_anchor, action);
 	    } else {
-	        HTAnchor_setIndex(me->node_anchor, me->node_anchor->address);
+		HTAnchor_setIndex(me->node_anchor, me->node_anchor->address);
 	    }
 	    FREE(action);
 
 	} else {
 	    if (me->inBASE)
-	        /*
-	         *  Use base.
-	         */
-   	        HTAnchor_setIndex(me->node_anchor, me->base_href);
+		/*
+		 *  Use base.
+		 */
+		HTAnchor_setIndex(me->node_anchor, me->base_href);
 	    else
-	        /*
-	         *  Use index's address.
-	         */
-   	        HTAnchor_setIndex(me->node_anchor, me->node_anchor->address);
+		/*
+		 *  Use index's address.
+		 */
+		HTAnchor_setIndex(me->node_anchor, me->node_anchor->address);
 	}
 	/*
 	 *  Support HTML 3.0 PROMPT attribute. - FM
@@ -1200,10 +1188,10 @@ PRIVATE void HTML_start_element ARGS6(
 	    LYTrimHead(temp);
 	    LYTrimTail(temp);
 	    if (*temp != '\0') {
-	        StrAllocCat(temp, " ");
+		StrAllocCat(temp, " ");
 		HTAnchor_setPrompt(me->node_anchor, temp);
 	    } else {
-	        HTAnchor_setPrompt(me->node_anchor,
+		HTAnchor_setPrompt(me->node_anchor,
 				   "Enter a database query: ");
 	    }
 	    FREE(temp);
@@ -1213,12 +1201,12 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_NEXTID:
-    	/* if (present && present[NEXTID_N] && value[NEXTID_N])
+	/* if (present && present[NEXTID_N] && value[NEXTID_N])
 		HText_setNextId(me->text, atoi(value[NEXTID_N])); */
-    	break;
+	break;
 
     case HTML_STYLE:
-    	/*
+	/*
 	 *  We're getting it as Litteral text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
@@ -1226,7 +1214,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_SCRIPT:
-    	/*
+	/*
 	 *  We're getting it as Litteral text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
@@ -1257,7 +1245,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 
 	    /*
-	     *  Check whether a base tag is in effect. - FM
+	     *	Check whether a base tag is in effect. - FM
 	     */
 	    if ((me->inBASE && *href != '\0' && *href != '#') &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
@@ -1269,11 +1257,11 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((*href != '\0' && *href != '#' &&
-			         me->inBASE) ?
+				 me->inBASE) ?
 			       me->base_href : me->node_anchor->address));
 
 	    if (me->inA) {
@@ -1287,10 +1275,10 @@ PRIVATE void HTML_start_element ARGS6(
 				INTERN_LT);		/* Type */
 	    LYEnsureSingleSpace(me);
 	    if (me->inUnderline == FALSE)
-	        HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
+		HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
 	    HTML_put_string(me, "FRAME:");
 	    if (me->inUnderline == FALSE)
-	        HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
+		HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
 	    HTML_put_character(me, ' ');
 	    me->in_word = NO;
 	    CHECK_ID(HTML_FRAME_ID);
@@ -1329,7 +1317,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 
 	    /*
-	     *  Check whether a base tag is in effect. - FM
+	     *	Check whether a base tag is in effect. - FM
 	     */
 	    if ((me->inBASE && *href != '\0' && *href != '#') &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
@@ -1341,11 +1329,11 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((*href != '\0' && *href != '#' &&
-			         me->inBASE) ?
+				 me->inBASE) ?
 			       me->base_href : me->node_anchor->address));
 
 	    if (me->inA)
@@ -1358,10 +1346,10 @@ PRIVATE void HTML_start_element ARGS6(
 	    LYEnsureDoubleSpace(me);
 	    LYResetParagraphAlignment(me);
 	    if (me->inUnderline == FALSE)
-	        HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
+		HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
 	    HTML_put_string(me, "IFRAME:");
 	    if (me->inUnderline == FALSE)
-	        HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
+		HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
 	    HTML_put_character(me, ' ');
 	    me->in_word = NO;
 	    CHECK_ID(HTML_IFRAME_ID);
@@ -1382,11 +1370,17 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_BANNER:
     case HTML_MARQUEE:
-    	change_paragraph_style(me, styles[HTML_BANNER]);
+	change_paragraph_style(me, styles[HTML_BANNER]);
 	UPDATE_STYLE;
 	if (me->sp->tag_number == ElementNumber)
 	    LYEnsureDoubleSpace(me);
-	if (!HText_hasToolbar(me->text) &&
+	/*
+	 *  Treat this as a toolbar if we don't have one
+	 *  yet, and we are in the first half of the
+	 *  first page. - FM
+	 */
+	if ((!HText_hasToolbar(me->text) &&
+	     HText_getLines(me->text) < (display_lines/2)) &&
 	    (ID_A = HTAnchor_findChildAndLink(
 					me->node_anchor,	/* Parent */
 					LYToolbarName,		/* Tag */
@@ -1404,29 +1398,29 @@ PRIVATE void HTML_start_element ARGS6(
 	if (me->Division_Level < (MAX_NESTING - 1)) {
 	    me->Division_Level++;
 	} else if (TRACE) {
-            fprintf(stderr,
+	    fprintf(stderr,
 		"HTML: ****** Maximum nesting of %d divisions exceeded!\n",
-            	MAX_NESTING);
+		MAX_NESTING);
 	}
 	if (ElementNumber == HTML_CENTER) {
 	    me->DivisionAlignments[me->Division_Level] = HT_CENTER;
-    	    change_paragraph_style(me, styles[HTML_DCENTER]);
+	    change_paragraph_style(me, styles[HTML_DCENTER]);
 	    UPDATE_STYLE;
 	    me->current_default_alignment = styles[HTML_DCENTER]->alignment;
 	} else if (present && present[HTML_DIV_ALIGN] &&
 		   value[HTML_DIV_ALIGN] && *value[HTML_DIV_ALIGN]) {
 	    if (!strcasecomp(value[HTML_DIV_ALIGN], "center")) {
-	        me->DivisionAlignments[me->Division_Level] = HT_CENTER;
+		me->DivisionAlignments[me->Division_Level] = HT_CENTER;
 		change_paragraph_style(me, styles[HTML_DCENTER]);
 		UPDATE_STYLE;
 		me->current_default_alignment = styles[HTML_DCENTER]->alignment;
 	    } else if (!strcasecomp(value[HTML_DIV_ALIGN], "right")) {
-	        me->DivisionAlignments[me->Division_Level] = HT_RIGHT;
+		me->DivisionAlignments[me->Division_Level] = HT_RIGHT;
 		change_paragraph_style(me, styles[HTML_DRIGHT]);
 		UPDATE_STYLE;
 		me->current_default_alignment = styles[HTML_DRIGHT]->alignment;
 	    } else {
-	        me->DivisionAlignments[me->Division_Level] = HT_LEFT;
+		me->DivisionAlignments[me->Division_Level] = HT_LEFT;
 		change_paragraph_style(me, styles[HTML_DLEFT]);
 		UPDATE_STYLE;
 		me->current_default_alignment = styles[HTML_DLEFT]->alignment;
@@ -1456,7 +1450,7 @@ PRIVATE void HTML_start_element ARGS6(
 	if (i_prior_style != -1) {
 	    HTML_end_element(me, i_prior_style);
 	}
-	i_prior_style = element_number;
+	i_prior_style = ElementNumber;
 	 */
 
 	/*
@@ -1476,14 +1470,14 @@ PRIVATE void HTML_start_element ARGS6(
 		UPDATE_STYLE;
 	    }
 	    /*
-	     *  Some authors use H# headers as a substitute for
-	     *  FONT, so check if this one immediately followed
-	     *  an LI.  If so, both me->inP and me->in_word will
-	     *  be FALSE (though the line might not be empty due
-	     *  to a bullet and/or nbsp) and we can assume it is
-	     *  just for a FONT change.  We thus will not create
-	     *  another line break nor add to the current left
-	     *  indentation. - FM
+	     *	Some authors use H# headers as a substitute for
+	     *	FONT, so check if this one immediately followed
+	     *	an LI.	If so, both me->inP and me->in_word will
+	     *	be FALSE (though the line might not be empty due
+	     *	to a bullet and/or nbsp) and we can assume it is
+	     *	just for a FONT change.  We thus will not create
+	     *	another line break nor add to the current left
+	     *	indentation. - FM
 	     */
 	    if (!(me->inP == FALSE && me->in_word == NO)) {
 		HText_appendParagraph(me->text);
@@ -1499,14 +1493,14 @@ PRIVATE void HTML_start_element ARGS6(
 	if (present && present[HTML_H_ALIGN] &&
 	    value[HTML_H_ALIGN] && *value[HTML_H_ALIGN]) {
 	    if (!strcasecomp(value[HTML_H_ALIGN], "center"))
-	        change_paragraph_style(me, styles[HTML_HCENTER]);
+		change_paragraph_style(me, styles[HTML_HCENTER]);
 	    else if (!strcasecomp(value[HTML_H_ALIGN], "right"))
-	        change_paragraph_style(me, styles[HTML_HRIGHT]);
+		change_paragraph_style(me, styles[HTML_HRIGHT]);
 	    else if (!strcasecomp(value[HTML_H_ALIGN], "left") ||
-	    	     !strcasecomp(value[HTML_H_ALIGN], "justify"))
-	        change_paragraph_style(me, styles[HTML_HLEFT]);
+		     !strcasecomp(value[HTML_H_ALIGN], "justify"))
+		change_paragraph_style(me, styles[HTML_HLEFT]);
 	    else
-	        change_paragraph_style(me, styles[ElementNumber]);
+		change_paragraph_style(me, styles[ElementNumber]);
 	} else if (me->Division_Level >= 0) {
 	    if (me->DivisionAlignments[me->Division_Level] == HT_CENTER) {
 		change_paragraph_style(me, styles[HTML_HCENTER]);
@@ -1516,7 +1510,7 @@ PRIVATE void HTML_start_element ARGS6(
 		change_paragraph_style(me, styles[HTML_HRIGHT]);
 	    }
 	} else {
-    	    change_paragraph_style(me, styles[ElementNumber]);
+	    change_paragraph_style(me, styles[ElementNumber]);
 	}
 	UPDATE_STYLE;
 	CHECK_ID(HTML_H_ID);
@@ -1525,95 +1519,18 @@ PRIVATE void HTML_start_element ARGS6(
 	     (ElementNumber == HTML_H1 && bold_H1 == TRUE)) &&
 	    (styles[ElementNumber]->font&HT_BOLD)) {
 	    if (me->inBoldA == FALSE && me->inBoldH == FALSE) {
-	        HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
+		HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
 	    }
 	    me->inBoldH = TRUE;
 	}
 	break;
 
     case HTML_P:
-	/*
-	 *  FIG content should be a true block, which like P inherits
-	 *  the current style.  APPLET is like character elements or
-	 *  an ALT attribute, unless it content contains a block element.
-	 *  If we encounter a P in either's content, we set flags to treat
-	 *  the content as a block.  - FM
-	 */
-	if (me->inFIG)
-	    me->inFIGwithP = TRUE;
-
-	if (me->inAPPLET)
-	    me->inAPPLETwithP = TRUE;
-
-	UPDATE_STYLE;
-	if (me->List_Nesting_Level >= 0) {
-	    /*
-	     *  We're in a list.  Treat P as an instruction to
-	     *  create one blank line, if not already present,
-	     *  then fall through to handle attributes, with
-	     *  the "second line" margins. - FM
-	     */
-	    if (me->inP) {
-	        if (me->inFIG || me->inAPPLET ||
-		    me->inCAPTION || me->inCREDIT ||
-		    me->sp->style->spaceAfter > 0 ||
-		    me->sp->style->spaceBefore > 0) {
-	            LYEnsureDoubleSpace(me);
-		} else {
-	            LYEnsureSingleSpace(me);
-		}
-	    }
-	} else if (me->sp[0].tag_number == HTML_ADDRESS) {
-	    /*
-	     *  We're in an ADDRESS. Treat P as an instruction
-	     *  to start a newline, if needed, then fall through
-	     *  to handle attributes. - FM
-	     */
-	    if (HText_LastLineSize(me->text, FALSE)) {
-		HText_setLastChar(me->text, ' ');  /* absorb white space */
-	        HText_appendCharacter(me->text, '\r');
-	    }
-	} else if (!(me->inLABEL && !me->inP)) {
-	    HText_appendParagraph(me->text);
-	    me->inLABEL = FALSE;
-	}
-	me->in_word = NO;
-
-	if (LYoverride_default_alignment(me)) {
-	    me->sp->style->alignment = styles[me->sp[0].tag_number]->alignment;
-	} else if (me->List_Nesting_Level >= 0 ||
-		   ((me->Division_Level < 0) &&
-		    (!strcmp(me->sp->style->name, "Normal") ||
-		     !strcmp(me->sp->style->name, "Preformatted")))) {
-	        me->sp->style->alignment = HT_LEFT;
-	} else {
-	    me->sp->style->alignment = me->current_default_alignment;
-	}
-	if (present && present[HTML_P_ALIGN] && value[HTML_P_ALIGN]) {
-	    if (!strcasecomp(value[HTML_P_ALIGN], "center") &&
-	        !(me->List_Nesting_Level >= 0 && !me->inP))
-	        me->sp->style->alignment = HT_CENTER;
-	    else if (!strcasecomp(value[HTML_P_ALIGN], "right") &&
-	        !(me->List_Nesting_Level >= 0 && !me->inP))
-	        me->sp->style->alignment = HT_RIGHT;
-	    else if (!strcasecomp(value[HTML_P_ALIGN], "left") ||
-	    	     !strcasecomp(value[HTML_P_ALIGN], "justify"))
-	        me->sp->style->alignment = HT_LEFT;
-	}
-
-	CHECK_ID(HTML_P_ID);
-
-	/*
-	 *  Mark that we are starting a new paragraph
-	 *  and don't have any of its text yet. - FM
-	 *
-	 */
-	me->inP = FALSE;
-
+	LYHandleP(me, present, value, (char **)&include, TRUE);
 	break;
 
     case HTML_BR:
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_GEN_ID);
 	if ((LYCollapseBRs == FALSE) ||
 	    HText_LastLineSize(me->text, FALSE)) {
@@ -1625,14 +1542,14 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_WBR:
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_GEN_ID);
 	HText_setBreakPoint(me->text);
 	break;
 
     case HTML_HY:
     case HTML_SHY:
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_GEN_ID);
 	HText_appendCharacter(me->text, LY_SOFT_HYPHEN);
 	break;
@@ -1642,27 +1559,27 @@ PRIVATE void HTML_start_element ARGS6(
 	    int width;
 
 	    /*
-	     *  Start a new line only if we had printable
-	     *  characters following the previous newline,
-	     *  or remove the previous line if both it and
-	     *  the last line are blank. - FM
+	     *	Start a new line only if we had printable
+	     *	characters following the previous newline,
+	     *	or remove the previous line if both it and
+	     *	the last line are blank. - FM
 	     */
 	    UPDATE_STYLE;
 	    if (HText_LastLineSize(me->text, FALSE)) {
 		HText_setLastChar(me->text, ' ');  /* absorb white space */
 		HText_appendCharacter(me->text, '\r');
 	    } else if (!HText_PreviousLineSize(me->text, FALSE)) {
-	        HText_RemovePreviousLine(me->text);
+		HText_RemovePreviousLine(me->text);
 	    }
 	    me->in_word = NO;
 	    me->inP = FALSE;
 
 	    /*
-	     *  Add an ID link if needed. - FM
+	     *	Add an ID link if needed. - FM
 	     */
 	    CHECK_ID(HTML_HR_ID);
 
-           /*
+	   /*
 	    *  Center lines within the current margins, if
 	    *  a right or left ALIGNment is not specified.
 	    *  If WIDTH="#%" is given and not garbage,
@@ -1670,7 +1587,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    *  use the default width. - FM
 	    */
 	    if (present && present[HTML_HR_ALIGN] && value[HTML_HR_ALIGN]) {
-	        if (!strcasecomp(value[HTML_HR_ALIGN], "right")) {
+		if (!strcasecomp(value[HTML_HR_ALIGN], "right")) {
 		    me->sp->style->alignment = HT_RIGHT;
 		} else if (!strcasecomp(value[HTML_HR_ALIGN], "left")) {
 		    me->sp->style->alignment = HT_LEFT;
@@ -1678,14 +1595,14 @@ PRIVATE void HTML_start_element ARGS6(
 		    me->sp->style->alignment = HT_CENTER;
 		}
 	    } else {
-	        me->sp->style->alignment = HT_CENTER;
+		me->sp->style->alignment = HT_CENTER;
 	    }
 	    width = LYcols - 1 -
 		    me->new_style->leftIndent - me->new_style->rightIndent;
 	    if (present && present[HTML_HR_WIDTH] && value[HTML_HR_WIDTH] &&
-	        isdigit(*value[HTML_HR_WIDTH]) &&
-	        value[HTML_HR_WIDTH][strlen(value[HTML_HR_WIDTH])-1] == '%') {
-	        char *percent = NULL;
+		isdigit(*value[HTML_HR_WIDTH]) &&
+		value[HTML_HR_WIDTH][strlen(value[HTML_HR_WIDTH])-1] == '%') {
+		char *percent = NULL;
 		int Percent, Width;
 		StrAllocCopy(percent, value[HTML_HR_WIDTH]);
 		percent[strlen(percent)-1] = '\0';
@@ -1695,28 +1612,28 @@ PRIVATE void HTML_start_element ARGS6(
 		else {
 		    Width = (width * Percent) / 100;
 		    if (Width < 1)
-		        width = 1;
+			width = 1;
 		    else
-	                width = Width;
+			width = Width;
 		}
 		FREE(percent);
 	    } else {
-	        width -= 5;
+		width -= 5;
 	    }
 	    for (i = 0; i < width; i++)
-	        HTML_put_character(me, '_');
+		HTML_put_character(me, '_');
 	    HText_appendCharacter(me->text, '\r');
 	    me->in_word = NO;
 	    me->inP = FALSE;
 
 	    /*
-	     *  Reset the alignment appropriately
-	     *  for the division and/or block. - FM
+	     *	Reset the alignment appropriately
+	     *	for the division and/or block. - FM
 	     */
 	    if (me->List_Nesting_Level < 0 &&
-	        me->Division_Level >= 0) {
-	        me->sp->style->alignment =
-	    			me->DivisionAlignments[me->Division_Level];
+		me->Division_Level >= 0) {
+		me->sp->style->alignment =
+				me->DivisionAlignments[me->Division_Level];
 	    } else if (!strcmp(me->sp->style->name, "HeadingCenter") ||
 		       !strcmp(me->sp->style->name, "Heading1")) {
 		me->sp->style->alignment = HT_CENTER;
@@ -1727,24 +1644,24 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Add a blank line and set the second line
-	     *  indentation for lists and addresses, or a
-	     *  paragraph separator for other blocks. - FM
+	     *	Add a blank line and set the second line
+	     *	indentation for lists and addresses, or a
+	     *	paragraph separator for other blocks. - FM
 	     */
 	    if (me->List_Nesting_Level >= 0 ||
 		me->sp[0].tag_number == HTML_ADDRESS) {
 		HText_setLastChar(me->text, ' ');  /* absorb white space */
 		HText_appendCharacter(me->text, '\r');
 	    } else {
-	        HText_appendParagraph(me->text);
+		HText_appendParagraph(me->text);
 	    }
 	}
 	break;
 
     case HTML_TAB:
-        if (!present) { /* Bad tag.  Must have at least one attribute. - FM */
+	if (!present) { /* Bad tag.  Must have at least one attribute. - FM */
 	    if (TRACE)
-	        fprintf(stderr,
+		fprintf(stderr,
 			"HTML: TAB tag has no attributes. Ignored.\n");
 	    break;
 	}
@@ -1754,25 +1671,25 @@ PRIVATE void HTML_start_element ARGS6(
 	    (strcasecomp(value[HTML_TAB_ALIGN], "left") ||
 	     !(present[HTML_TAB_TO] || present[HTML_TAB_INDENT]))) {
 	    /*
-	     *  Just ensure a collapsible space, until we have
-	     *  the ALIGN and DP attributes implemented. - FM
+	     *	Just ensure a collapsible space, until we have
+	     *	the ALIGN and DP attributes implemented. - FM
 	     */
 	    HTML_put_character(me, ' ');
 	    if (TRACE)
-	        fprintf(stderr,
+		fprintf(stderr,
 		     "HTML: ALIGN not 'left'. Using space instead of TAB.\n");
 
 	} else if (!LYoverride_default_alignment(me) &&
 		   me->current_default_alignment != HT_LEFT) {
 	    /*
-	     *  Just ensure a collapsible space, until we
-	     *  can replace HText_getCurrentColumn() in
-	     *  GridText.c with code which doesn't require
-	     *  that the alignment be HT_LEFT. - FM
+	     *	Just ensure a collapsible space, until we
+	     *	can replace HText_getCurrentColumn() in
+	     *	GridText.c with code which doesn't require
+	     *	that the alignment be HT_LEFT. - FM
 	     */
 	    HTML_put_character(me, ' ');
 	    if (TRACE)
-	        fprintf(stderr,
+		fprintf(stderr,
 			"HTML: Not HT_LEFT. Using space instead of TAB.\n");
 
 	} else if ((present[HTML_TAB_TO] &&
@@ -1785,7 +1702,7 @@ PRIVATE void HTML_start_element ARGS6(
 
 	    column = HText_getCurrentColumn(me->text);
 	    if (present[HTML_TAB_TO]) {
-	        /*
+		/*
 		 *  TO has priority over INDENT if both are present. - FM
 		 */
 		StrAllocCopy(temp, value[HTML_TAB_TO]);
@@ -1800,23 +1717,23 @@ PRIVATE void HTML_start_element ARGS6(
 		 *  The INDENT value is in "en" (enval per column) units.
 		 *  Divide it by enval, rounding odd values up. - FM
 		 */
-	        target =
-		   (int)(((1.0 * atoi(value[HTML_TAB_INDENT])) / enval)+(0.5));
+		target =
+		   (int)(((1.0 * atoi(value[HTML_TAB_INDENT]))/enval)+(0.5));
 	    }
 	    FREE(temp);
 	    /*
-	     *  If we are being directed to a column too far to the left
-	     *  or right, just add a collapsible space, otherwise, add the
-	     *  appropriate number of spaces. - FM
+	     *	If we are being directed to a column too far to the left
+	     *	or right, just add a collapsible space, otherwise, add the
+	     *	appropriate number of spaces. - FM
 	     */
 	    if (target < column ||
 		target > HText_getMaximumColumn(me->text)) {
-	        HTML_put_character(me, ' ');
+		HTML_put_character(me, ' ');
 		if (TRACE)
 		    fprintf(stderr,
 		 "HTML: Column out of bounds. Using space instead of TAB.\n");
 	    } else {
-	        for (i = column; i < target; i++)
+		for (i = column; i < target; i++)
 		    HText_appendCharacter(me->text, ' ');
 		HText_setLastChar(me->text, ' ');  /* absorb white space */
 	    }
@@ -1832,7 +1749,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    StrAllocCopy(temp, value[HTML_TAB_ID]);
 	    TRANSLATE_AND_UNESCAPE_TO_STD(&temp);
 	    if (*temp)
-	        HText_setTabID(me->text, temp);
+		HText_setTabID(me->text, temp);
 	    FREE(temp);
 	}
 	break;
@@ -1842,7 +1759,7 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_FONT:
 
-        /*
+	/*
 	 *  FONT *may* have been declared SGML_EMPTY in HTMLDTD.c, and
 	 *  SGML_character() in SGML.c *may* check for a FONT end
 	 *  tag to call HTML_end_element() directly (with a
@@ -1882,21 +1799,21 @@ PRIVATE void HTML_start_element ARGS6(
 	 *  Ignore this if inside of a bold anchor or header.
 	 *  Can't display both underline and bold at same time.
 	 */
-	if (me->inBoldA == TRUE || me->inBoldH == TRUE)	{
+	if (me->inBoldA == TRUE || me->inBoldH == TRUE) {
 	    if (TRACE)
-	        fprintf(stderr,"Underline Level is %d\n", me->Underline_Level);
+		fprintf(stderr,"Underline Level is %d\n", me->Underline_Level);
 	    break;
 	}
 	if (me->inUnderline == FALSE) {
 	    HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
 	    me->inUnderline = TRUE;
 	    if (TRACE)
-	        fprintf(stderr,"Beginning underline\n");
+		fprintf(stderr,"Beginning underline\n");
 	} else {
 	    if (TRACE)
-	        fprintf(stderr,"Underline Level is %d\n", me->Underline_Level);
+		fprintf(stderr,"Underline Level is %d\n", me->Underline_Level);
 	}
-    	break;
+	break;
 
     case HTML_ABBREV:	/* Miscellaneous character containers */
     case HTML_ACRONYM:
@@ -1941,7 +1858,7 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_Q:
 	CHECK_ID(HTML_GEN_ID);
-        /*
+	/*
 	 *  Should check LANG and/or DIR attributes, and the
 	 *  me->node_anchor->charset and/or yet to be added
 	 *  structure elements, to determine whether we should
@@ -1956,7 +1873,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_PRE:				/* Formatted text */
-        /*
+	/*
 	**  Set our inPRE flag to FALSE so that a newline
 	**  immediately following the PRE start tag will
 	**  be ignored.  HTML_put_character() will set it
@@ -1970,13 +1887,13 @@ PRIVATE void HTML_start_element ARGS6(
 	change_paragraph_style(me, styles[ElementNumber]);
 	UPDATE_STYLE;
 	CHECK_ID(HTML_GEN_ID);
-    	if (me->comment_end)
-    	    HText_appendText(me->text, me->comment_end);
+	if (me->comment_end)
+	    HText_appendText(me->text, me->comment_end);
 	break;
 
     case HTML_BLOCKQUOTE:
     case HTML_BQ:
-    	change_paragraph_style(me, styles[ElementNumber]);
+	change_paragraph_style(me, styles[ElementNumber]);
 	UPDATE_STYLE;
 	if (me->sp->tag_number == ElementNumber)
 	    LYEnsureDoubleSpace(me);
@@ -1984,7 +1901,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_NOTE:
-    	change_paragraph_style(me, styles[ElementNumber]);
+	change_paragraph_style(me, styles[ElementNumber]);
 	UPDATE_STYLE;
 	if (me->sp->tag_number == ElementNumber)
 	    LYEnsureDoubleSpace(me);
@@ -1993,32 +1910,32 @@ PRIVATE void HTML_start_element ARGS6(
 	    char *note = NULL;
 
 	    /*
-	     *  Indicate the type of NOTE.
+	     *	Indicate the type of NOTE.
 	     */
 	    if (present && present[HTML_NOTE_CLASS] &&
-	        value[HTML_NOTE_CLASS] &&
-	        (!strcasecomp(value[HTML_NOTE_CLASS], "CAUTION") ||
+		value[HTML_NOTE_CLASS] &&
+		(!strcasecomp(value[HTML_NOTE_CLASS], "CAUTION") ||
 		 !strcasecomp(value[HTML_NOTE_CLASS], "WARNING"))) {
-	        StrAllocCopy(note, value[HTML_NOTE_CLASS]);
+		StrAllocCopy(note, value[HTML_NOTE_CLASS]);
 		for (i = 0; note[i] != '\0'; i++)
 		    note[i] = TOUPPER(note[i]);
 		StrAllocCat(note, ":");
 	    } else if (present && present[HTML_NOTE_ROLE] &&
-	    	       value[HTML_NOTE_ROLE] &&
-	    	       (!strcasecomp(value[HTML_NOTE_ROLE], "CAUTION") ||
-		        !strcasecomp(value[HTML_NOTE_ROLE], "WARNING"))) {
-	        StrAllocCopy(note, value[HTML_NOTE_ROLE]);
+		       value[HTML_NOTE_ROLE] &&
+		       (!strcasecomp(value[HTML_NOTE_ROLE], "CAUTION") ||
+			!strcasecomp(value[HTML_NOTE_ROLE], "WARNING"))) {
+		StrAllocCopy(note, value[HTML_NOTE_ROLE]);
 		for (i = 0; note[i] != '\0'; i++)
 		    note[i] = TOUPPER(note[i]);
 		StrAllocCat(note, ":");
 	    } else {
-	        StrAllocCopy(note, "NOTE:");
+		StrAllocCopy(note, "NOTE:");
 	    }
 	    if (me->inUnderline == FALSE)
-	        HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
+		HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
 	    HTML_put_string(me, note);
 	    if (me->inUnderline == FALSE)
-	        HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
+		HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
 	    HTML_put_character(me, ' ');
 	    FREE(note);
 	}
@@ -2028,7 +1945,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_ADDRESS:
-    	change_paragraph_style(me, styles[ElementNumber]);
+	change_paragraph_style(me, styles[ElementNumber]);
 	UPDATE_STYLE;
 	if (me->sp->tag_number == ElementNumber)
 	    LYEnsureDoubleSpace(me);
@@ -2038,16 +1955,16 @@ PRIVATE void HTML_start_element ARGS6(
     case HTML_DL:
 	me->List_Nesting_Level++;  /* increment the List nesting level */
 	if (me->List_Nesting_Level <= 0) {
-            change_paragraph_style(me, present && present[HTML_DL_COMPACT]
-    			              ? styles[HTML_DLC] : styles[HTML_DL]);
+	    change_paragraph_style(me, present && present[HTML_DL_COMPACT]
+				      ? styles[HTML_DLC] : styles[HTML_DL]);
 
 	} else if (me->List_Nesting_Level >= 6) {
-            change_paragraph_style(me, present && present[HTML_DL_COMPACT]
-    			              ? styles[HTML_DLC6] : styles[HTML_DL6]);
+	    change_paragraph_style(me, present && present[HTML_DL_COMPACT]
+				      ? styles[HTML_DLC6] : styles[HTML_DL6]);
 
 	} else {
-            change_paragraph_style(me, present && present[HTML_DL_COMPACT]
-    		 ? styles[(HTML_DLC1 - 1) + me->List_Nesting_Level]
+	    change_paragraph_style(me, present && present[HTML_DL_COMPACT]
+		 ? styles[(HTML_DLC1 - 1) + me->List_Nesting_Level]
 		 : styles[(HTML_DL1 - 1) + me->List_Nesting_Level]);
 	}
 	UPDATE_STYLE;	  /* update to the new style */
@@ -2055,24 +1972,24 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_DLC:
-        me->List_Nesting_Level++;  /* increment the List nesting level */
-        if (me->List_Nesting_Level <= 0) {
-            change_paragraph_style(me, styles[HTML_DLC]);
+	me->List_Nesting_Level++;  /* increment the List nesting level */
+	if (me->List_Nesting_Level <= 0) {
+	    change_paragraph_style(me, styles[HTML_DLC]);
 
-        } else if (me->List_Nesting_Level >= 6) {
-            change_paragraph_style(me, styles[HTML_DLC6]);
+	} else if (me->List_Nesting_Level >= 6) {
+	    change_paragraph_style(me, styles[HTML_DLC6]);
 
-        } else {
-            change_paragraph_style(me,
-                            styles[(HTML_DLC1 - 1) + me->List_Nesting_Level]);
-        }
+	} else {
+	    change_paragraph_style(me,
+			    styles[(HTML_DLC1 - 1) + me->List_Nesting_Level]);
+	}
 	UPDATE_STYLE;	  /* update to the new style */
 	CHECK_ID(HTML_DL_ID);
-        break;
+	break;
 
     case HTML_DT:
 	CHECK_ID(HTML_GEN_ID);
-        if (!me->style_change) {
+	if (!me->style_change) {
 	    HText_appendParagraph(me->text);
 	    me->in_word = NO;
 	    me->sp->style->alignment = HT_LEFT;
@@ -2083,12 +2000,12 @@ PRIVATE void HTML_start_element ARGS6(
     case HTML_DD:
 	CHECK_ID(HTML_GEN_ID);
 	HText_setLastChar(me->text, ' ');  /* absorb white space */
-        if (!me->style_change)  {
+	if (!me->style_change)	{
 	    if (HText_LastLineSize(me->text, FALSE)) {
 		HText_appendCharacter(me->text, '\r');
 	    }
 	} else {
-            UPDATE_STYLE;
+	    UPDATE_STYLE;
 	    HText_appendCharacter(me->text, '\t');
 	}
 	me->sp->style->alignment = HT_LEFT;
@@ -2108,61 +2025,61 @@ PRIVATE void HTML_start_element ARGS6(
 	 *  or want to continue the numbering from a previous
 	 *  OL in this nest. - FM
 	 */
-        if (present && (present[HTML_OL_SEQNUM] || present[HTML_OL_START])) {
+	if (present && (present[HTML_OL_SEQNUM] || present[HTML_OL_START])) {
 	    int seqnum;
 
 	    /*
-	     *  Give preference to the valid HTML 3.0 SEQNUM attribute name
-	     *  over the Netscape START attribute name (too bad the Netscape
-	     *  developers didn't read the HTML 3.0 specs before re-inventing
-	     *  the "wheel" as "we'll"). - FM
+	     *	Give preference to the valid HTML 3.0 SEQNUM attribute name
+	     *	over the Netscape START attribute name (too bad the Netscape
+	     *	developers didn't read the HTML 3.0 specs before re-inventing
+	     *	the "wheel" as "we'll"). - FM
 	     */
 	    if (present[HTML_OL_SEQNUM] &&
-	        value[HTML_OL_SEQNUM] && *value[HTML_OL_SEQNUM]) {
+		value[HTML_OL_SEQNUM] && *value[HTML_OL_SEQNUM]) {
 		seqnum = atoi(value[HTML_OL_SEQNUM]);
 	    } else if (present[HTML_OL_START] &&
-	    	       value[HTML_OL_START] && *value[HTML_OL_START]) {
+		       value[HTML_OL_START] && *value[HTML_OL_START]) {
 		seqnum = atoi(value[HTML_OL_START]);
 	    } else {
-	        seqnum = 1;
+		seqnum = 1;
 	    }
 
 	    /*
-	     *  Don't allow negative numbers less than
-	     *  or equal to our flags, or numbers less
-	     *  than 1 if an Alphabetic or Roman TYPE. - FM
+	     *	Don't allow negative numbers less than
+	     *	or equal to our flags, or numbers less
+	     *	than 1 if an Alphabetic or Roman TYPE. - FM
 	     */
 	    if (present[HTML_OL_TYPE] && value[HTML_OL_TYPE]) {
-	        if (*value[HTML_OL_TYPE] == 'A') {
+		if (*value[HTML_OL_TYPE] == 'A') {
 		    me->OL_Type[(me->List_Nesting_Level < 11 ?
 				    me->List_Nesting_Level+1 : 11)] = 'A';
 		    if (seqnum < 1)
-		        seqnum = 1;
+			seqnum = 1;
 		} else if (*value[HTML_OL_TYPE] == 'a') {
 		    me->OL_Type[(me->List_Nesting_Level < 11 ?
 				    me->List_Nesting_Level+1 : 11)] = 'a';
 		    if (seqnum < 1)
-		        seqnum = 1;
+			seqnum = 1;
 		} else if (*value[HTML_OL_TYPE] == 'I') {
 		    me->OL_Type[(me->List_Nesting_Level < 11 ?
 				    me->List_Nesting_Level+1 : 11)] = 'I';
 		    if (seqnum < 1)
-		        seqnum = 1;
+			seqnum = 1;
 		} else if (*value[HTML_OL_TYPE] == 'i') {
 		    me->OL_Type[(me->List_Nesting_Level < 11 ?
 				    me->List_Nesting_Level+1 : 11)] = 'i';
 		    if (seqnum < 1)
-		        seqnum = 1;
+			seqnum = 1;
 		} else {
 		  if (seqnum <= OL_VOID)
 		      seqnum = OL_VOID + 1;
 		}
 	    } else if (seqnum <= OL_VOID) {
-	        seqnum = OL_VOID + 1;
+		seqnum = OL_VOID + 1;
 	    }
 
 	    me->OL_Counter[(me->List_Nesting_Level < 11 ?
-	    		       me->List_Nesting_Level+1 : 11)] = seqnum;
+			       me->List_Nesting_Level+1 : 11)] = seqnum;
 
 	} else if (present && present[HTML_OL_CONTINUE]) {
 	    me->OL_Counter[me->List_Nesting_Level < 11 ?
@@ -2172,7 +2089,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    me->OL_Counter[(me->List_Nesting_Level < 11 ?
 			       me->List_Nesting_Level+1 : 11)] = 1;
 	    if (present && present[HTML_OL_TYPE] && value[HTML_OL_TYPE]) {
-	        if (*value[HTML_OL_TYPE] == 'A') {
+		if (*value[HTML_OL_TYPE] == 'A') {
 		    me->OL_Type[(me->List_Nesting_Level < 11 ?
 				    me->List_Nesting_Level+1 : 11)] = 'A';
 		} else if (*value[HTML_OL_TYPE] == 'a') {
@@ -2190,14 +2107,14 @@ PRIVATE void HTML_start_element ARGS6(
 	me->List_Nesting_Level++;
 
 	if (me->List_Nesting_Level <= 0) {
-       	    change_paragraph_style(me, styles[ElementNumber]);
+	    change_paragraph_style(me, styles[ElementNumber]);
 
 	} else if (me->List_Nesting_Level >= 6) {
-       	    change_paragraph_style(me, styles[HTML_OL6]);
+	    change_paragraph_style(me, styles[HTML_OL6]);
 
 	} else {
-            change_paragraph_style(me,
-		          styles[HTML_OL1 + me->List_Nesting_Level - 1]);
+	    change_paragraph_style(me,
+			  styles[HTML_OL1 + me->List_Nesting_Level - 1]);
 	}
 	UPDATE_STYLE;  /* update to the new style */
 	CHECK_ID(HTML_OL_ID);
@@ -2208,36 +2125,36 @@ PRIVATE void HTML_start_element ARGS6(
 
 	if (me->List_Nesting_Level <= 0) {
 	    if (!(present && present[HTML_UL_PLAIN]) &&
-	        !(present && present[HTML_UL_TYPE] &&
+		!(present && present[HTML_UL_TYPE] &&
 		  value[HTML_UL_TYPE] &&
 		  0==strcasecomp(value[HTML_UL_TYPE], "PLAIN"))) {
-       	        change_paragraph_style(me, styles[ElementNumber]);
+		change_paragraph_style(me, styles[ElementNumber]);
 	    } else {
-       	        change_paragraph_style(me, styles[HTML_DIR]);
+		change_paragraph_style(me, styles[HTML_DIR]);
 		ElementNumber = HTML_DIR;
 	    }
 
 	} else if (me->List_Nesting_Level >= 6) {
 	    if (!(present && present[HTML_UL_PLAIN]) &&
-	        !(present && present[HTML_UL_TYPE] &&
+		!(present && present[HTML_UL_TYPE] &&
 		  value[HTML_UL_TYPE] &&
 		  0==strcasecomp(value[HTML_UL_TYPE], "PLAIN"))) {
-       	        change_paragraph_style(me, styles[HTML_OL6]);
+		change_paragraph_style(me, styles[HTML_OL6]);
 	    } else {
-       	        change_paragraph_style(me, styles[HTML_MENU6]);
+		change_paragraph_style(me, styles[HTML_MENU6]);
 		ElementNumber = HTML_DIR;
 	    }
 
 	} else {
 	    if (!(present && present[HTML_UL_PLAIN]) &&
-	        !(present && present[HTML_UL_TYPE] &&
+		!(present && present[HTML_UL_TYPE] &&
 		  value[HTML_UL_TYPE] &&
 		  0==strcasecomp(value[HTML_UL_TYPE], "PLAIN"))) {
-                change_paragraph_style(me,
-		          styles[HTML_OL1 + me->List_Nesting_Level - 1]);
+		change_paragraph_style(me,
+			  styles[HTML_OL1 + me->List_Nesting_Level - 1]);
 	    } else {
-                change_paragraph_style(me,
-		          styles[HTML_MENU1 + me->List_Nesting_Level - 1]);
+		change_paragraph_style(me,
+			  styles[HTML_MENU1 + me->List_Nesting_Level - 1]);
 		ElementNumber = HTML_DIR;
 	    }
 	}
@@ -2250,21 +2167,21 @@ PRIVATE void HTML_start_element ARGS6(
 	me->List_Nesting_Level++;
 
 	if (me->List_Nesting_Level <= 0) {
-       	    change_paragraph_style(me, styles[ElementNumber]);
+	    change_paragraph_style(me, styles[ElementNumber]);
 
 	} else if (me->List_Nesting_Level >= 6) {
-       	    change_paragraph_style(me, styles[HTML_MENU6]);
+	    change_paragraph_style(me, styles[HTML_MENU6]);
 
 	} else {
-            change_paragraph_style(me,
-		          styles[HTML_MENU1 + me->List_Nesting_Level - 1]);
+	    change_paragraph_style(me,
+			  styles[HTML_MENU1 + me->List_Nesting_Level - 1]);
 	}
 	UPDATE_STYLE;  /* update to the new style */
 	CHECK_ID(HTML_UL_ID);
 	break;
 
     case HTML_LH:
-        UPDATE_STYLE;  /* update to the new style */
+	UPDATE_STYLE;  /* update to the new style */
 	HText_appendParagraph(me->text);
 	CHECK_ID(HTML_GEN_ID);
 	HTML_put_character(me, HT_NON_BREAK_SPACE);
@@ -2274,7 +2191,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_LI:
-        UPDATE_STYLE;  /* update to the new style */
+	UPDATE_STYLE;  /* update to the new style */
 	HText_appendParagraph(me->text);
 	me->sp->style->alignment = HT_LEFT;
 	CHECK_ID(HTML_LI_ID);
@@ -2286,20 +2203,20 @@ PRIVATE void HTML_start_element ARGS6(
 	    counter = me->List_Nesting_Level < 11 ?
 			   me->List_Nesting_Level : 11;
 	    if (present && present[HTML_LI_TYPE] && value[HTML_LI_TYPE]) {
-	        if (*value[HTML_LI_TYPE] == '1') {
+		if (*value[HTML_LI_TYPE] == '1') {
 		    me->OL_Type[counter] = '1';
-	        } else if (*value[HTML_LI_TYPE] == 'A') {
+		} else if (*value[HTML_LI_TYPE] == 'A') {
 		    me->OL_Type[counter] = 'A';
-	        } else if (*value[HTML_LI_TYPE] == 'a') {
+		} else if (*value[HTML_LI_TYPE] == 'a') {
 		    me->OL_Type[counter] = 'a';
-	        } else if (*value[HTML_LI_TYPE] == 'I') {
+		} else if (*value[HTML_LI_TYPE] == 'I') {
 		    me->OL_Type[counter] = 'I';
-	        } else if (*value[HTML_LI_TYPE] == 'i') {
+		} else if (*value[HTML_LI_TYPE] == 'i') {
 		    me->OL_Type[counter] = 'i';
 		}
 	    }
 	    if (present && present[HTML_LI_VALUE] &&
-	        ((value[HTML_LI_VALUE] != NULL) &&
+		((value[HTML_LI_VALUE] != NULL) &&
 		 (*value[HTML_LI_VALUE] != '\0')) &&
 		((isdigit(*value[HTML_LI_VALUE])) ||
 		 (*value[HTML_LI_VALUE] == '-' &&
@@ -2312,101 +2229,100 @@ PRIVATE void HTML_start_element ARGS6(
 		    seqnum = 1;
 		me->OL_Counter[counter] = seqnum + 1;
 	    } else if (me->OL_Counter[counter] >= OL_VOID) {
-	        seqnum = me->OL_Counter[counter]++;
+		seqnum = me->OL_Counter[counter]++;
 		seqtype = me->OL_Type[counter];
 		if (seqtype != '1' && seqnum < 1) {
 		    seqnum = 1;
 		    me->OL_Counter[counter] = seqnum + 1;
 		}
 	    } else {
-	        seqnum = me->Last_OL_Count + 1;
+		seqnum = me->Last_OL_Count + 1;
 		seqtype = me->Last_OL_Type;
 		for (i = (counter - 1); i >= 0; i--) {
 		    if (me->OL_Counter[i] > OL_VOID) {
-		        seqnum = me->OL_Counter[i]++;
+			seqnum = me->OL_Counter[i]++;
 			seqtype = me->OL_Type[i];
 			i = 0;
 		    }
 		}
 	    }
 	    if (seqtype == 'A') {
-	        sprintf(number_string, LYUppercaseA_OL_String(seqnum));
+		sprintf(number_string, LYUppercaseA_OL_String(seqnum));
 	    } else if (seqtype == 'a') {
-	        sprintf(number_string, LYLowercaseA_OL_String(seqnum));
+		sprintf(number_string, LYLowercaseA_OL_String(seqnum));
 	    } else if (seqtype == 'I') {
-	        sprintf(number_string, LYUppercaseI_OL_String(seqnum));
+		sprintf(number_string, LYUppercaseI_OL_String(seqnum));
 	    } else if (seqtype == 'i') {
-	        sprintf(number_string, LYLowercaseI_OL_String(seqnum));
+		sprintf(number_string, LYLowercaseI_OL_String(seqnum));
 	    } else {
-	        sprintf(number_string, "%2d.", seqnum);
+		sprintf(number_string, "%2d.", seqnum);
 	    }
 	    me->Last_OL_Count = seqnum;
 	    me->Last_OL_Type = seqtype;
 	    /*
-	     *  Hack, because there is no append string!
+	     *	Hack, because there is no append string!
 	     */
 	    for (i = 0; number_string[i] != '\0'; i++)
 		if (number_string[i] == ' ')
 		    HTML_put_character(me, HT_NON_BREAK_SPACE);
 		else
-	    	    HTML_put_character(me, number_string[i]);
+		    HTML_put_character(me, number_string[i]);
 
 	    /*
-	     *  Use HTML_put_character so that any other spaces
-	     *  coming through will be collapsed.  We'll use
-	     *  nbsp, so it won't break at the spacing character
-	     *  if there are no spaces in the subsequent text up
-	     *  to the right margin, but will declare it as a
-	     *  normal space to ensure collapsing if a normal
-	     *  space does immediately follow it. - FM
+	     *	Use HTML_put_character so that any other spaces
+	     *	coming through will be collapsed.  We'll use
+	     *	nbsp, so it won't break at the spacing character
+	     *	if there are no spaces in the subsequent text up
+	     *	to the right margin, but will declare it as a
+	     *	normal space to ensure collapsing if a normal
+	     *	space does immediately follow it. - FM
 	     */
 	    HTML_put_character(me, HT_NON_BREAK_SPACE);
 	    HText_setLastChar(me->text, ' ');
-
 	} else if (me->sp[0].tag_number == HTML_UL) {
 	    /*
-	     *  Hack, because there is no append string!
+	     *	Hack, because there is no append string!
 	     */
 	    HTML_put_character(me, HT_NON_BREAK_SPACE);
 	    HTML_put_character(me, HT_NON_BREAK_SPACE);
 	    switch(me->List_Nesting_Level % 7) {
 		case 0:
-	    	    HTML_put_character(me, '*');
+		    HTML_put_character(me, '*');
 		    break;
 		case 1:
-	    	    HTML_put_character(me, '+');
+		    HTML_put_character(me, '+');
 		    break;
 		case 2:
-	    	    HTML_put_character(me, 'o');
+		    HTML_put_character(me, 'o');
 		    break;
 		case 3:
-	    	    HTML_put_character(me, '#');
+		    HTML_put_character(me, '#');
 		    break;
 		case 4:
-	    	    HTML_put_character(me, '@');
+		    HTML_put_character(me, '@');
 		    break;
 		case 5:
-	    	    HTML_put_character(me, '-');
+		    HTML_put_character(me, '-');
 		    break;
 		case 6:
-	    	    HTML_put_character(me, '=');
+		    HTML_put_character(me, '=');
 		    break;
 
 	    }
 	    /*
-	     *  Keep using HTML_put_character so that any other
-	     *  spaces coming through will be collapsed.  We use
-	     *  nbsp, so we won't wrap at the spacing character
-	     *  if there are no spaces in the subsequent text up
-	     *  to the right margin, but will declare it as a
-	     *  normal space to ensure collapsing if a normal
-	     *  space does immediately follow it. - FM
+	     *	Keep using HTML_put_character so that any other
+	     *	spaces coming through will be collapsed.  We use
+	     *	nbsp, so we won't wrap at the spacing character
+	     *	if there are no spaces in the subsequent text up
+	     *	to the right margin, but will declare it as a
+	     *	normal space to ensure collapsing if a normal
+	     *	space does immediately follow it. - FM
 	     */
 	    HTML_put_character(me, HT_NON_BREAK_SPACE);
 	    HText_setLastChar(me->text, ' ');
 	} else {
 	    /*
-	     *  Hack, because there is no append string!
+	     *	Hack, because there is no append string!
 	     */
 	    HTML_put_character(me, HT_NON_BREAK_SPACE);
 	    HTML_put_character(me, HT_NON_BREAK_SPACE);
@@ -2418,7 +2334,7 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_SPAN:
 	CHECK_ID(HTML_GEN_ID);
-        /*
+	/*
 	 *  Should check LANG and/or DIR attributes, and the
 	 *  me->node_anchor->charset and/or yet to be added
 	 *  structure elements, and do something here. - FM
@@ -2427,7 +2343,7 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_BDO:
 	CHECK_ID(HTML_GEN_ID);
-        /*
+	/*
 	 *  Should check DIR (and LANG) attributes, and the
 	 *  me->node_anchor->charset and/or yet to be added
 	 *  structure elements, and do something here. - FM
@@ -2439,7 +2355,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_FN:
-    	change_paragraph_style(me, styles[ElementNumber]);
+	change_paragraph_style(me, styles[ElementNumber]);
 	UPDATE_STYLE;
 	if (me->sp->tag_number == ElementNumber)
 	    LYEnsureDoubleSpace(me);
@@ -2456,7 +2372,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_A:
-        /*
+	/*
 	 *  A may have been declared SGML_EMPTY in HTMLDTD.c, and
 	 *  SGML_character() in SGML.c may check for an A end
 	 *  tag to call HTML_end_element() directly (with a
@@ -2464,7 +2380,7 @@ PRIVATE void HTML_start_element ARGS6(
 	 *  parser's stack), so if we have an open A, close
 	 *  that one now. - FM & kw
 	 */
-	if (me->inA == TRUE) {
+	if (me->inA) {
 	    SET_SKIP_STACK(HTML_A);
 	    HTML_end_element(me, HTML_A, (char **)&include);
 	}
@@ -2501,12 +2417,12 @@ PRIVATE void HTML_start_element ARGS6(
 		CHECK_FOR_INTERN(value[HTML_A_HREF]);
 #endif
 	    /*
-	     *  Prepare to do housekeeping on the reference. - FM
+	     *	Prepare to do housekeeping on the reference. - FM
 	     */
 	    if (!value[HTML_A_HREF] || *value[HTML_A_HREF] == '\0') {
-	        StrAllocCopy(href, me->node_anchor->address);
+		StrAllocCopy(href, me->node_anchor->address);
 	    } else if (*value[HTML_A_HREF] == '#') {
-	        StrAllocCopy(href, me->node_anchor->address);
+		StrAllocCopy(href, me->node_anchor->address);
 		if (strlen(value[HTML_A_HREF]) > 1) {
 		    StrAllocCat(href, value[HTML_A_HREF]);
 		}
@@ -2516,7 +2432,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 
 	    /*
-	     *  Deal with our ftp gateway kludge. - FM
+	     *	Deal with our ftp gateway kludge. - FM
 	     */
 	    if (!url_type && !strncmp(href, "/foo/..", 7) &&
 		(!strncmp(me->node_anchor->address, "ftp:", 4) ||
@@ -2526,32 +2442,32 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Set to know we are making the content bold.
+	     *	Set to know we are making the content bold.
 	     */
 	    me->inBoldA = TRUE;
 
 	    /*
-	     *  Check whether a base tag is in effect. - FM
+	     *	Check whether a base tag is in effect. - FM
 	     */
 	    if ((me->inBASE && *href != '\0' && *href != '#') &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
 		*temp != '\0')
-	        /*
+		/*
 		 *  Use reference related to the base.
 		 */
 		StrAllocCopy(href, temp);
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((*href != '\0' && *href != '#' &&
-			         me->inBASE) ?
+				 me->inBASE) ?
 			       me->base_href : me->node_anchor->address));
 	} else {
 	    if (bold_name_anchors == TRUE) {
-	        me->inBoldA = TRUE;
+		me->inBoldA = TRUE;
 	    }
 	}
 	if (present && present[HTML_A_TYPE] && value[HTML_A_TYPE]) {
@@ -2583,7 +2499,7 @@ PRIVATE void HTML_start_element ARGS6(
 
 	if (me->CurrentA && present) {
 	    if (present[HTML_A_TITLE] &&
-	        value[HTML_A_TITLE] && *value[HTML_A_TITLE] != '\0') {
+		value[HTML_A_TITLE] && *value[HTML_A_TITLE] != '\0') {
 		StrAllocCopy(title, value[HTML_A_TITLE]);
 		TRANSLATE_AND_UNESCAPE_ENTITIES(&title, TRUE, FALSE);
 		LYTrimHead(title);
@@ -2597,29 +2513,32 @@ PRIVATE void HTML_start_element ARGS6(
 	    if (present[HTML_A_CHARSET] &&
 		value[HTML_A_CHARSET] && *value[HTML_A_CHARSET] != '\0') {
 		/*
-		**  Set up to load the anchor's chartrans structures.
+		**  Set up to load the anchor's chartrans structures
+		**  appropriately for the current display character
+		**  set if it can handle what's claimed. - FM
 		*/
 		StrAllocCopy(temp, value[HTML_A_CHARSET]);
 		TRANSLATE_AND_UNESCAPE_TO_STD(&temp);
 		dest_char_set = UCGetLYhndl_byMIME(temp);
 		if (dest_char_set < 0) {
-		        dest_char_set = UCLYhndl_for_unrec;
+			dest_char_set = UCLYhndl_for_unrec;
 		}
 	    }
 	    if (title != NULL || dest_ismap == TRUE || dest_char_set >= 0) {
-	        dest = HTAnchor_parent(
+		dest = HTAnchor_parent(
 			HTAnchor_followMainLink((HTAnchor*)me->CurrentA)
-		    		      );
+				      );
 	    }
 	    if (dest && title != NULL && HTAnchor_title(dest) == NULL)
 		HTAnchor_setTitle(dest, title);
 	    if (dest && dest_ismap)
 		dest->isISMAPScript = TRUE;
 	    if (dest && dest_char_set >= 0) {
-	        /*
+		/*
 		**  Load the anchor's chartrans structures.
 		**  This should be done more intelligently
-		**  when setting up the structured object. - FM
+		**  when setting up the structured object,
+		**  but it gets the job done for now. - FM
 		*/
 		HTAnchor_setUCInfoStage(dest, dest_char_set,
 					UCT_STAGE_MIME,
@@ -2650,7 +2569,7 @@ PRIVATE void HTML_start_element ARGS6(
 	}
 #endif /* NOTUSED_FOTEMODS */
 	FREE(href);
-    	break;
+	break;
 
     case HTML_IMG:			/* Images */
 	/*
@@ -2666,14 +2585,14 @@ PRIVATE void HTML_start_element ARGS6(
 		if (dest->isISMAPScript == TRUE) {
 		    dest_ismap = TRUE;
 		    if (TRACE)
-		        fprintf(stderr,
+			fprintf(stderr,
 				"HTML: '%s' is an ISMAP script\n",
 				dest->address);
 		} else if (present && present[HTML_IMG_ISMAP]) {
 		    dest_ismap = TRUE;
 		    dest->isISMAPScript = TRUE;
 		    if (TRACE)
-		        fprintf(stderr,
+			fprintf(stderr,
 				"HTML: Designating '%s' as an ISMAP script\n",
 				dest->address);
 		}
@@ -2690,41 +2609,43 @@ PRIVATE void HTML_start_element ARGS6(
 	    CHECK_FOR_INTERN(map_href);
 	    url_type = LYLegitimizeHREF(me, (char**)&map_href, TRUE, TRUE);
 	    /*
-	     *  If map_href ended up zero-length or otherwise doesn't
-	     *  have a hash, it can't be valid, so ignore it. - FM
+	     *	If map_href ended up zero-length or otherwise doesn't
+	     *	have a hash, it can't be valid, so ignore it. - FM
 	     */
 	    if (strchr(map_href, '#') == NULL) {
-	        FREE(map_href);
+		FREE(map_href);
 	    }
 	}
 
-
+	/*
+	 *  Handle a MAP reference if we have one at this point. - FM
+	 */
 	if (map_href) {
 	    /*
-	     *  If the MAP reference doesn't yet begin with a scheme,
-	     *  check whether a base tag is in effect. - FM
+	     *	If the MAP reference doesn't yet begin with a scheme,
+	     *	check whether a base tag is in effect. - FM
 	     */
 	    if (!url_type && me->inBASE) {
 		/*
 		 *  If the
 		 *  USEMAP value is a lone fragment and LYSeekFragMAPinCur
 		 *  is set, we'll use the current document's URL for
-		 *  resolving.  Otherwise use the BASE. - kw
+		 *  resolving.	Otherwise use the BASE. - kw
 		 */
 		if ((*map_href == '#' &&
 		     LYSeekFragMAPinCur == TRUE)) {
-	 	    /*
-		     *  Use reference related to the current stream. - FM
+		    /*
+		     *	Use reference related to the current stream. - FM
 		     */
 		    temp = HTParse(map_href, me->node_anchor->address,
-		    		    PARSE_ALL);
+				    PARSE_ALL);
 		    StrAllocCopy(map_href, temp);
 		    UseBASE = FALSE;
 		} else {
 		    /*
-		     *  Use reference related to the base. - FM
+		     *	Use reference related to the base. - FM
 		     */
-	            temp = HTParse(map_href, me->base_href, PARSE_ALL);
+		    temp = HTParse(map_href, me->base_href, PARSE_ALL);
 		    StrAllocCopy(map_href, temp);
 		    UseBASE = TRUE;
 		}
@@ -2732,7 +2653,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&map_href,
 			       ((UseBASE && me->inBASE) ?
@@ -2740,17 +2661,17 @@ PRIVATE void HTML_start_element ARGS6(
 	    UseBASE = TRUE;
 
 	    /*
-	     *  If it's not yet a URL, resolve versus
-	     *  the current document's address. - FM
+	     *	If it's not yet a URL, resolve versus
+	     *	the current document's address. - FM
 	     */
 	    if (!(url_type = is_url(map_href))) {
-	    	temp = HTParse(map_href, me->node_anchor->address, PARSE_ALL);
+		temp = HTParse(map_href, me->node_anchor->address, PARSE_ALL);
 		StrAllocCopy(map_href, temp);
 		FREE(temp);
 	    }
 
 	    /*
-	     *  Prepend our client-side MAP access field. - FM
+	     *	Prepend our client-side MAP access field. - FM
 	     */
 	    StrAllocCopy(temp, "LYNXIMGMAP:");
 	    StrAllocCat(temp, map_href);
@@ -2795,52 +2716,52 @@ PRIVATE void HTML_start_element ARGS6(
 	    TRANSLATE_AND_UNESCAPE_ENTITIES(&alt_string,
 						   me->UsePlainSpace, me->HiddenValue);
 	    /*
-	     *  If it's all spaces and we are making SRC or
-	     *  USEMAP links, treat it as zero-length. - FM
+	     *	If it's all spaces and we are making SRC or
+	     *	USEMAP links, treat it as zero-length. - FM
 	     */
 	    if (clickable_images || map_href) {
-	        LYTrimHead(alt_string);
-	        LYTrimTail(alt_string);
+		LYTrimHead(alt_string);
+		LYTrimTail(alt_string);
 		if (*alt_string == '\0') {
 		    if (map_href) {
-		        StrAllocCopy(alt_string, (title ?
+			StrAllocCopy(alt_string, (title ?
 						  title : "[USEMAP]"));
 		    } else if (dest_ismap) {
-		        StrAllocCopy(alt_string, (title ?
+			StrAllocCopy(alt_string, (title ?
 						  title : "[ISMAP]"));
 		    } else if (me->inA == TRUE && dest) {
-		        StrAllocCopy(alt_string, (title ?
+			StrAllocCopy(alt_string, (title ?
 						  title : "[LINK]"));
 		    } else {
-		        StrAllocCopy(alt_string,
+			StrAllocCopy(alt_string,
 					     (title ? title :
 				(present[HTML_IMG_ISOBJECT] ?
-			     			 "(OBJECT)" : "[INLINE]")));
+						 "(OBJECT)" : "[INLINE]")));
 		    }
 		}
 	    }
 
 	} else if (map_href) {
 	    StrAllocCopy(alt_string, (title ?
-	    			      title : "[USEMAP]"));
+				      title : "[USEMAP]"));
 
 	} else if ((dest_ismap == TRUE) ||
 		   (me->inA && present && present[HTML_IMG_ISMAP])) {
 	    StrAllocCopy(alt_string, (title ?
-	    			      title : "[ISMAP]"));
+				      title : "[ISMAP]"));
 
 	} else if (me->inA == TRUE && dest) {
 	    StrAllocCopy(alt_string, (title ?
-	    			      title : "[LINK]"));
+				      title : "[LINK]"));
 
 	} else {
 	    if (pseudo_inline_alts || clickable_images)
-	        StrAllocCopy(alt_string, (title ? title :
+		StrAllocCopy(alt_string, (title ? title :
 			  ((present &&
 			    present[HTML_IMG_ISOBJECT]) ?
-			     		     "(OBJECT)" : "[INLINE]")));
+					     "(OBJECT)" : "[INLINE]")));
 	    else
-	        StrAllocCopy(alt_string, (title ?
+		StrAllocCopy(alt_string, (title ?
 					  title : ""));
 	}
 	if (*alt_string == '\0' && map_href) {
@@ -2849,7 +2770,7 @@ PRIVATE void HTML_start_element ARGS6(
 
 	if (TRACE) {
 	    fprintf(stderr,
-	    	    "HTML IMG: USEMAP=%d ISMAP=%d ANCHOR=%d PARA=%d\n",
+		    "HTML IMG: USEMAP=%d ISMAP=%d ANCHOR=%d PARA=%d\n",
 		    map_href ? 1 : 0,
 		    (dest_ismap == TRUE) ? 1 : 0,
 		    me->inA, me->inP);
@@ -2863,7 +2784,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    StrAllocCopy(id_string, value[HTML_IMG_ID]);
 	    TRANSLATE_AND_UNESCAPE_TO_STD(&id_string);
 	    if (*id_string == '\0') {
-	        FREE(id_string);
+		FREE(id_string);
 	    }
 	}
 
@@ -2877,7 +2798,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 
 	    /*
-	     *  Check whether a base tag is in effect. - FM
+	     *	Check whether a base tag is in effect. - FM
 	     */
 	    if ((me->inBASE && *href != '\0' && *href != '#') &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
@@ -2889,19 +2810,19 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((*href != '\0' && *href != '#' &&
-			         me->inBASE) ?
+				 me->inBASE) ?
 			       me->base_href : me->node_anchor->address));
 
 	    /*
-	     *  If it's an ISMAP and/or USEMAP, or graphic for an
-	     *  anchor, end that anchor and start one for the SRC. - FM
+	     *	If it's an ISMAP and/or USEMAP, or graphic for an
+	     *	anchor, end that anchor and start one for the SRC. - FM
 	     */
 	    if (me->inA) {
-	        /*
+		/*
 		 *  If we have a USEMAP, end this anchor and
 		 *  start a new one for the client-side MAP. - FM
 		 */
@@ -2916,7 +2837,7 @@ PRIVATE void HTML_start_element ARGS6(
 			HTML_put_string(me, "[LINK]");
 		    }
 		    if (me->inBoldA == TRUE && me->inBoldH == FALSE) {
-		        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+			HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		    }
 		    me->inBoldA = FALSE;
 		    HText_endAnchor(me->text, me->CurrentANum);
@@ -2924,40 +2845,40 @@ PRIVATE void HTML_start_element ARGS6(
 		    if (dest_ismap || dest)
 			HTML_put_character(me, '-');
 		    if (id_string) {
-		        if ((ID_A = HTAnchor_findChildAndLink(
+			if ((ID_A = HTAnchor_findChildAndLink(
 				  me->node_anchor,	/* Parent */
 				  id_string,		/* Tag */
-				  NULL,			/* Addresss */
+				  NULL, 		/* Addresss */
 				  (HTLinkType*)0)) != NULL) {	/* Type */
-		            HText_beginAnchor(me->text, me->inUnderline, ID_A);
-		            HText_endAnchor(me->text, 0);
-		        }
+			    HText_beginAnchor(me->text, me->inUnderline, ID_A);
+			    HText_endAnchor(me->text, 0);
+			}
 		    }
 		    me->CurrentA = HTAnchor_findChildAndLink(
-		    		me->node_anchor,	/* Parent */
+				me->node_anchor,	/* Parent */
 				NULL,			/* Tag */
 				map_href,		/* Addresss */
 				INTERN_LT);		/* Type */
 		    if (me->CurrentA && title) {
 			if ((dest = HTAnchor_parent(
 				HTAnchor_followMainLink((HTAnchor*)me->CurrentA)
-					          )) != NULL) {
+						  )) != NULL) {
 			    if (!HTAnchor_title(dest))
-			        HTAnchor_setTitle(dest, title);
+				HTAnchor_setTitle(dest, title);
 			}
 		    }
 		    me->CurrentANum = HText_beginAnchor(me->text,
-		    					me->inUnderline,
+							me->inUnderline,
 							me->CurrentA);
 		    if (me->inBoldA == FALSE && me->inBoldH == FALSE) {
-		        HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
+			HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
 		    }
 		    me->inBoldA = TRUE;
 		} else {
 		    HTML_put_character(me, ' ');/* space char may be ignored */
 		    me->in_word = NO;
 		}
-	        HTML_put_string(me, alt_string);
+		HTML_put_string(me, alt_string);
 		if (me->inBoldA == TRUE && me->inBoldH == FALSE) {
 		    HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		}
@@ -2969,32 +2890,32 @@ PRIVATE void HTML_start_element ARGS6(
 			     ((present &&
 			       present[HTML_IMG_ISOBJECT]) ?
 		   ((map_href || dest_ismap) ?
-			     	   "(IMAGE)" : "(OBJECT)") : "[IMAGE]"));
+				   "(IMAGE)" : "(OBJECT)") : "[IMAGE]"));
 		if (id_string && !map_href) {
 		    if ((ID_A = HTAnchor_findChildAndLink(
 				  me->node_anchor,	/* Parent */
 				  id_string,		/* Tag */
-				  NULL,			/* Addresss */
+				  NULL, 		/* Addresss */
 				  (HTLinkType*)0)) != NULL) {	/* Type */
-		        HText_beginAnchor(me->text, me->inUnderline, ID_A);
-		        HText_endAnchor(me->text, 0);
+			HText_beginAnchor(me->text, me->inUnderline, ID_A);
+			HText_endAnchor(me->text, 0);
 		    }
 		}
 	    } else if (map_href) {
-	        HTML_put_character(me, ' ');  /* space char may be ignored */
+		HTML_put_character(me, ' ');  /* space char may be ignored */
 		me->in_word = NO;
 		if (id_string) {
 		    if ((ID_A = HTAnchor_findChildAndLink(
 				  me->node_anchor,	/* Parent */
 				  id_string,		/* Tag */
-				  NULL,			/* Addresss */
+				  NULL, 		/* Addresss */
 				  (HTLinkType*)0)) != NULL) {	/* Type */
-		        HText_beginAnchor(me->text, me->inUnderline, ID_A);
-		        HText_endAnchor(me->text, 0);
+			HText_beginAnchor(me->text, me->inUnderline, ID_A);
+			HText_endAnchor(me->text, 0);
 		    }
 		}
 		me->CurrentA = HTAnchor_findChildAndLink(
-		    		me->node_anchor,	/* Parent */
+				me->node_anchor,	/* Parent */
 				NULL,			/* Tag */
 				map_href,		/* Addresss */
 				INTERN_LT);		/* Type */
@@ -3002,7 +2923,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    if ((dest = HTAnchor_parent(
 				HTAnchor_followMainLink((HTAnchor*)me->CurrentA)
 					      )) != NULL) {
-		        if (!HTAnchor_title(dest))
+			if (!HTAnchor_title(dest))
 			    HTAnchor_setTitle(dest, title);
 		    }
 		}
@@ -3012,7 +2933,7 @@ PRIVATE void HTML_start_element ARGS6(
 		if (me->inBoldA == FALSE && me->inBoldH == FALSE)
 		    HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
 		me->inBoldA = TRUE;
-	        HTML_put_string(me, alt_string);
+		HTML_put_string(me, alt_string);
 		if (me->inBoldA == TRUE && me->inBoldH == FALSE) {
 		    HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		}
@@ -3023,24 +2944,24 @@ PRIVATE void HTML_start_element ARGS6(
 		StrAllocCopy(alt_string,
 			     ((present &&
 			       present[HTML_IMG_ISOBJECT]) ?
-			     			  "(IMAGE)" : "[IMAGE]"));
+						  "(IMAGE)" : "[IMAGE]"));
 	    } else {
-	        HTML_put_character(me, ' ');  /* space char may be ignored */
+		HTML_put_character(me, ' ');  /* space char may be ignored */
 		me->in_word = NO;
 		if (id_string) {
 		    if ((ID_A = HTAnchor_findChildAndLink(
 				  me->node_anchor,	/* Parent */
 				  id_string,		/* Tag */
-				  NULL,			/* Addresss */
+				  NULL, 		/* Addresss */
 				  (HTLinkType*)0)) != NULL) {	/* Type */
-		        HText_beginAnchor(me->text, me->inUnderline, ID_A);
-		        HText_endAnchor(me->text, 0);
+			HText_beginAnchor(me->text, me->inUnderline, ID_A);
+			HText_endAnchor(me->text, 0);
 		    }
 		}
 	    }
 
 	    /*
-	     *  Create the link to the SRC. - FM
+	     *	Create the link to the SRC. - FM
 	     */
 	    me->CurrentA = HTAnchor_findChildAndLink(
 			me->node_anchor,		/* Parent */
@@ -3049,13 +2970,13 @@ PRIVATE void HTML_start_element ARGS6(
 			(HTLinkType*)0);		/* Type */
 	    FREE(href);
 	    me->CurrentANum = HText_beginAnchor(me->text,
-	    					me->inUnderline,
+						me->inUnderline,
 						me->CurrentA);
 	    if (me->inBoldH == FALSE)
 		HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
 	    HTML_put_string(me, alt_string);
 	    if (!me->inA) {
-	        if (me->inBoldH == FALSE)
+		if (me->inBoldH == FALSE)
 		    HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		HText_endAnchor(me->text, me->CurrentANum);
 		me->CurrentANum = 0;
@@ -3064,11 +2985,11 @@ PRIVATE void HTML_start_element ARGS6(
 	    } else {
 		HTML_put_character(me, ' ');  /* space char may be ignored */
 		me->in_word = NO;
-	        me->inBoldA = TRUE;
+		me->inBoldA = TRUE;
 	    }
 	} else if (map_href) {
 	    if (me->inA) {
-	        /*
+		/*
 		 *  We're in an anchor and have a USEMAP, so end the anchor
 		 *  and start a new one for the client-side MAP. - FM
 		 */
@@ -3091,24 +3012,24 @@ PRIVATE void HTML_start_element ARGS6(
 		    HTML_put_character(me, '-');
 		}
 	    } else {
-	        HTML_put_character(me, ' ');
-	        me->in_word = NO;
+		HTML_put_character(me, ' ');
+		me->in_word = NO;
 	    }
 	    me->CurrentA = HTAnchor_findChildAndLink(
-		    		me->node_anchor,	/* Parent */
+				me->node_anchor,	/* Parent */
 				NULL,			/* Tag */
 				map_href,		/* Addresss */
 				INTERN_LT);		/* Type */
 	    if (me->CurrentA && title) {
 		if ((dest = HTAnchor_parent(
 				HTAnchor_followMainLink((HTAnchor*)me->CurrentA)
-				          )) != NULL) {
+					  )) != NULL) {
 		    if (!HTAnchor_title(dest))
-		        HTAnchor_setTitle(dest, title);
+			HTAnchor_setTitle(dest, title);
 		}
 	    }
 	    me->CurrentANum = HText_beginAnchor(me->text,
-	    					me->inUnderline,
+						me->inUnderline,
 						me->CurrentA);
 	    if (me->inBoldA == FALSE && me->inBoldH == FALSE) {
 		HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
@@ -3116,7 +3037,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    me->inBoldA = TRUE;
 	    HTML_put_string(me, alt_string);
 	    if (!me->inA) {
-	        if (me->inBoldA == TRUE && me->inBoldH == FALSE) {
+		if (me->inBoldA == TRUE && me->inBoldH == FALSE) {
 		    HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		}
 		me->inBoldA = FALSE;
@@ -3125,9 +3046,9 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 	} else {
 	    /*
-	     *  Just put in the ALT or pseudo-ALT string
-	     *  for the current anchor or inline, with an
-	     *  ID link if indicated. - FM
+	     *	Just put in the ALT or pseudo-ALT string
+	     *	for the current anchor or inline, with an
+	     *	ID link if indicated. - FM
 	     */
 	    HTML_put_character(me, ' ');  /* space char may be ignored */
 	    me->in_word = NO;
@@ -3135,7 +3056,7 @@ PRIVATE void HTML_start_element ARGS6(
 		if ((ID_A = HTAnchor_findChildAndLink(
 				  me->node_anchor,	/* Parent */
 				  id_string,		/* Tag */
-				  NULL,			/* Addresss */
+				  NULL, 		/* Addresss */
 				  (HTLinkType*)0)) != NULL) {	/* Type */
 		    HText_beginAnchor(me->text, me->inUnderline, ID_A);
 		    HText_endAnchor(me->text, 0);
@@ -3167,7 +3088,7 @@ PRIVATE void HTML_start_element ARGS6(
 	if (id_string) {
 	    TRANSLATE_AND_UNESCAPE_TO_STD(&id_string);
 	    if (*id_string == '\0') {
-	        FREE(id_string);
+		FREE(id_string);
 	    }
 	}
 
@@ -3176,22 +3097,22 @@ PRIVATE void HTML_start_element ARGS6(
 	 */
 	if (id_string) {
 	    /*
-	     *  The MAP must be in the current stream, even if it
-	     *  had a BASE tag, so we'll use its address here, but
-	     *  still use the BASE, if present, when resolving the
-	     *  AREA elements in it's content, unless the AREA's
-	     *  HREF is a lone fragment and LYSeekFragAREAinCur is
-	     *  set. - FM && KW
+	     *	The MAP must be in the current stream, even if it
+	     *	had a BASE tag, so we'll use its address here, but
+	     *	still use the BASE, if present, when resolving the
+	     *	AREA elements in it's content, unless the AREA's
+	     *	HREF is a lone fragment and LYSeekFragAREAinCur is
+	     *	set. - FM && KW
 	     */
 	    StrAllocCopy(me->map_address, me->node_anchor->address);
 	    if ((cp = strrchr(me->map_address, '#')) != NULL)
-	        *cp = '\0';
+		*cp = '\0';
 	    StrAllocCat(me->map_address, "#");
 	    StrAllocCat(me->map_address, id_string);
 	    FREE(id_string);
 	    if (present && present[HTML_MAP_TITLE] &&
-	        value[HTML_MAP_TITLE] && *value[HTML_MAP_TITLE] != '\0') {
-	        StrAllocCopy(title, value[HTML_MAP_TITLE]);
+		value[HTML_MAP_TITLE] && *value[HTML_MAP_TITLE] != '\0') {
+		StrAllocCopy(title, value[HTML_MAP_TITLE]);
 		TRANSLATE_AND_UNESCAPE_ENTITIES(&title, TRUE, FALSE);
 		LYTrimHead(title);
 		LYTrimTail(title);
@@ -3202,28 +3123,28 @@ PRIVATE void HTML_start_element ARGS6(
 	    LYAddImageMap(me->map_address, title, me->node_anchor);
 	    FREE(title);
 	}
-        break;
+	break;
 
     case HTML_AREA:
-        if (me->map_address &&
+	if (me->map_address &&
 	    present && present[HTML_AREA_HREF] &&
 	    value[HTML_AREA_HREF] && *value[HTML_AREA_HREF]) {
 	    /*
-	     *  Resolve the HREF. - FM
+	     *	Resolve the HREF. - FM
 	     */
 	    StrAllocCopy(href, value[HTML_AREA_HREF]);
 	    CHECK_FOR_INTERN(href);
 	    url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 
 	    /*
-	     *  Check whether a BASE tag is in effect, and use it
-	     *  for resolving, even though we used this stream's
-	     *  address for locating the MAP itself, unless the
-	     *  HREF is a lone fragment and LYSeekFragAREAinCur
-	     *  is set. - FM
+	     *	Check whether a BASE tag is in effect, and use it
+	     *	for resolving, even though we used this stream's
+	     *	address for locating the MAP itself, unless the
+	     *	HREF is a lone fragment and LYSeekFragAREAinCur
+	     *	is set. - FM
 	     */
 	    if (((me->inBASE && *href != '\0') &&
-	         !(*href == '#' && LYSeekFragAREAinCur == TRUE)) &&
+		 !(*href == '#' && LYSeekFragAREAinCur == TRUE)) &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
 		*temp != '\0')
 		/*
@@ -3233,16 +3154,16 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((((me->inBASE && *href != '\0') &&
-			          !(*href == '#' &&
+				  !(*href == '#' &&
 				    LYSeekFragAREAinCur == TRUE)))
 						?
 				  me->base_href : me->node_anchor->address));
 	    if (!(url_type = is_url(href))) {
-	        temp = HTParse(href, me->node_anchor->address, PARSE_ALL);
+		temp = HTParse(href, me->node_anchor->address, PARSE_ALL);
 		if (!(temp && *temp)) {
 		   FREE(href);
 		   FREE(temp);
@@ -3253,17 +3174,17 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Check for an ALT. - FM
+	     *	Check for an ALT. - FM
 	     */
 	    if (present[HTML_AREA_ALT] &&
-	        value[HTML_AREA_ALT] && *value[HTML_AREA_ALT]) {
-	        StrAllocCopy(alt_string, value[HTML_AREA_ALT]);
+		value[HTML_AREA_ALT] && *value[HTML_AREA_ALT]) {
+		StrAllocCopy(alt_string, value[HTML_AREA_ALT]);
 	    } else if (present[HTML_AREA_TITLE] &&
-	        value[HTML_AREA_TITLE] && *value[HTML_AREA_TITLE]) {
+		value[HTML_AREA_TITLE] && *value[HTML_AREA_TITLE]) {
 		/*
 		 *  Use the TITLE as an ALT. - FM
 		 */
-	        StrAllocCopy(alt_string, value[HTML_AREA_TITLE]);
+		StrAllocCopy(alt_string, value[HTML_AREA_TITLE]);
 	    }
 	    if (alt_string != NULL) {
 		TRANSLATE_AND_UNESCAPE_ENTITIES(&alt_string,
@@ -3271,16 +3192,16 @@ PRIVATE void HTML_start_element ARGS6(
 		/*
 		 *  Make sure it's not just space(s). - FM
 		 */
-	        LYTrimHead(alt_string);
+		LYTrimHead(alt_string);
 		LYTrimTail(alt_string);
 		if (*alt_string == '\0') {
 		    StrAllocCopy(alt_string, href);
 		}
 	    } else {
-	        /*
+		/*
 		 *  Use the HREF as an ALT. - FM
 		 */
-	        StrAllocCopy(alt_string, href);
+		StrAllocCopy(alt_string, href);
 	    }
 
 	    LYAddMapElement(me->map_address, href, alt_string,
@@ -3288,10 +3209,10 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(href);
 	    FREE(alt_string);
 	}
-        break;
+	break;
 
     case HTML_PARAM:
-        /*
+	/*
 	 *  We may need to look at this someday to deal with
 	 *  MAPs, OBJECTs or APPLETs optimally, but just ignore
 	 *  it for now. - FM
@@ -3299,23 +3220,23 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_BODYTEXT:
-        CHECK_ID(HTML_BODYTEXT_ID);
-        /*
+	CHECK_ID(HTML_BODYTEXT_ID);
+	/*
 	 *  We may need to look at this someday to deal with
 	 *  OBJECTs optimally, but just ignore it for now. - FM
 	 */
 	break;
 
     case HTML_TEXTFLOW:
-        CHECK_ID(HTML_BODYTEXT_ID);
-        /*
+	CHECK_ID(HTML_BODYTEXT_ID);
+	/*
 	 *  We may need to look at this someday to deal with
 	 *  APPLETs optimally, but just ignore it for now. - FM
 	 */
 	break;
 
     case HTML_FIG:
-        me->inFIG = TRUE;
+	me->inFIG = TRUE;
 	if (me->inA) {
 	    SET_SKIP_STACK(HTML_A);
 	    HTML_end_element(me, HTML_A, (char **)&include);
@@ -3346,7 +3267,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    (temp = HTParse(href, me->base_href, PARSE_ALL)) &&
 		    *temp != '\0')
 		    /*
-		     *  Use reference related to the base.
+		     *	Use reference related to the base.
 		     */
 		    StrAllocCopy(href, temp);
 		FREE(temp);
@@ -3360,10 +3281,10 @@ PRIVATE void HTML_start_element ARGS6(
 				   me->base_href : me->node_anchor->address));
 
 		me->CurrentA = HTAnchor_findChildAndLink(
-		       			me->node_anchor,	/* Parent */
-		       			NULL,			/* Tag */
-		       			href,			/* Addresss */
-		       			INTERN_LT);		/* Type */
+					me->node_anchor,	/* Parent */
+					NULL,			/* Tag */
+					href,			/* Addresss */
+					INTERN_LT);		/* Type */
 		HText_beginAnchor(me->text, me->inUnderline, me->CurrentA);
 		if (me->inBoldH == FALSE)
 		    HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
@@ -3384,12 +3305,12 @@ PRIVATE void HTML_start_element ARGS6(
     case HTML_OBJECT:
 	if (!me->object_started) {
 	    /*
-	     *  This is an outer OBJECT start tag,
-	     *  i.e., not a nested OBJECT, so save
-	     *  it's relevant attributes. - FM
+	     *	This is an outer OBJECT start tag,
+	     *	i.e., not a nested OBJECT, so save
+	     *	it's relevant attributes. - FM
 	     */
 	    if (present) {
-	        if (present[HTML_OBJECT_DECLARE])
+		if (present[HTML_OBJECT_DECLARE])
 		    me->object_declare = TRUE;
 		if (present[HTML_OBJECT_SHAPES])
 		    me->object_shapes = TRUE;
@@ -3400,7 +3321,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    StrAllocCopy(me->object_usemap, value[HTML_OBJECT_USEMAP]);
 		    TRANSLATE_AND_UNESCAPE_TO_STD(&me->object_usemap);
 		    if (*me->object_usemap == '\0') {
-		        FREE(me->object_usemap);
+			FREE(me->object_usemap);
 		    }
 		}
 		if (present[HTML_OBJECT_ID] &&
@@ -3408,7 +3329,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    StrAllocCopy(me->object_id, value[HTML_OBJECT_ID]);
 		    TRANSLATE_AND_UNESCAPE_TO_STD(&me->object_id);
 		    if (*me->object_id == '\0') {
-		        FREE(me->object_id);
+			FREE(me->object_id);
 		    }
 		}
 		if (present[HTML_OBJECT_TITLE] &&
@@ -3418,7 +3339,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    LYTrimHead(me->object_title);
 		    LYTrimTail(me->object_title);
 		    if (me->object_title == '\0') {
-		        FREE(me->object_title);
+			FREE(me->object_title);
 		    }
 		}
 		if (present[HTML_OBJECT_DATA] &&
@@ -3426,7 +3347,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    StrAllocCopy(me->object_data, value[HTML_OBJECT_DATA]);
 		    TRANSLATE_AND_UNESCAPE_TO_STD(&me->object_data);
 		    if (*me->object_data == '\0') {
-		        FREE(me->object_data);
+			FREE(me->object_data);
 		    }
 		}
 		if (present[HTML_OBJECT_TYPE] &&
@@ -3436,41 +3357,41 @@ PRIVATE void HTML_start_element ARGS6(
 		    LYTrimHead(me->object_type);
 		    LYTrimTail(me->object_type);
 		    if (me->object_type == '\0') {
-		        FREE(me->object_type);
+			FREE(me->object_type);
 		    }
 		}
 		if (present[HTML_OBJECT_CLASSID] &&
 		    value[HTML_OBJECT_CLASSID] &&
 		    *value[HTML_OBJECT_CLASSID]) {
 		    StrAllocCopy(me->object_classid,
-		    		 value[HTML_OBJECT_CLASSID]);
+				 value[HTML_OBJECT_CLASSID]);
 		    TRANSLATE_AND_UNESCAPE_ENTITIES(&me->object_classid, TRUE, FALSE);
 		    LYTrimHead(me->object_classid);
 		    LYTrimTail(me->object_classid);
 		    if (me->object_classid == '\0') {
-		        FREE(me->object_classid);
+			FREE(me->object_classid);
 		    }
 		}
 		if (present[HTML_OBJECT_CODEBASE] &&
 		    value[HTML_OBJECT_CODEBASE] &&
 		    *value[HTML_OBJECT_CODEBASE]) {
 		    StrAllocCopy(me->object_codebase,
-		    		 value[HTML_OBJECT_CODEBASE]);
+				 value[HTML_OBJECT_CODEBASE]);
 		    TRANSLATE_AND_UNESCAPE_TO_STD(&me->object_codebase);
 		    if (*me->object_codebase == '\0') {
-		        FREE(me->object_codebase);
+			FREE(me->object_codebase);
 		    }
 		}
 		if (present[HTML_OBJECT_CODETYPE] &&
 		    value[HTML_OBJECT_CODETYPE] &&
 		    *value[HTML_OBJECT_CODETYPE]) {
 		    StrAllocCopy(me->object_codetype,
-		    		 value[HTML_OBJECT_CODETYPE]);
+				 value[HTML_OBJECT_CODETYPE]);
 		    TRANSLATE_AND_UNESCAPE_ENTITIES(&me->object_codetype, TRUE, FALSE);
 		    LYTrimHead(me->object_codetype);
 		    LYTrimTail(me->object_codetype);
 		    if (me->object_codetype == '\0') {
-		        FREE(me->object_codetype);
+			FREE(me->object_codetype);
 		    }
 		}
 		if (present[HTML_OBJECT_NAME] &&
@@ -3480,12 +3401,12 @@ PRIVATE void HTML_start_element ARGS6(
 		    LYTrimHead(me->object_name);
 		    LYTrimTail(me->object_name);
 		    if (me->object_name == '\0') {
-		        FREE(me->object_name);
+			FREE(me->object_name);
 		    }
 		}
 	    }
 	    /*
-	     *  Set flag that we are accumulating OBJECT content. - FM
+	     *	Set flag that we are accumulating OBJECT content. - FM
 	     */
 	    me->object_started = TRUE;
 	}
@@ -3506,7 +3427,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    (temp = HTParse(href, me->base_href, PARSE_ALL)) &&
 		    *temp != '\0')
 		    /*
-		     *  Use reference related to the base.
+		     *	Use reference related to the base.
 		     */
 		    StrAllocCopy(href, temp);
 		FREE(temp);
@@ -3547,7 +3468,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_APPLET:
-        me->inAPPLET = TRUE;
+	me->inAPPLET = TRUE;
 	me->inAPPLETwithP = FALSE;
 	HTML_put_character(me, ' ');  /* space char may be ignored */
 	/*
@@ -3578,12 +3499,12 @@ PRIVATE void HTML_start_element ARGS6(
 	    TRANSLATE_AND_UNESCAPE_ENTITIES(&alt_string,
 						   me->UsePlainSpace, me->HiddenValue);
 	    /*
-	     *  If it's all spaces and we are making sources links,
-	     *  treat it as zero-length. - FM
+	     *	If it's all spaces and we are making sources links,
+	     *	treat it as zero-length. - FM
 	     */
 	    if (clickable_images) {
-	        LYTrimHead(alt_string);
-	        LYTrimTail(alt_string);
+		LYTrimHead(alt_string);
+		LYTrimTail(alt_string);
 		if (*alt_string == '\0') {
 		    StrAllocCopy(alt_string, "[APPLET]");
 		}
@@ -3591,9 +3512,9 @@ PRIVATE void HTML_start_element ARGS6(
 
 	} else {
 	    if (clickable_images)
-	        StrAllocCopy(alt_string, "[APPLET]");
+		StrAllocCopy(alt_string, "[APPLET]");
 	    else
-	        StrAllocCopy(alt_string, "");
+		StrAllocCopy(alt_string, "");
 	}
 
 	/*
@@ -3605,11 +3526,11 @@ PRIVATE void HTML_start_element ARGS6(
 	    char * code = NULL;
 
 	    /*
-	     *  Check for a CODEBASE attribute. - FM
+	     *	Check for a CODEBASE attribute. - FM
 	     */
 	    if (present[HTML_APPLET_CODEBASE] &&
-	        value[HTML_APPLET_CODEBASE] && *value[HTML_APPLET_CODEBASE]) {
-	        StrAllocCopy(base, value[HTML_APPLET_CODEBASE]);
+		value[HTML_APPLET_CODEBASE] && *value[HTML_APPLET_CODEBASE]) {
+		StrAllocCopy(base, value[HTML_APPLET_CODEBASE]);
 		collapse_spaces(base);
 		TRANSLATE_AND_UNESCAPE_TO_STD(&base);
 		/*
@@ -3630,12 +3551,12 @@ PRIVATE void HTML_start_element ARGS6(
 
 		if (!(url_type = is_url(base))) {
 		    /*
-		     *  Check whether a base tag is in effect.
+		     *	Check whether a base tag is in effect.
 		     */
 		    if (me->inBASE) {
-		        temp = HTParse(base, me->base_href, PARSE_ALL);
+			temp = HTParse(base, me->base_href, PARSE_ALL);
 		    } else {
-		        temp = HTParse(base, me->node_anchor->address,
+			temp = HTParse(base, me->node_anchor->address,
 							PARSE_ALL);
 		    }
 		    StrAllocCopy(base, temp);
@@ -3656,13 +3577,13 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(code);
 
 	    if (href && *href) {
-	        if (me->inA) {
+		if (me->inA) {
 		    if (me->inBoldA == TRUE && me->inBoldH == FALSE)
-		        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+			HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		    HText_endAnchor(me->text, me->CurrentANum);
 		    HTML_put_character(me, '-');
 		}
-	        me->CurrentA = HTAnchor_findChildAndLink(
+		me->CurrentA = HTAnchor_findChildAndLink(
 					me->node_anchor,	/* Parent */
 					NULL,			/* Tag */
 					href,			/* Addresss */
@@ -3675,7 +3596,7 @@ PRIVATE void HTML_start_element ARGS6(
 		HTML_put_string(me, alt_string);
 		if (me->inA == FALSE) {
 		    if (me->inBoldH == FALSE)
-		        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+			HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		    HText_endAnchor(me->text, me->CurrentANum);
 		    me->CurrentANum = 0;
 		}
@@ -3685,7 +3606,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(href);
 	} else if (*alt_string) {
 	    /*
-	     *  Just put up the ALT string, if non-zero. - FM
+	     *	Just put up the ALT string, if non-zero. - FM
 	     */
 	    HTML_put_string(me, alt_string);
 	    HTML_put_character(me, ' ');  /* space char may be ignored */
@@ -3705,12 +3626,12 @@ PRIVATE void HTML_start_element ARGS6(
 	    CHECK_FOR_INTERN(href);
 	    url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 	    if (*href == '\0') {
-	        FREE(href);
+		FREE(href);
 		break;
 	    }
 
 	    /*
-	     *  Check whether a base tag is in effect. - FM
+	     *	Check whether a base tag is in effect. - FM
 	     */
 	    if ((me->inBASE && *href != '#') &&
 		(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
@@ -3722,11 +3643,11 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(temp);
 
 	    /*
-	     *  Check whether to fill in localhost. - FM
+	     *	Check whether to fill in localhost. - FM
 	     */
 	    LYFillLocalFileURL((char **)&href,
 			       ((*href != '#' &&
-			         me->inBASE) ?
+				 me->inBASE) ?
 			       me->base_href : me->node_anchor->address));
 
 	    if (me->inA) {
@@ -3744,7 +3665,7 @@ PRIVATE void HTML_start_element ARGS6(
 					href,			/* Addresss */
 					INTERN_LT);		/* Type */
 	    me->CurrentANum = HText_beginAnchor(me->text,
-	    					me->inUnderline,
+						me->inUnderline,
 						me->CurrentA);
 	    if (me->inBoldH == FALSE)
 		HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
@@ -3793,21 +3714,21 @@ PRIVATE void HTML_start_element ARGS6(
 	    TRANSLATE_AND_UNESCAPE_ENTITIES(&alt_string,
 						   me->UsePlainSpace, me->HiddenValue);
 	    /*
-	     *  If it's all spaces and we are making sources links,
-	     *  treat it as zero-length. - FM
+	     *	If it's all spaces and we are making sources links,
+	     *	treat it as zero-length. - FM
 	     */
 	    if (clickable_images) {
-	        LYTrimHead(alt_string);
-	        LYTrimTail(alt_string);
+		LYTrimHead(alt_string);
+		LYTrimTail(alt_string);
 		if (*alt_string == '\0') {
 		    StrAllocCopy(alt_string, "[EMBED]");
 		}
 	    }
 	} else {
 	    if (pseudo_inline_alts || clickable_images)
-	        StrAllocCopy(alt_string, "[EMBED]");
+		StrAllocCopy(alt_string, "[EMBED]");
 	    else
-	        StrAllocCopy(alt_string, "");
+		StrAllocCopy(alt_string, "");
 	}
 
 	/*
@@ -3826,7 +3747,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    (temp = HTParse(href, me->base_href, PARSE_ALL)) &&
 		    *temp != '\0')
 		    /*
-		     *  Use reference related to the base.
+		     *	Use reference related to the base.
 		     */
 		    StrAllocCopy(href, temp);
 		FREE(temp);
@@ -3839,9 +3760,9 @@ PRIVATE void HTML_start_element ARGS6(
 				     me->inBASE) ?
 				   me->base_href : me->node_anchor->address));
 
-	        if (me->inA) {
+		if (me->inA) {
 		    if (me->inBoldA == TRUE && me->inBoldH == FALSE)
-		        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+			HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		    HText_endAnchor(me->text, me->CurrentANum);
 		    HTML_put_character(me, '-');
 		}
@@ -3860,7 +3781,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		if (me->inA == FALSE) {
 		    if (me->inBoldH == FALSE)
-		        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+			HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 		    HText_endAnchor(me->text, me->CurrentANum);
 		    me->CurrentANum = 0;
 		}
@@ -3870,7 +3791,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    FREE(href);
 	} else if (*alt_string) {
 	    /*
-	     *  Just put up the ALT string, if non-zero. - FM
+	     *	Just put up the ALT string, if non-zero. - FM
 	     */
 	    HTML_put_string(me, alt_string);
 	    HTML_put_character(me, ' ');  /* space char may be ignored */
@@ -3894,15 +3815,15 @@ PRIVATE void HTML_start_element ARGS6(
 
 	if (me->inFIG)
 	    /*
-	     *  Assume all text in the FIG container is intended
-	     *  to be paragraphed. - FM
+	     *	Assume all text in the FIG container is intended
+	     *	to be paragraphed. - FM
 	     */
 	    me->inFIGwithP = TRUE;
 
 	if (me->inAPPLET)
 	    /*
-	     *  Assume all text in the APPLET container is intended
-	     *  to be paragraphed. - FM
+	     *	Assume all text in the APPLET container is intended
+	     *	to be paragraphed. - FM
 	     */
 	    me->inAPPLETwithP = TRUE;
 
@@ -3925,15 +3846,15 @@ PRIVATE void HTML_start_element ARGS6(
 
 	if (me->inFIG)
 	    /*
-	     *  Assume all text in the FIG container is intended
-	     *  to be paragraphed. - FM
+	     *	Assume all text in the FIG container is intended
+	     *	to be paragraphed. - FM
 	     */
 	    me->inFIGwithP = TRUE;
 
 	if (me->inAPPLET)
 	    /*
-	     *  Assume all text in the APPLET container is intended
-	     *  to be paragraphed. - FM
+	     *	Assume all text in the APPLET container is intended
+	     *	to be paragraphed. - FM
 	     */
 	    me->inAPPLETwithP = TRUE;
 
@@ -3953,15 +3874,15 @@ PRIVATE void HTML_start_element ARGS6(
 	    HTAnchor *link_dest;
 
 	    /*
-	     *  FORM may have been declared SGML_EMPTY in HTMLDTD.c, and
-	     *  SGML_character() in SGML.c may check for a FORM end
-	     *  tag to call HTML_end_element() directly (with a
-	     *  check in that to bypass decrementing of the HTML
-	     *  parser's stack), so if we have an open FORM, close
-	     *  that one now. - FM
+	     *	FORM may have been declared SGML_EMPTY in HTMLDTD.c, and
+	     *	SGML_character() in SGML.c may check for a FORM end
+	     *	tag to call HTML_end_element() directly (with a
+	     *	check in that to bypass decrementing of the HTML
+	     *	parser's stack), so if we have an open FORM, close
+	     *	that one now. - FM
 	     */
 	    if (me->inFORM) {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr,
 			    "HTML: Missing FORM end tag. Faking it!\n");
 		}
@@ -3970,17 +3891,17 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Set to know we are in a new form.
+	     *	Set to know we are in a new form.
 	     */
 	    me->inFORM = TRUE;
 
 	    if (present && present[HTML_FORM_ACCEPT_CHARSET]) {
-	    	accept_cs = value[HTML_FORM_ACCEPT_CHARSET] ?
-		    	    value[HTML_FORM_ACCEPT_CHARSET] : "UNKNOWN";
+		accept_cs = value[HTML_FORM_ACCEPT_CHARSET] ?
+			    value[HTML_FORM_ACCEPT_CHARSET] : "UNKNOWN";
 	    }
 	    if (present && present[HTML_FORM_ACTION] &&
-	        value[HTML_FORM_ACTION])  {
-	        /*
+		value[HTML_FORM_ACTION])  {
+		/*
 		 *  Prepare to do housekeeping on the reference. - FM
 		 */
 		StrAllocCopy(action, value[HTML_FORM_ACTION]);
@@ -3994,57 +3915,57 @@ PRIVATE void HTML_start_element ARGS6(
 		if ((me->inBASE && me->base_href && *me->base_href) &&
 		    (temp = HTParse(action, me->base_href, PARSE_ALL)) &&
 		    *temp != '\0') {
-	            /*
-		     *  Use action related to the base.
+		    /*
+		     *	Use action related to the base.
 		     */
 		    StrAllocCopy(action, temp);
-	        } else if ((temp = HTParse(action,
+		} else if ((temp = HTParse(action,
 					   me->node_anchor->address,
 					   PARSE_ALL)) &&
 		    *temp != '\0') {
-	            /*
-		     *  Use action related to the current document.
+		    /*
+		     *	Use action related to the current document.
 		     */
 		    StrAllocCopy(action, temp);
-	        } else {
+		} else {
 		    FREE(action);
 		}
 		FREE(temp);
 	    }
 	    if (!(action && *action)) {
-	    	if (me->inBASE && me->base_href && *me->base_href) {
+		if (me->inBASE && me->base_href && *me->base_href) {
 		     StrAllocCopy(action, me->base_href);
 		} else {
 		     StrAllocCopy(action, me->node_anchor->address);
 		}
 	    }
 	    if (action) {
-	        source = HTAnchor_findChildAndLink(me->node_anchor,
+		source = HTAnchor_findChildAndLink(me->node_anchor,
 						   NULL,
 						   action,
 						   (HTLinkType*)0);
 		if ((link_dest = HTAnchor_followMainLink((HTAnchor *)source)) != NULL) {
 		    /*
-		     *  Memory leak fixed.
-		     *  05-28-94 Lynx 2-3-1 Garrett Arch Blythe
+		     *	Memory leak fixed.
+		     *	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
 		     */
 		    auto char *cp_freeme = HTAnchor_address(link_dest);
-                    if (cp_freeme != NULL) {
-                    	StrAllocCopy(action, cp_freeme);
+		    if (cp_freeme != NULL) {
+			StrAllocCopy(action, cp_freeme);
 			FREE(cp_freeme);
 		    } else {
-                    	StrAllocCopy(action, "");
+			StrAllocCopy(action, "");
 		    }
 		}
 	    }
 
 	    if (present && present[HTML_FORM_METHOD])
-	    	StrAllocCopy(method, value[HTML_FORM_METHOD] ?
+		StrAllocCopy(method, value[HTML_FORM_METHOD] ?
 				     value[HTML_FORM_METHOD] : "GET");
 
 	    if (present && present[HTML_FORM_ENCTYPE] &&
-	        value[HTML_FORM_ENCTYPE] && *value[HTML_FORM_ENCTYPE]) {
-	    	StrAllocCopy(enctype, value[HTML_FORM_ENCTYPE]);
+		value[HTML_FORM_ENCTYPE] && *value[HTML_FORM_ENCTYPE]) {
+		StrAllocCopy(enctype, value[HTML_FORM_ENCTYPE]);
 		/*
 		 *  Force the enctype value to all lower case. - FM
 		 */
@@ -4057,11 +3978,11 @@ PRIVATE void HTML_start_element ARGS6(
 		 *  Check for a TITLE attribute, and if none is present,
 		 *  check for a SUBJECT attribute as a synonym. - FM
 		 */
-	        if (present[HTML_FORM_TITLE] &&
-	            value[HTML_FORM_TITLE] &&
+		if (present[HTML_FORM_TITLE] &&
+		    value[HTML_FORM_TITLE] &&
 		    *value[HTML_FORM_TITLE] != '\0') {
 		    StrAllocCopy(title, value[HTML_FORM_TITLE]);
-	        } else if (present[HTML_FORM_SUBJECT] &&
+		} else if (present[HTML_FORM_SUBJECT] &&
 			   value[HTML_FORM_SUBJECT] &&
 			   *value[HTML_FORM_SUBJECT] != '\0') {
 		    StrAllocCopy(title, value[HTML_FORM_SUBJECT]);
@@ -4071,7 +3992,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    LYTrimHead(title);
 		    LYTrimTail(title);
 		    if (*title == '\0') {
-		        FREE(title);
+			FREE(title);
 		    }
 		}
 	    }
@@ -4089,22 +4010,22 @@ PRIVATE void HTML_start_element ARGS6(
     case HTML_FIELDSET:
 	LYEnsureDoubleSpace(me);
 	LYResetParagraphAlignment(me);
-        CHECK_ID(HTML_FIELDSET_ID);
-        break;
+	CHECK_ID(HTML_FIELDSET_ID);
+	break;
 
     case HTML_LEGEND:
 	LYEnsureDoubleSpace(me);
 	LYResetParagraphAlignment(me);
-        CHECK_ID(HTML_LEGEND_ID);
-        break;
+	CHECK_ID(HTML_LEGEND_ID);
+	break;
 
     case HTML_LABEL:
-        CHECK_ID(HTML_LABEL_ID);
-        break;
+	CHECK_ID(HTML_LABEL_ID);
+	break;
 
     case HTML_KEYGEN:
-        CHECK_ID(HTML_KEYGEN_ID);
-        break;
+	CHECK_ID(HTML_KEYGEN_ID);
+	break;
 
     case HTML_BUTTON:
 	{
@@ -4123,15 +4044,15 @@ PRIVATE void HTML_start_element ARGS6(
 
 	    UPDATE_STYLE;
 	    if ((present && present[HTML_BUTTON_TYPE] &&
-	         value[HTML_BUTTON_TYPE]) &&
+		 value[HTML_BUTTON_TYPE]) &&
 		(!strcasecomp(value[HTML_BUTTON_TYPE], "submit") ||
 		 !strcasecomp(value[HTML_BUTTON_TYPE], "reset"))) {
-	        /*
+		/*
 		 *  It's a button for submitting or resetting a form. - FM
 		 */
 		I.type = value[HTML_BUTTON_TYPE];
 	    } else {
-	        /*
+		/*
 		 *  Ugh, it's a button for a script. - FM
 		 */
 		HTML_put_string(me," [BUTTON] ");
@@ -4139,13 +4060,14 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Make sure we're in a form.
+	     *	Make sure we're in a form.
 	     */
 	    if (!me->inFORM) {
-	        if (TRACE) {
-		    fprintf(stderr, "Bad HTML: BUTTON tag not within FORM element *****\n");
+		if (TRACE) {
+		    fprintf(stderr,
+			    "Bad HTML: BUTTON tag not within FORM tag\n");
 		} else if (!me->inBadHTML) {
-	            _statusline(BAD_HTML_USE_TRACE);
+		    _statusline(BAD_HTML_USE_TRACE);
 		    me->inBadHTML = TRUE;
 		    sleep(MessageSecs);
 		}
@@ -4158,13 +4080,13 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Before any input field, add a collapsible space if
-	     *  we're not in a PRE block, to promote a wrap there
-	     *  for any long values that would extent past the right
-	     *  margin from our current position in the line.  If
-	     *  we are in a PRE block, start a new line if the last
-	     *  line already is within 6 characters of the wrap point
-	     *  for PRE blocks. - FM
+	     *	Before any input field, add a collapsible space if
+	     *	we're not in a PRE block, to promote a wrap there
+	     *	for any long values that would extent past the right
+	     *	margin from our current position in the line.  If
+	     *	we are in a PRE block, start a new line if the last
+	     *	line already is within 6 characters of the wrap point
+	     *	for PRE blocks. - FM
 	     */
 	    if (me->sp[0].tag_number != HTML_PRE && !me->inPRE &&
 		me->sp->style->freeFormat) {
@@ -4178,7 +4100,7 @@ PRIVATE void HTML_start_element ARGS6(
 
 	    if (!(present && present[HTML_BUTTON_NAME] &&
 		  value[HTML_BUTTON_NAME])) {
-	        I.name = "";
+		I.name = "";
 	    } else if (strchr(value[HTML_BUTTON_NAME], '&') == NULL) {
 		I.name = value[HTML_BUTTON_NAME];
 	    } else {
@@ -4188,8 +4110,8 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    if (present && present[HTML_BUTTON_VALUE] &&
-	        value[HTML_BUTTON_VALUE] && *value[HTML_BUTTON_VALUE]) {
-	        /*
+		value[HTML_BUTTON_VALUE] && *value[HTML_BUTTON_VALUE]) {
+		/*
 		 *  Convert any HTML entities or decimal escaping. - FM
 		 */
 		int len;
@@ -4215,29 +4137,29 @@ PRIVATE void HTML_start_element ARGS6(
 		I.disabled = YES;
 
 	    if (present && present[HTML_BUTTON_CLASS] && /* Not yet used. */
-	        value[HTML_BUTTON_CLASS] && *value[HTML_BUTTON_CLASS])
+		value[HTML_BUTTON_CLASS] && *value[HTML_BUTTON_CLASS])
 		I.class = value[HTML_BUTTON_CLASS];
 
 	    if (present && present[HTML_BUTTON_ID] &&
-	        value[HTML_BUTTON_ID] && *value[HTML_BUTTON_ID]) {
+		value[HTML_BUTTON_ID] && *value[HTML_BUTTON_ID]) {
 		I.id = value[HTML_BUTTON_ID];
 		CHECK_ID(HTML_BUTTON_ID);
 	    }
 
 	    if (present && present[HTML_BUTTON_LANG] && /* Not yet used. */
-	        value[HTML_BUTTON_LANG] && *value[HTML_BUTTON_LANG])
+		value[HTML_BUTTON_LANG] && *value[HTML_BUTTON_LANG])
 		I.lang = value[HTML_BUTTON_LANG];
 
 	    chars = HText_beginInput(me->text, me->inUnderline, &I);
 	    /*
-	     *  Submit and reset buttons have values which don't change,
-	     *  so HText_beginInput() sets I.value to the string which
-	     *  should be displayed, and we'll enter that instead of
-	     *  underscore placeholders into the HText structure to
-	     *  see it instead of underscores when dumping or printing.
-	     *  We also won't worry about a wrap in PRE blocks, because
-	     *  the line editor never is invoked for submit or reset
-	     *  buttons. - LE & FM
+	     *	Submit and reset buttons have values which don't change,
+	     *	so HText_beginInput() sets I.value to the string which
+	     *	should be displayed, and we'll enter that instead of
+	     *	underscore placeholders into the HText structure to
+	     *	see it instead of underscores when dumping or printing.
+	     *	We also won't worry about a wrap in PRE blocks, because
+	     *	the line editor never is invoked for submit or reset
+	     *	buttons. - LE & FM
 	     */
 	    if (me->sp[0].tag_number == HTML_PRE ||
 		    !me->sp->style->freeFormat) {
@@ -4271,9 +4193,9 @@ PRIVATE void HTML_start_element ARGS6(
 		 *  (shouldn't have), we'll continue padding with nbsp
 		 *  up to the length of chars. - FM
 		 */
-	        for (i = 0; I.value[i]; i++) {
+		for (i = 0; I.value[i]; i++) {
 		    HTML_put_character(me,
-			   	       (I.value[i] ==  ' ' ?
+				       (I.value[i] ==  ' ' ?
 					HT_NON_BREAK_SPACE : I.value[i]));
 		}
 		while (i < chars) {
@@ -4312,13 +4234,13 @@ PRIVATE void HTML_start_element ARGS6(
 	    UPDATE_STYLE;
 
 	    /*
-	     *  Before any input field, add a collapsible space if
-	     *  we're not in a PRE block, to promote a wrap there
-	     *  for any long values that would extent past the right
-	     *  margin from our current position in the line.  If
-	     *  we are in a PRE block, start a new line if the last
-	     *  line already is within 6 characters of the wrap point
-	     *  for PRE blocks. - FM
+	     *	Before any input field, add a collapsible space if
+	     *	we're not in a PRE block, to promote a wrap there
+	     *	for any long values that would extent past the right
+	     *	margin from our current position in the line.  If
+	     *	we are in a PRE block, start a new line if the last
+	     *	line already is within 6 characters of the wrap point
+	     *	for PRE blocks. - FM
 	     */
 	    if (me->sp[0].tag_number != HTML_PRE && !me->inPRE &&
 		me->sp->style->freeFormat) {
@@ -4330,19 +4252,19 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Get the TYPE and make sure we can handle it. - FM
+	     *	Get the TYPE and make sure we can handle it. - FM
 	     */
 	    if (present && present[HTML_INPUT_TYPE] &&
-	        value[HTML_INPUT_TYPE] && *value[HTML_INPUT_TYPE]) {
+		value[HTML_INPUT_TYPE] && *value[HTML_INPUT_TYPE]) {
 		I.type = value[HTML_INPUT_TYPE];
 
 		if (!strcasecomp(I.type, "range")) {
 		    if (present[HTML_INPUT_MIN])
-		        I.min = value[HTML_INPUT_MIN];
+			I.min = value[HTML_INPUT_MIN];
 		    if (present[HTML_INPUT_MAX])
-		        I.max = value[HTML_INPUT_MAX];
+			I.max = value[HTML_INPUT_MAX];
 		    /*
-		     *  Not yet implemented.
+		     *	Not yet implemented.
 		     */
 		    HTML_put_string(me,"[RANGE Input] (Not yet implemented.)");
 #ifdef NOTDEFINED
@@ -4350,22 +4272,22 @@ PRIVATE void HTML_start_element ARGS6(
 			HText_DisableCurrentForm();
 #endif /* NOTDEFINED */
 		    if (TRACE)
-		        fprintf(stderr, "HTML: Ignoring TYPE=\"range\"\n");
+			fprintf(stderr, "HTML: Ignoring TYPE=\"range\"\n");
 		    break;
 
 		} else if (!strcasecomp(I.type, "file")) {
 		    if (present[HTML_INPUT_ACCEPT])
-		        I.accept = value[HTML_INPUT_ACCEPT];
+			I.accept = value[HTML_INPUT_ACCEPT];
 		    /*
-		     *  Not yet implemented.
+		     *	Not yet implemented.
 		     */
 		    if (me->inUnderline == FALSE) {
-		        HText_appendCharacter(me->text,
+			HText_appendCharacter(me->text,
 					      LY_UNDERLINE_START_CHAR);
 		    }
 		    HTML_put_string(me,"[FILE Input] (Not yet implemented.)");
 		    if (me->inUnderline == FALSE) {
-		        HText_appendCharacter(me->text,
+			HText_appendCharacter(me->text,
 					      LY_UNDERLINE_END_CHAR);
 		    }
 #ifdef NOTDEFINED
@@ -4373,12 +4295,12 @@ PRIVATE void HTML_start_element ARGS6(
 			HText_DisableCurrentForm();
 #endif /* NOTDEFINED */
 		    if (TRACE)
-		        fprintf(stderr, "HTML: Ignoring TYPE=\"file\"\n");
+			fprintf(stderr, "HTML: Ignoring TYPE=\"file\"\n");
 		    break;
 
 		} else if (!strcasecomp(I.type, "button")) {
 		    /*
-		     *  Ugh, a button for a script.
+		     *	Ugh, a button for a script.
 		     */
 		    HTML_put_string(me,"[BUTTON] ");
 		    break;
@@ -4386,13 +4308,14 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Check if we're in a form. - FM
+	     *	Check if we're in a form. - FM
 	     */
 	    if (!me->inFORM) {
-	        if (TRACE) {
-		    fprintf(stderr, "Bad HTML: INPUT tag not within FORM element *****\n");
+		if (TRACE) {
+		    fprintf(stderr,
+			    "Bad HTML: INPUT tag not within FORM tag\n");
 		} else if (!me->inBadHTML) {
-	            _statusline(BAD_HTML_USE_TRACE);
+		    _statusline(BAD_HTML_USE_TRACE);
 		    me->inBadHTML = TRUE;
 		    sleep(MessageSecs);
 		}
@@ -4405,12 +4328,12 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Check for an unclosed TEXTAREA.
+	     *	Check for an unclosed TEXTAREA.
 	     */
 	    if (me->inTEXTAREA) {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr,
-			    "Bad HTML: Missing TEXTAREA end tag. *****\n");
+			    "Bad HTML: Missing TEXTAREA end tag.\n");
 		} else if (!me->inBadHTML) {
 		    _statusline(BAD_HTML_USE_TRACE);
 		    me->inBadHTML = TRUE;
@@ -4419,10 +4342,10 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Check for an unclosed SELECT, try to close it if found.
+	     *	Check for an unclosed SELECT, try to close it if found.
 	     */
 	    if (me->inSELECT) {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr, "HTML: Missing SELECT end tag, faking it...\n");
 		}
 		if (me->sp->tag_number != HTML_SELECT) {
@@ -4432,11 +4355,11 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 
 	    /*
-	     *  Handle the INPUT as for a FORM. - FM
+	     *	Handle the INPUT as for a FORM. - FM
 	     */
 	    if (!(present && present[HTML_INPUT_NAME] &&
 		  value[HTML_INPUT_NAME])) {
-	        I.name = "";
+		I.name = "";
 	    } else if (strchr(value[HTML_INPUT_NAME], '&') == NULL) {
 		I.name = value[HTML_INPUT_NAME];
 	    } else {
@@ -4448,7 +4371,7 @@ PRIVATE void HTML_start_element ARGS6(
 		 value[HTML_INPUT_ALT] && *value[HTML_INPUT_ALT] &&
 		 I.type && !strcasecomp(I.type, "image")) &&
 		!(present && present[HTML_INPUT_VALUE] &&
-	          value[HTML_INPUT_VALUE] && *value[HTML_INPUT_VALUE])) {
+		  value[HTML_INPUT_VALUE] && *value[HTML_INPUT_VALUE])) {
 		/*
 		 *  This is a TYPE="image" using an ALT rather than
 		 *  VALUE attribute to indicate the link string for
@@ -4459,8 +4382,8 @@ PRIVATE void HTML_start_element ARGS6(
 		UseALTasVALUE = TRUE;
 	    }
 	    if (clickable_images == TRUE &&
-	        present && present[HTML_INPUT_SRC] &&
-	        value[HTML_INPUT_SRC] && *value[HTML_INPUT_SRC] &&
+		present && present[HTML_INPUT_SRC] &&
+		value[HTML_INPUT_SRC] && *value[HTML_INPUT_SRC] &&
 		I.type && !strcasecomp(I.type, "image")) {
 		StrAllocCopy(href, value[HTML_INPUT_SRC]);
 		/*
@@ -4472,7 +4395,7 @@ PRIVATE void HTML_start_element ARGS6(
 		url_type = LYLegitimizeHREF(me, (char**)&href, TRUE, TRUE);
 		if (*href) {
 		    /*
-		     *  Check whether a base tag is in effect. - FM
+		     *	Check whether a base tag is in effect. - FM
 		     */
 		    if ((me->inBASE && *href != '#') &&
 			(temp = HTParse(href, me->base_href, PARSE_ALL)) &&
@@ -4484,23 +4407,23 @@ PRIVATE void HTML_start_element ARGS6(
 		    FREE(temp);
 
 		    /*
-		     *  Check whether to fill in localhost. - FM
+		     *	Check whether to fill in localhost. - FM
 		     */
 		    LYFillLocalFileURL((char **)&href,
 				       ((*href != '#' &&
-				         me->inBASE) ?
+					 me->inBASE) ?
 				       me->base_href :
 				       me->node_anchor->address));
 
 		    if (me->inA) {
 			SET_SKIP_STACK(HTML_A);
-		        HTML_end_element(me, HTML_A, (char **)&include);
+			HTML_end_element(me, HTML_A, (char **)&include);
 		    }
 		    me->CurrentA = HTAnchor_findChildAndLink(
-		       			me->node_anchor,	/* Parent */
-		       			NULL,			/* Tag */
-		       			href,			/* Addresss */
-		       			(HTLinkType*)0);	/* Type */
+					me->node_anchor,	/* Parent */
+					NULL,			/* Tag */
+					href,			/* Addresss */
+					(HTLinkType*)0);	/* Type */
 		    HText_beginAnchor(me->text, me->inUnderline, me->CurrentA);
 		    if (me->inBoldH == FALSE)
 			HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
@@ -4510,13 +4433,13 @@ PRIVATE void HTML_start_element ARGS6(
 		    HText_endAnchor(me->text, 0);
 		    HTML_put_character(me, '-');
 		    HaveSRClink = TRUE;
-	        }
-	        FREE(href);
+		}
+		FREE(href);
 	    }
 	    if ((UseALTasVALUE == TRUE) ||
-	        (present && present[HTML_INPUT_VALUE] &&
-	         value[HTML_INPUT_VALUE] && *value[HTML_INPUT_VALUE])) {
-	        /*
+		(present && present[HTML_INPUT_VALUE] &&
+		 value[HTML_INPUT_VALUE] && *value[HTML_INPUT_VALUE])) {
+		/*
 		 *  Convert any HTML entities or decimal escaping. - FM
 		 */
 		int CurrentCharSet = current_char_set;
@@ -4555,15 +4478,15 @@ PRIVATE void HTML_start_element ARGS6(
 		I.value = I_value;
 		if (me->UsePlainSpace == TRUE) {
 		    /*
-		     *  Convert any newlines or tabs to spaces,
-		     *  and trim any lead or trailing spaces. - FM
+		     *	Convert any newlines or tabs to spaces,
+		     *	and trim any lead or trailing spaces. - FM
 		     */
 		    convert_to_spaces(I.value, FALSE);
 		    while (I.value && I.value[0] == ' ')
-		        I.value++;
+			I.value++;
 		    len = strlen(I.value) - 1;
 		    while (len > 0 && I.value[len] == ' ')
-		        I.value[len--] = '\0';
+			I.value[len--] = '\0';
 		}
 		me->UsePlainSpace = FALSE;
 
@@ -4577,7 +4500,7 @@ PRIVATE void HTML_start_element ARGS6(
 		    HTCJK = CurrentHTCJK;
 		}
 	    } else if (HaveSRClink == TRUE) {
-	        /*
+		/*
 		 *  We put up an [IMAGE] link and '-' for a TYPE="image"
 		 *  and didn't get a VALUE or ALT string, so fake a
 		 *  "Submit" value.  If we didn't put up a link, then
@@ -4589,58 +4512,58 @@ PRIVATE void HTML_start_element ARGS6(
 	    if (present && present[HTML_INPUT_CHECKED])
 		I.checked = YES;
 	    if (present && present[HTML_INPUT_SIZE] &&
-	        value[HTML_INPUT_SIZE] && *value[HTML_INPUT_SIZE])
+		value[HTML_INPUT_SIZE] && *value[HTML_INPUT_SIZE])
 		I.size = value[HTML_INPUT_SIZE];
 	    if (present && present[HTML_INPUT_MAXLENGTH] &&
-	        value[HTML_INPUT_MAXLENGTH] && *value[HTML_INPUT_MAXLENGTH])
+		value[HTML_INPUT_MAXLENGTH] && *value[HTML_INPUT_MAXLENGTH])
 		I.maxlength = value[HTML_INPUT_MAXLENGTH];
 	    if (present && present[HTML_INPUT_DISABLED])
 		I.disabled = YES;
 
 	    if (present && present[HTML_INPUT_ACCEPT_CHARSET]) { /* Not yet used. */
 		I.accept_cs = value[HTML_INPUT_ACCEPT_CHARSET] ?
-		    	      value[HTML_INPUT_ACCEPT_CHARSET] : "UNKNOWN";
+			      value[HTML_INPUT_ACCEPT_CHARSET] : "UNKNOWN";
 	    }
 	    if (present && present[HTML_INPUT_ALIGN] && /* Not yet used. */
-	        value[HTML_INPUT_ALIGN] && *value[HTML_INPUT_ALIGN])
+		value[HTML_INPUT_ALIGN] && *value[HTML_INPUT_ALIGN])
 		I.align = value[HTML_INPUT_ALIGN];
 	    if (present && present[HTML_INPUT_CLASS] && /* Not yet used. */
-	        value[HTML_INPUT_CLASS] && *value[HTML_INPUT_CLASS])
+		value[HTML_INPUT_CLASS] && *value[HTML_INPUT_CLASS])
 		I.class = value[HTML_INPUT_CLASS];
 	    if (present && present[HTML_INPUT_ERROR] && /* Not yet used. */
-	        value[HTML_INPUT_ERROR] && *value[HTML_INPUT_ERROR])
+		value[HTML_INPUT_ERROR] && *value[HTML_INPUT_ERROR])
 		I.error = value[HTML_INPUT_ERROR];
 	    if (present && present[HTML_INPUT_HEIGHT] && /* Not yet used. */
-	        value[HTML_INPUT_HEIGHT] && *value[HTML_INPUT_HEIGHT])
+		value[HTML_INPUT_HEIGHT] && *value[HTML_INPUT_HEIGHT])
 		I.height = value[HTML_INPUT_HEIGHT];
 	    if (present && present[HTML_INPUT_WIDTH] && /* Not yet used. */
-	        value[HTML_INPUT_WIDTH] && *value[HTML_INPUT_WIDTH])
+		value[HTML_INPUT_WIDTH] && *value[HTML_INPUT_WIDTH])
 		I.width = value[HTML_INPUT_WIDTH];
 	    if (present && present[HTML_INPUT_ID] &&
-	        value[HTML_INPUT_ID] && *value[HTML_INPUT_ID]) {
+		value[HTML_INPUT_ID] && *value[HTML_INPUT_ID]) {
 		I.id = value[HTML_INPUT_ID];
 		CHECK_ID(HTML_INPUT_ID);
 	    }
 	    if (present && present[HTML_INPUT_LANG] && /* Not yet used. */
-	        value[HTML_INPUT_LANG] && *value[HTML_INPUT_LANG])
+		value[HTML_INPUT_LANG] && *value[HTML_INPUT_LANG])
 		I.lang = value[HTML_INPUT_LANG];
 	    if (present && present[HTML_INPUT_MD] && /* Not yet used. */
-	        value[HTML_INPUT_MD] && *value[HTML_INPUT_MD])
+		value[HTML_INPUT_MD] && *value[HTML_INPUT_MD])
 		I.md = value[HTML_INPUT_MD];
 
 	    chars = HText_beginInput(me->text, me->inUnderline, &I);
 	    /*
-	     *  Submit and reset buttons have values which don't change,
-	     *  so HText_beginInput() sets I.value to the string which
-	     *  should be displayed, and we'll enter that instead of
-	     *  underscore placeholders into the HText structure to
-	     *  see it instead of underscores when dumping or printing.
-	     *  We also won't worry about a wrap in PRE blocks, because
-	     *  the line editor never is invoked for submit or reset
-	     *  buttons. - LE & FM
+	     *	Submit and reset buttons have values which don't change,
+	     *	so HText_beginInput() sets I.value to the string which
+	     *	should be displayed, and we'll enter that instead of
+	     *	underscore placeholders into the HText structure to
+	     *	see it instead of underscores when dumping or printing.
+	     *	We also won't worry about a wrap in PRE blocks, because
+	     *	the line editor never is invoked for submit or reset
+	     *	buttons. - LE & FM
 	     */
 	    if (I.type &&
-	        (!strcasecomp(I.type,"submit") ||
+		(!strcasecomp(I.type,"submit") ||
 		 !strcasecomp(I.type,"reset") ||
 		 !strcasecomp(I.type,"image")))
 		IsSubmitOrReset = TRUE;
@@ -4679,7 +4602,7 @@ PRIVATE void HTML_start_element ARGS6(
 			!me->sp->style->freeFormat)
 		       && chars > 6 &&
 		       IsSubmitOrReset == FALSE) {
-	        /*
+		/*
 		 *  This is not a submit or reset button, and we are
 		 *  in a PRE block with a field intended to exceed 6
 		 *  character widths.  The code inadequately handles
@@ -4696,13 +4619,13 @@ PRIVATE void HTML_start_element ARGS6(
 		 *  highlighted when not editing (Yuk!). - FM
 		 */
 		for (i = 0; i < 6; i++) {
-	            HTML_put_character(me, '_');
+		    HTML_put_character(me, '_');
 		    chars--;
 		}
 		HText_setIgnoreExcess(me->text, TRUE);
 	    }
 	    if (IsSubmitOrReset == FALSE) {
-	        /*
+		/*
 		 *  This is not a submit or reset button,
 		 *  so output the rest of the underscore
 		 *  placeholders, if any more are needed. - FM
@@ -4713,37 +4636,37 @@ PRIVATE void HTML_start_element ARGS6(
 		if (me->sp[0].tag_number == HTML_PRE ||
 		    !me->sp->style->freeFormat) {
 		    /*
-		     *  We have a submit or reset button in a PRE block,
-		     *  so output the entire value from the markup.  If
-		     *  it extends to the right margin, it will wrap
-		     *  there, and only the portion before that wrap will
-		     *  be hightlighted on screen display (Yuk!) but we
-		     *  may as well show the rest of the full value on
-		     *  the next or more lines. - FM
+		     *	We have a submit or reset button in a PRE block,
+		     *	so output the entire value from the markup.  If
+		     *	it extends to the right margin, it will wrap
+		     *	there, and only the portion before that wrap will
+		     *	be hightlighted on screen display (Yuk!) but we
+		     *	may as well show the rest of the full value on
+		     *	the next or more lines. - FM
 		     */
 		    while (I.value[i])
-		        HTML_put_character(me, I.value[i++]);
+			HTML_put_character(me, I.value[i++]);
 		} else {
 		    /*
-		     *  The submit or reset button is not in a PRE block.
-		     *  Note that if a wrap occurs before outputting the
-		     *  entire value, the wrapped portion will not be
-		     *  highlighted or clearly indicated as part of the
-		     *  link for submission or reset (Yuk!).
-		     *  We'll replace any spaces in the submit or reset
-		     *  button value with nbsp, to promote a wrap at the
-		     *  space we ensured would be present before the start
-		     *  of the string, as when we use all underscores
-		     *  instead of the INPUT's actual value, but we could
-		     *  still get a wrap at the right margin, instead, if
-		     *  the value is greater than a line width for the
-		     *  current style.  Also, if chars somehow ended up
-		     *  longer than the length of the actual value
-		     *  (shouldn't have), we'll continue padding with nbsp
-		     *  up to the length of chars. - FM
+		     *	The submit or reset button is not in a PRE block.
+		     *	Note that if a wrap occurs before outputting the
+		     *	entire value, the wrapped portion will not be
+		     *	highlighted or clearly indicated as part of the
+		     *	link for submission or reset (Yuk!).
+		     *	We'll replace any spaces in the submit or reset
+		     *	button value with nbsp, to promote a wrap at the
+		     *	space we ensured would be present before the start
+		     *	of the string, as when we use all underscores
+		     *	instead of the INPUT's actual value, but we could
+		     *	still get a wrap at the right margin, instead, if
+		     *	the value is greater than a line width for the
+		     *	current style.	Also, if chars somehow ended up
+		     *	longer than the length of the actual value
+		     *	(shouldn't have), we'll continue padding with nbsp
+		     *	up to the length of chars. - FM
 		     */
-	            for (i = 0; I.value[i]; i++)
-		        HTML_put_character(me,
+		    for (i = 0; I.value[i]; i++)
+			HTML_put_character(me,
 					   (I.value[i] ==  ' ' ?
 					    HT_NON_BREAK_SPACE : I.value[i]));
 		    while (i < chars)
@@ -4763,14 +4686,14 @@ PRIVATE void HTML_start_element ARGS6(
 	if (!me->inFORM) {
 	    if (TRACE) {
 		fprintf(stderr,
-			"Bad HTML: TEXTAREA start tag not within FORM element *****\n");
+			"Bad HTML: TEXTAREA start tag not within FORM tag\n");
 	    } else if (!me->inBadHTML) {
-	        _statusline(BAD_HTML_USE_TRACE);
+		_statusline(BAD_HTML_USE_TRACE);
 		me->inBadHTML = TRUE;
-	        sleep(MessageSecs);
+		sleep(MessageSecs);
 	    }
 	    /*
-	     *  Too likely to cause a crash, so we'll ignore it. - FM
+	     *	Too likely to cause a crash, so we'll ignore it. - FM
 	     */
 	    break;
 	}
@@ -4783,7 +4706,7 @@ PRIVATE void HTML_start_element ARGS6(
 	/*
 	 *  Get ready for the value.
 	 */
-        HTChunkClear(&me->textarea);
+	HTChunkClear(&me->textarea);
 	if (present && present[HTML_TEXTAREA_NAME] &&
 	    value[HTML_TEXTAREA_NAME]) {
 	    StrAllocCopy(me->textarea_name, value[HTML_TEXTAREA_NAME]);
@@ -4830,7 +4753,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    StrAllocCopy(id_string, value[HTML_TEXTAREA_ID]);
 	    TRANSLATE_AND_UNESCAPE_TO_STD(&id_string);
 	    if ((id_string != '\0') &&
-	        (ID_A = HTAnchor_findChildAndLink(
+		(ID_A = HTAnchor_findChildAndLink(
 				me->node_anchor,	/* Parent */
 				id_string,		/* Tag */
 				NULL,			/* Addresss */
@@ -4839,7 +4762,7 @@ PRIVATE void HTML_start_element ARGS6(
 		HText_endAnchor(me->text, 0);
 		StrAllocCopy(me->textarea_id, id_string);
 	    } else {
-	        FREE(me->textarea_id);
+		FREE(me->textarea_id);
 	    }
 	    FREE(id_string);
 	} else {
@@ -4848,7 +4771,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_SELECT:
-        /*
+	/*
 	 *  Check for an already open SELECT block. - FM
 	 */
 	if (me->inSELECT) {
@@ -4865,11 +4788,12 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 	    HTML_end_element(me, HTML_SELECT, (char **)&include);
 	}
+
 	/*
 	 * Start a new SELECT block. - FM
 	 */
-        LYHandleSELECT(me,
-	    	       present, (CONST char **)value,
+	LYHandleSELECT(me,
+		       present, (CONST char **)value,
 		       (char **)&include,
 		       TRUE);
 	break;
@@ -4877,15 +4801,15 @@ PRIVATE void HTML_start_element ARGS6(
     case HTML_OPTION:
 	{
 	    /*
-	     *  An option is a special case of an input field.
+	     *	An option is a special case of an input field.
 	     */
 	    InputFieldData I;
 
 	    /*
-	     *  Make sure we're in a select tag.
+	     *	Make sure we're in a select tag.
 	     */
 	    if (!me->inSELECT) {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr,
 			    "Bad HTML: OPTION tag not within SELECT tag\n");
 		} else if (!me->inBadHTML) {
@@ -4894,53 +4818,53 @@ PRIVATE void HTML_start_element ARGS6(
 		    sleep(MessageSecs);
 		}
 
-	        /*
+		/*
 		 *  Too likely to cause a crash, so we'll ignore it. - FM
 		 */
 		break;
 	    }
 
 	    if (!me->first_option) {
-	        /*
+		/*
 		 *  Finish the data off.
 		 */
-       	        HTChunkTerminate(&me->option);
+		HTChunkTerminate(&me->option);
 
 		/*
 		 *  Finish the previous option @@@@@
 		 */
-	        HText_setLastOptionValue(me->text,
+		HText_setLastOptionValue(me->text,
 					 me->option.data,
 					 me->LastOptionValue,
-				         MIDDLE_ORDER,
+					 MIDDLE_ORDER,
 					 me->LastOptionChecked,
 					 me->UCLYhndl,
 					 ATTR_CS_IN);
 	    }
 
 	    /*
-	     *  If its not a multiple option list and select popups
-	     *  are enabled, then don't use the checkbox/button method,
-	     *  and don't put anything on the screen yet.
+	     *	If its not a multiple option list and select popups
+	     *	are enabled, then don't use the checkbox/button method,
+	     *	and don't put anything on the screen yet.
 	     */
 	    if (me->first_option ||
-	        HTCurSelectGroupType == F_CHECKBOX_TYPE ||
+		HTCurSelectGroupType == F_CHECKBOX_TYPE ||
 		LYSelectPopups == FALSE) {
 		if (HTCurSelectGroupType == F_CHECKBOX_TYPE ||
 		    LYSelectPopups == FALSE) {
-	            /*
-		     *  Start a newline before each option.
+		    /*
+		     *	Start a newline before each option.
 		     */
 		    LYEnsureSingleSpace(me);
 		} else {
 		    /*
-		     *  Add option list designation character.
+		     *	Add option list designation character.
 		     */
-                    HText_appendCharacter(me->text, '[');
+		    HText_appendCharacter(me->text, '[');
 		    me->in_word = YES;
 		}
 
-                /*
+		/*
 		 *  Inititialize.
 		 */
 		I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
@@ -4952,17 +4876,17 @@ PRIVATE void HTML_start_element ARGS6(
 		I.name_cs = -1;
 		I.value_cs = current_char_set;
 
-	        I.type = "OPTION";
+		I.type = "OPTION";
 
-	        if ((present && present[HTML_OPTION_SELECTED]) ||
+		if ((present && present[HTML_OPTION_SELECTED]) ||
 		    (me->first_option && LYSelectPopups == FALSE &&
 		     HTCurSelectGroupType == F_RADIO_TYPE))
 		    I.checked=YES;
 
 		if (present && present[HTML_OPTION_VALUE] &&
 		    value[HTML_OPTION_VALUE]) {
-	            /*
-		     *  Convert any HTML entities or decimal escaping. - FM
+		    /*
+		     *	Convert any HTML entities or decimal escaping. - FM
 		     */
 		    StrAllocCopy(I_value, value[HTML_OPTION_VALUE]);
 		    me->HiddenValue = TRUE;
@@ -4977,58 +4901,58 @@ PRIVATE void HTML_start_element ARGS6(
 		    I.value = I_value;
 		}
 
-	        if (me->select_disabled ||
+		if (me->select_disabled ||
 		   (present && present[HTML_OPTION_DISABLED]))
 		    I.disabled=YES;
 
-	        if (present && present[HTML_OPTION_ID]
+		if (present && present[HTML_OPTION_ID]
 		    && value[HTML_OPTION_ID] && *value[HTML_OPTION_ID]) {
 		    if ((ID_A = HTAnchor_findChildAndLink(
 				    me->node_anchor,	   /* Parent */
 				    value[HTML_OPTION_ID], /* Tag */
 				    NULL,		   /* Addresss */
-				    (HTLinkType*)0)) != NULL) {	   /* Type */
+				    (HTLinkType*)0)) != NULL) {    /* Type */
 			HText_beginAnchor(me->text, me->inUnderline, ID_A);
 			HText_endAnchor(me->text, 0);
-		        I.id = value[HTML_OPTION_ID];
+			I.id = value[HTML_OPTION_ID];
 		    }
 		}
 
-	        HText_beginInput(me->text, me->inUnderline, &I);
+		HText_beginInput(me->text, me->inUnderline, &I);
 
 		if (HTCurSelectGroupType == F_CHECKBOX_TYPE) {
-	            /*
-		     *  Put a "[_]" placeholder, and one space
-		     *  (collapsible) before the label that is
-		     *  expected to follow. - FM
+		    /*
+		     *	Put a "[_]" placeholder, and one space
+		     *	(collapsible) before the label that is
+		     *	expected to follow. - FM
 		     */
-	    	    HText_appendCharacter(me->text, '[');
-	    	    HText_appendCharacter(me->text, '_');
-	    	    HText_appendCharacter(me->text, ']');
-	            HText_appendCharacter(me->text, ' ');
+		    HText_appendCharacter(me->text, '[');
+		    HText_appendCharacter(me->text, '_');
+		    HText_appendCharacter(me->text, ']');
+		    HText_appendCharacter(me->text, ' ');
 		    HText_setLastChar(me->text, ' ');  /* absorb white space */
 		    me->in_word = NO;
 		} else if (LYSelectPopups == FALSE) {
-	            /*
-		     *  Put a "(_)" placeholder, and one space
-		     *  (collapsible) before the label that is
-		     *  expected to follow. - FM
+		    /*
+		     *	Put a "(_)" placeholder, and one space
+		     *	(collapsible) before the label that is
+		     *	expected to follow. - FM
 		     */
-	    	    HText_appendCharacter(me->text, '(');
-	    	    HText_appendCharacter(me->text, '_');
-	    	    HText_appendCharacter(me->text, ')');
-	            HText_appendCharacter(me->text, ' ');
+		    HText_appendCharacter(me->text, '(');
+		    HText_appendCharacter(me->text, '_');
+		    HText_appendCharacter(me->text, ')');
+		    HText_appendCharacter(me->text, ' ');
 		    HText_setLastChar(me->text, ' ');  /* absorb white space */
 		    me->in_word = NO;
 		}
 	    }
 
 	    /*
-	     *  Get ready for the next value.
+	     *	Get ready for the next value.
 	     */
-            HTChunkClear(&me->option);
+	    HTChunkClear(&me->option);
 	    if ((present && present[HTML_OPTION_SELECTED]) ||
-	        (me->first_option && LYSelectPopups == FALSE &&
+		(me->first_option && LYSelectPopups == FALSE &&
 		 HTCurSelectGroupType == F_RADIO_TYPE))
 		me->LastOptionChecked = TRUE;
 	    else
@@ -5037,10 +4961,10 @@ PRIVATE void HTML_start_element ARGS6(
 
 
 	    if (present && present[HTML_OPTION_VALUE] &&
-	        value[HTML_OPTION_VALUE]) {
+		value[HTML_OPTION_VALUE]) {
 		if (!I_value) {
-	            /*
-		     *  Convert any HTML entities or decimal escaping. - FM
+		    /*
+		     *	Convert any HTML entities or decimal escaping. - FM
 		     */
 		    StrAllocCopy(I_value, value[HTML_OPTION_VALUE]);
 		    me->HiddenValue = TRUE;
@@ -5051,17 +4975,17 @@ PRIVATE void HTML_start_element ARGS6(
 						       me->UsePlainSpace, me->HiddenValue);
 		    me->HiddenValue = FALSE;
 		}
-	        StrAllocCopy(me->LastOptionValue, I_value);
+		StrAllocCopy(me->LastOptionValue, I_value);
 	    } else {
-	        StrAllocCopy(me->LastOptionValue, me->option.data);
+		StrAllocCopy(me->LastOptionValue, me->option.data);
 	    }
 
 	    /*
-	     *  If this is a popup option, print its option
-	     *  for use in selecting option by number. - LE
+	     *	If this is a popup option, print its option
+	     *	for use in selecting option by number. - LE
 	     */
 	    if (HTCurSelectGroupType == F_RADIO_TYPE &&
-	        LYSelectPopups &&
+		LYSelectPopups &&
 		keypad_mode == LINKS_AND_FORM_FIELDS_ARE_NUMBERED) {
 		char marker[8];
 		int opnum = HText_getOptionNum(me->text);
@@ -5102,24 +5026,24 @@ PRIVATE void HTML_start_element ARGS6(
 	if (me->Division_Level < (MAX_NESTING - 1)) {
 	    me->Division_Level++;
 	} else if (TRACE) {
-            fprintf(stderr,
+	    fprintf(stderr,
 	    "HTML: ****** Maximum nesting of %d divisions/tables exceeded!\n",
-            	    MAX_NESTING);
+		    MAX_NESTING);
 	}
 	if (present && present[HTML_TABLE_ALIGN] &&
 	    value[HTML_TABLE_ALIGN] && *value[HTML_TABLE_ALIGN]) {
 	    if (!strcasecomp(value[HTML_TABLE_ALIGN], "center")) {
-	        me->DivisionAlignments[me->Division_Level] = HT_CENTER;
+		me->DivisionAlignments[me->Division_Level] = HT_CENTER;
 		change_paragraph_style(me, styles[HTML_DCENTER]);
 		UPDATE_STYLE;
 		me->current_default_alignment = styles[HTML_DCENTER]->alignment;
 	    } else if (!strcasecomp(value[HTML_TABLE_ALIGN], "right")) {
-	        me->DivisionAlignments[me->Division_Level] = HT_RIGHT;
+		me->DivisionAlignments[me->Division_Level] = HT_RIGHT;
 		change_paragraph_style(me, styles[HTML_DRIGHT]);
 		UPDATE_STYLE;
 		me->current_default_alignment = styles[HTML_DRIGHT]->alignment;
 	    } else {
-	        me->DivisionAlignments[me->Division_Level] = HT_LEFT;
+		me->DivisionAlignments[me->Division_Level] = HT_LEFT;
 		change_paragraph_style(me, styles[HTML_DLEFT]);
 		UPDATE_STYLE;
 		me->current_default_alignment = styles[HTML_DLEFT]->alignment;
@@ -5134,7 +5058,7 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_TR:
-        /*
+	/*
 	 *  Not yet implemented.  Just start a new row,
 	 *  if needed, act on an ALIGN attribute if present,
 	 *  and check for an ID link. - FM
@@ -5147,7 +5071,7 @@ PRIVATE void HTML_start_element ARGS6(
 	    SET_SKIP_STACK(HTML_U);
 	    HTML_end_element(me, HTML_U, (char **)&include);
 	}
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	if (HText_LastLineSize(me->text, FALSE)) {
 	    HText_setLastChar(me->text, ' ');  /* absorb white space */
 	    HText_appendCharacter(me->text, '\r');
@@ -5165,30 +5089,30 @@ PRIVATE void HTML_start_element ARGS6(
 		   ((me->Division_Level < 0) &&
 		    (!strcmp(me->sp->style->name, "Normal") ||
 		     !strcmp(me->sp->style->name, "Preformatted")))) {
-	        me->sp->style->alignment = HT_LEFT;
+		me->sp->style->alignment = HT_LEFT;
 	} else {
 	    me->sp->style->alignment = me->current_default_alignment;
 	}
 	if (present && present[HTML_TR_ALIGN] && value[HTML_TR_ALIGN]) {
 	    if (!strcasecomp(value[HTML_TR_ALIGN], "center") &&
-	        !(me->List_Nesting_Level >= 0 && !me->inP))
-	        me->sp->style->alignment = HT_CENTER;
+		!(me->List_Nesting_Level >= 0 && !me->inP))
+		me->sp->style->alignment = HT_CENTER;
 	    else if (!strcasecomp(value[HTML_TR_ALIGN], "right") &&
-	        !(me->List_Nesting_Level >= 0 && !me->inP))
-	        me->sp->style->alignment = HT_RIGHT;
+		!(me->List_Nesting_Level >= 0 && !me->inP))
+		me->sp->style->alignment = HT_RIGHT;
 	    else if (!strcasecomp(value[HTML_TR_ALIGN], "left") ||
-	    	     !strcasecomp(value[HTML_TR_ALIGN], "justify"))
-	        me->sp->style->alignment = HT_LEFT;
+		     !strcasecomp(value[HTML_TR_ALIGN], "justify"))
+		me->sp->style->alignment = HT_LEFT;
 	}
 
 	CHECK_ID(HTML_TR_ID);
 	me->inP = FALSE;
-        break;
+	break;
 
     case HTML_THEAD:
     case HTML_TFOOT:
     case HTML_TBODY:
-        /*
+	/*
 	 *  Not yet implemented.  Just check for an ID link. - FM
 	 */
 	if (me->inA) {
@@ -5199,13 +5123,13 @@ PRIVATE void HTML_start_element ARGS6(
 	    SET_SKIP_STACK(HTML_U);
 	    HTML_end_element(me, HTML_U, (char **)&include);
 	}
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_TR_ID);
-        break;
+	break;
 
     case HTML_COL:
     case HTML_COLGROUP:
-        /*
+	/*
 	 *  Not yet implemented.  Just check for an ID link. - FM
 	 */
 	if (me->inA) {
@@ -5216,9 +5140,9 @@ PRIVATE void HTML_start_element ARGS6(
 	    SET_SKIP_STACK(HTML_U);
 	    HTML_end_element(me, HTML_U, (char **)&include);
 	}
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_COL_ID);
-        break;
+	break;
 
     case HTML_TH:
 	if (me->inA) {
@@ -5229,14 +5153,14 @@ PRIVATE void HTML_start_element ARGS6(
 	    SET_SKIP_STACK(HTML_U);
 	    HTML_end_element(me, HTML_U, (char **)&include);
 	}
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_TD_ID);
-        /*
+	/*
 	 *  Not yet implemented.  Just add a collapsible space and break. - FM
 	 */
 	HTML_put_character(me, ' ');
 	me->in_word = NO;
-        break;
+	break;
 
     case HTML_TD:
 	if (me->inA) {
@@ -5247,17 +5171,17 @@ PRIVATE void HTML_start_element ARGS6(
 	    SET_SKIP_STACK(HTML_U);
 	    HTML_end_element(me, HTML_U, (char **)&include);
 	}
-        UPDATE_STYLE;
+	UPDATE_STYLE;
 	CHECK_ID(HTML_TD_ID);
-        /*
+	/*
 	 *  Not yet implemented.  Just add a collapsible space and break. - FM
 	 */
 	HTML_put_character(me, ' ');
 	me->in_word = NO;
-        break;
+	break;
 
     case HTML_MATH:
-        /*
+	/*
 	 *  We're getting it as Literal text, which, until we can process
 	 *  it, we'll display as is, within brackets to alert the user. - FM
 	 */
@@ -5291,10 +5215,10 @@ PRIVATE void HTML_start_element ARGS6(
 		}
 		me->stack_overrun = TRUE;
 	    }
-            return;
-        }
+	    return;
+	}
 
-    	(me->sp)--;
+	(me->sp)--;
 	me->sp[0].style = me->new_style;	/* Stack new style */
 	me->sp[0].tag_number = ElementNumber;
 
@@ -5305,56 +5229,54 @@ PRIVATE void HTML_start_element ARGS6(
 
 #if defined(USE_COLOR_STYLE)
 /* end empty tags straight away */
-        if (HTML_dtd.tags[ElementNumber].contents == SGML_EMPTY)
-        {
-                if (TRACE)
-                        fprintf(stderr, "STYLE:begin_element:ending EMPTY element style\n");
+	if (HTML_dtd.tags[ElementNumber].contents == SGML_EMPTY)
+	{
+		if (TRACE)
+			fprintf(stderr, "STYLE:begin_element:ending EMPTY element style\n");
 #if !defined(USE_HASH)
-        HText_characterStyle(me->text, element_number+STARTAT, STACK_OFF);
+	HText_characterStyle(me->text, element_number+STARTAT, STACK_OFF);
 #else
-        HText_characterStyle(me->text, hcode, STACK_OFF);
+	HText_characterStyle(me->text, hcode, STACK_OFF);
 #endif /* USE_HASH */
-                {
-                        char *end, *start=NULL, *lookfrom;
-                        char tmp[64];
-                        sprintf(tmp, ";%s", HTML_dtd.tags[element_number].name);
-                        strtolower(tmp);
-
-                        lookfrom = Style_className;
-                        do
-                        {
-                                end = start;
-                                start = strstr(lookfrom, tmp);
+		{
+			char *end, *start=NULL, *lookfrom;
+			char tmp[64];
+			sprintf(tmp, ";%s", HTML_dtd.tags[element_number].name);
+			strtolower(tmp);
+
+			lookfrom = Style_className;
+			do
+			{
+				end = start;
+				start = strstr(lookfrom, tmp);
 				if (start)
 				    lookfrom = start + 1;
-                        }
-                        while (start);
-                        if (end)
-                                *end='\0';
+			}
+			while (start);
+			if (end)
+				*end='\0';
 
 #if defined(PREVAIL)
-                        start=strrchr(Style_className, '.');
-                        if (start)
-                                strcpy(prevailing_class, (char*)(start+1));
-                        else
-                                strcpy(prevailing_class, "");
+			start=strrchr(Style_className, '.');
+			if (start)
+				strcpy(prevailing_class, (char*)(start+1));
+			else
+				strcpy(prevailing_class, "");
 #endif
 
 
-                        if (TRACE)
-                        fprintf(stderr, "CSS:%s (trimmed %s, SGML_EMPTY)\n", Style_className, tmp);
+			if (TRACE)
+			fprintf(stderr, "CSS:%s (trimmed %s, SGML_EMPTY)\n", Style_className, tmp);
 		}
 	}
 #endif /* USE_COLOR_STYLE */
 }
 
-#undef CHECK_ID  /* LYCheckForID() */
-
 /*		End Element
 **		-----------
 **
 **	When we end an element, the style must be returned to that
-**	in effect before that element.  Note that anchors (etc?)
+**	in effect before that element.	Note that anchors (etc?)
 **	don't have an associated style, so that we must scan down the
 **	stack for an element with a defined style. (In fact, the styles
 **	should be linked to the whole stack not just the top one.)
@@ -5365,7 +5287,7 @@ PRIVATE void HTML_start_element ARGS6(
 **	incoming code errors, not this module.
 */
 PRIVATE void HTML_end_element ARGS3(
-	HTStructured *,		me,
+	HTStructured *, 	me,
 	int,			element_number,
 	char **,		include)
 {
@@ -5375,8 +5297,8 @@ PRIVATE void HTML_end_element ARGS3(
 
 #ifdef CAREFUL			/* parser assumed to produce good nesting */
     if (element_number != me->sp[0].tag_number &&
-        HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
-        fprintf(stderr,
+	HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
+	fprintf(stderr,
 		"HTMLText: end of element %s when expecting end of %s\n",
 		HTML_dtd.tags[element_number].name,
 		HTML_dtd.tags[me->sp->tag_number].name);
@@ -5385,37 +5307,37 @@ PRIVATE void HTML_end_element ARGS3(
 #endif /* CAREFUL */
 
     /*
-     *  If we're seeking MAPs, skip everything that's
-     *  not a MAP or AREA tag. - FM
+     *	If we're seeking MAPs, skip everything that's
+     *	not a MAP or AREA tag. - FM
      */
     if (LYMapsOnly) {
-        if (!(element_number == HTML_MAP || element_number == HTML_AREA)) {
+	if (!(element_number == HTML_MAP || element_number == HTML_AREA)) {
 	    return;
 	}
     }
 
     /*
-     *  Pop state off stack if we didn't declare the element
-     *  SGML_EMPTY in HTMLDTD.c. - FM & KW
+     *	Pop state off stack if we didn't declare the element
+     *	SGML_EMPTY in HTMLDTD.c. - FM & KW
      */
     if (HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
 	if ((element_number != me->sp[0].tag_number) &&
 	    me->skip_stack <= 0 &&
-            HTML_dtd.tags[HTML_LH].contents != SGML_EMPTY &&
+	    HTML_dtd.tags[HTML_LH].contents != SGML_EMPTY &&
 	    (me->sp[0].tag_number == HTML_UL ||
 	     me->sp[0].tag_number == HTML_OL ||
 	     me->sp[0].tag_number == HTML_MENU ||
 	     me->sp[0].tag_number == HTML_DIR) &&
-            (element_number == HTML_H1 ||
+	    (element_number == HTML_H1 ||
 	     element_number == HTML_H2 ||
 	     element_number == HTML_H3 ||
 	     element_number == HTML_H4 ||
 	     element_number == HTML_H6 ||
 	     element_number == HTML_H6)) {
 	    /*
-	     *  Set the break flag if we're popping
-	     *  a dummy HTML_LH substituted for an
-	     *  HTML_H# encountered in a list.
+	     *	Set the break flag if we're popping
+	     *	a dummy HTML_LH substituted for an
+	     *	HTML_H# encountered in a list.
 	     */
 	    BreakFlag = TRUE;
 	}
@@ -5428,28 +5350,28 @@ PRIVATE void HTML_end_element ARGS3(
 	} else if (me->stack_overrun == TRUE &&
 	    element_number != me->sp[0].tag_number) {
 	    /*
-	     *  Ignore non-corresponding tags if we had
-	     *  a stack overrun.  This is not a completely
-	     *  fail-safe strategy for protection against
-	     *  any seriously adverse consequences of a
-	     *  stack overrun, and the rendering of the
-	     *  document will not be as intended, but we
-	     *  expect overruns to be rare, and this should
-	     *  offer reasonable protection against crashes
-	     *  if an overrun does occur. - FM
+	     *	Ignore non-corresponding tags if we had
+	     *	a stack overrun.  This is not a completely
+	     *	fail-safe strategy for protection against
+	     *	any seriously adverse consequences of a
+	     *	stack overrun, and the rendering of the
+	     *	document will not be as intended, but we
+	     *	expect overruns to be rare, and this should
+	     *	offer reasonable protection against crashes
+	     *	if an overrun does occur. - FM
 	     */
 	    return;
 	} else if (element_number == HTML_SELECT &&
 	    me->sp[0].tag_number != HTML_SELECT) {
 	    /*
-	     *  Ignore non-corresponding SELECT tags, since we
-	     *  probably popped it and closed the SELECT block
-	     *  to deal with markup which amounts to a nested
-	     *  SELECT, or an out of order FORM end tag. - FM
+	     *	Ignore non-corresponding SELECT tags, since we
+	     *	probably popped it and closed the SELECT block
+	     *	to deal with markup which amounts to a nested
+	     *	SELECT, or an out of order FORM end tag. - FM
 	     */
 	    return;
 	} else if ((element_number != me->sp[0].tag_number) &&
-            HTML_dtd.tags[HTML_LH].contents == SGML_EMPTY &&
+	    HTML_dtd.tags[HTML_LH].contents == SGML_EMPTY &&
 	    (me->sp[0].tag_number == HTML_UL ||
 	     me->sp[0].tag_number == HTML_OL ||
 	     me->sp[0].tag_number == HTML_MENU ||
@@ -5461,9 +5383,9 @@ PRIVATE void HTML_end_element ARGS3(
 	     element_number == HTML_H6 ||
 	     element_number == HTML_H6)) {
 	    /*
-	     *  It's an H# for which we substituted
-	     *  an HTML_LH, which we've declared as
-	     *  SGML_EMPTY, so just return. - FM
+	     *	It's an H# for which we substituted
+	     *	an HTML_LH, which we've declared as
+	     *	SGML_EMPTY, so just return. - FM
 	     */
 	    return;
 	} else if (me->sp < (me->stack + MAX_NESTING - 1)) {
@@ -5479,14 +5401,14 @@ PRIVATE void HTML_end_element ARGS3(
 	}
     }
     if (BreakFlag == TRUE)
-        return;
+	return;
 
     /*
-     *  Check for unclosed TEXTAREA. - FM
+     *	Check for unclosed TEXTAREA. - FM
      */
     if (me->inTEXTAREA && element_number != HTML_TEXTAREA) {
-        if (TRACE) {
-	    fprintf(stderr, "Bad HTML: Missing TEXTAREA end tag *****\n");
+	if (TRACE) {
+	    fprintf(stderr, "Bad HTML: Missing TEXTAREA end tag\n");
 	} else if (!me->inBadHTML) {
 	    _statusline(BAD_HTML_USE_TRACE);
 	    me->inBadHTML = TRUE;
@@ -5499,14 +5421,14 @@ PRIVATE void HTML_end_element ARGS3(
     }
 
     /*
-     *  Handle the end tag. - FM
+     *	Handle the end tag. - FM
      */
     switch(element_number) {
 
     case HTML_HTML:
 	if (me->inA || me->inSELECT || me->inTEXTAREA)
 	    if (TRACE) {
-	        fprintf(stderr,
+		fprintf(stderr,
 			"Bad HTML: %s%s%s%s%s not closed before HTML end tag *****\n",
 			me->inSELECT ? "SELECT" : "",
 			(me->inSELECT && me->inTEXTAREA) ? ", " : "",
@@ -5514,7 +5436,7 @@ PRIVATE void HTML_end_element ARGS3(
 			((me->inSELECT || me->inTEXTAREA) && me->inA) ? ", " : "",
 			me->inA ? "A" : "");
 	    } else if (!me->inBadHTML) {
-	        _statusline(BAD_HTML_USE_TRACE);
+		_statusline(BAD_HTML_USE_TRACE);
 		me->inBadHTML = TRUE;
 		sleep(MessageSecs);
 	    }
@@ -5523,12 +5445,12 @@ PRIVATE void HTML_end_element ARGS3(
     case HTML_HEAD:
 	if (me->inBASE &&
 	    !strcmp(me->node_anchor->address, LYlist_temp_url())) {
-	    /*  If we are parsing the List Page, and have a BASE after
-	     *  we are done with the HEAD element, propagate it back
-	     *  to the node_anchor object.  The base should have been
-	     *  inserted by showlist() to record what document the List
-	     *  Page is about, and other functions may later look for it
-	     *  in the anchor. - kw
+	    /*	If we are parsing the List Page, and have a BASE after
+	     *	we are done with the HEAD element, propagate it back
+	     *	to the node_anchor object.  The base should have been
+	     *	inserted by showlist() to record what document the List
+	     *	Page is about, and other functions may later look for it
+	     *	in the anchor. - kw
 	     */
 	    StrAllocCopy(me->node_anchor->content_base, me->base_href);
 	}
@@ -5537,9 +5459,9 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     case HTML_TITLE:
-        HTChunkTerminate(&me->title);
-    	HTAnchor_setTitle(me->node_anchor, me->title.data);
-        HTChunkClear(&me->title);
+	HTChunkTerminate(&me->title);
+	HTAnchor_setTitle(me->node_anchor, me->title.data);
+	HTChunkClear(&me->title);
 	/*
 	 *  Check if it's a bookmark file, and if so, and multiple
 	 *  bookmark support is on, or it's off but this isn't the
@@ -5584,27 +5506,27 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     case HTML_STYLE:
-    	/*
+	/*
 	 *  We're getting it as Litteral text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
 	HTChunkTerminate(&me->style_block);
 	if (TRACE) {
 	    fprintf(stderr, "HTML: STYLE content =\n%s\n",
-	    		    me->style_block.data);
+			    me->style_block.data);
 	}
 	HTChunkClear(&me->style_block);
 	break;
 
     case HTML_SCRIPT:
-    	/*
+	/*
 	 *  We're getting it as Litteral text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
 	HTChunkTerminate(&me->script);
 	if (TRACE) {
 	    fprintf(stderr, "HTML: SCRIPT content =\n%s\n",
-	    		    me->script.data);
+			    me->script.data);
 	}
 	HTChunkClear(&me->script);
 	break;
@@ -5612,7 +5534,7 @@ PRIVATE void HTML_end_element ARGS3(
     case HTML_BODY:
 	if (me->inA || me->inSELECT || me->inTEXTAREA)
 	    if (TRACE) {
-	        fprintf(stderr,
+		fprintf(stderr,
 			"Bad HTML: %s%s%s%s%s not closed before BODY end tag *****\n",
 			me->inSELECT ? "SELECT" : "",
 			(me->inSELECT && me->inTEXTAREA) ? ", " : "",
@@ -5620,7 +5542,7 @@ PRIVATE void HTML_end_element ARGS3(
 			((me->inSELECT || me->inTEXTAREA) && me->inA) ? ", " : "",
 			me->inA ? "A" : "");
 	    } else if (!me->inBadHTML) {
-	        _statusline(BAD_HTML_USE_TRACE);
+		_statusline(BAD_HTML_USE_TRACE);
 		me->inBadHTML = TRUE;
 		sleep(MessageSecs);
 	    }
@@ -5661,7 +5583,7 @@ PRIVATE void HTML_end_element ARGS3(
 	    me->Division_Level--;
 	if (me->Division_Level >= 0)
 	    me->sp->style->alignment =
-	    			me->DivisionAlignments[me->Division_Level];
+				me->DivisionAlignments[me->Division_Level];
 	change_paragraph_style(me, me->sp->style);
 	UPDATE_STYLE;
 	me->current_default_alignment = me->sp->style->alignment;
@@ -5669,7 +5591,7 @@ PRIVATE void HTML_end_element ARGS3(
 	    HText_NegateLineOne(me->text);
 	break;
 
-    case HTML_H1:                       /* header styles */
+    case HTML_H1:			/* header styles */
     case HTML_H2:
     case HTML_H3:
     case HTML_H4:
@@ -5677,7 +5599,7 @@ PRIVATE void HTML_end_element ARGS3(
     case HTML_H6:
 	if (me->Division_Level >= 0) {
 	    me->sp->style->alignment =
-	    			me->DivisionAlignments[me->Division_Level];
+				me->DivisionAlignments[me->Division_Level];
 	} else if (!strcmp(me->sp->style->name, "HeadingCenter") ||
 		   !strcmp(me->sp->style->name, "Heading1")) {
 	    me->sp->style->alignment = HT_CENTER;
@@ -5690,7 +5612,7 @@ PRIVATE void HTML_end_element ARGS3(
 	UPDATE_STYLE;
 	if (styles[element_number]->font & HT_BOLD) {
 	    if (me->inBoldA == FALSE && me->inBoldH == TRUE) {
-	        HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
+		HText_appendCharacter(me->text, LY_BOLD_END_CHAR);
 	    }
 	    me->inBoldH = FALSE;
 	}
@@ -5705,39 +5627,39 @@ PRIVATE void HTML_end_element ARGS3(
     case HTML_P:
 	UPDATE_STYLE;
 	    /*
-	     *  In general, treat </P> as an instruction to
-	     *  end the current line if it has been started,
-	     *  and ensure spacing as required by the current
-	     *  paragraph style's spaceAfter.  Don't insert
-	     *  spacing required for starting the next paragraph
-	     *  as required by its style->spaceBefore, since we
-	     *  don't know yet what the next structure element
-	     *  (if any) will be.  If it is another P, it will
-	     *  take care of its leading space on its own.  - kw
+	     *	In general, treat </P> as an instruction to
+	     *	end the current line if it has been started,
+	     *	and ensure spacing as required by the current
+	     *	paragraph style's spaceAfter.  Don't insert
+	     *	spacing required for starting the next paragraph
+	     *	as required by its style->spaceBefore, since we
+	     *	don't know yet what the next structure element
+	     *	(if any) will be.  If it is another P, it will
+	     *	take care of its leading space on its own.  - kw
 	     */
 	if (me->List_Nesting_Level >= 0) {
 	    /*
-	     *  We're in a list.  Treat </P> as an instruction to
-	     *  end the current line if it has been started,
-	     *  and set "second line" margins.
+	     *	We're in a list.  Treat </P> as an instruction to
+	     *	end the current line if it has been started,
+	     *	and set "second line" margins.
 	     */
 	    if (me->inP) {
-	        if (me->inFIG || me->inAPPLET ||
+		if (me->inFIG || me->inAPPLET ||
 		    me->inCAPTION || me->inCREDIT ||
 		    me->sp->style->spaceAfter > 0) {
-	            LYEnsureDoubleSpace(me);
+		    LYEnsureDoubleSpace(me);
 		} else {
-	            LYEnsureSingleSpace(me);
+		    LYEnsureSingleSpace(me);
 		}
 	    }
 	} else if (me->sp[0].tag_number == HTML_ADDRESS) {
 	    /*
-	     *  We're in an ADDRESS. Treat </P> as an instruction
-	     *  to start a newline, if needed. - kw
+	     *	We're in an ADDRESS. Treat </P> as an instruction
+	     *	to start a newline, if needed. - kw
 	     */
 	    if (HText_LastLineSize(me->text, FALSE)) {
 		HText_setLastChar(me->text, ' ');  /* absorb white space */
-	        HText_appendCharacter(me->text, '\r');
+		HText_appendCharacter(me->text, '\r');
 	    }
 	} else {
 	    if (me->sp->style->spaceAfter > 0) {
@@ -5760,7 +5682,7 @@ PRIVATE void HTML_end_element ARGS3(
 		   ((me->Division_Level < 0) &&
 		    (!strcmp(me->sp->style->name, "Normal") ||
 		     !strcmp(me->sp->style->name, "Preformatted")))) {
-	        me->sp->style->alignment = HT_LEFT;
+		me->sp->style->alignment = HT_LEFT;
 	} else {
 	    me->sp->style->alignment = me->current_default_alignment;
 	}
@@ -5772,7 +5694,7 @@ PRIVATE void HTML_end_element ARGS3(
 	 */
 	me->inP = FALSE;
 
-        break;
+	break;
 
     case HTML_FONT:
 	me->inFONT = FALSE;
@@ -5786,7 +5708,7 @@ PRIVATE void HTML_end_element ARGS3(
     case HTML_CITE:			/* Logical character highlighting */
     case HTML_EM:
     case HTML_STRONG:
-        /*
+	/*
 	 *  Ignore any emphasis end tags if the
 	 *  Underline_Level is not set. - FM
 	 */
@@ -5802,12 +5724,12 @@ PRIVATE void HTML_end_element ARGS3(
 	    HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
 	    me->inUnderline = FALSE;
 	    if (TRACE)
-	        fprintf(stderr,"Ending underline\n");
+		fprintf(stderr,"Ending underline\n");
 	} else {
 	    if (TRACE)
-	        fprintf(stderr,"Underline Level is %d\n", me->Underline_Level);
+		fprintf(stderr,"Underline Level is %d\n", me->Underline_Level);
 	}
-    	break;
+	break;
 
     case HTML_ABBREV:	/* Miscellaneous character containers */
     case HTML_ACRONYM:
@@ -5850,9 +5772,9 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     case HTML_Q:
-        if (me->Quote_Level > 0)
+	if (me->Quote_Level > 0)
 	    me->Quote_Level--;
-        /*
+	/*
 	 *  Should check LANG and/or DIR attributes, and the
 	 *  me->node_anchor->charset and/or yet to be added
 	 *  structure elements, to determine whether we should
@@ -5863,7 +5785,7 @@ PRIVATE void HTML_end_element ARGS3(
 	    HTML_put_character(me, '"');
 	else
 	    HTML_put_character(me, '\'');
-        break;
+	break;
 
     case HTML_PRE:				/* Formatted text */
 	/*
@@ -5873,8 +5795,8 @@ PRIVATE void HTML_end_element ARGS3(
     case HTML_LISTING:				/* Litteral text */
     case HTML_XMP:
     case HTML_PLAINTEXT:
-    	if (me->comment_start)
-    	    HText_appendText(me->text, me->comment_start);
+	if (me->comment_start)
+	    HText_appendText(me->text, me->comment_start);
 	change_paragraph_style(me, me->sp->style);  /* Often won't really change */
 	if (me->List_Nesting_Level >= 0) {
 	    UPDATE_STYLE;
@@ -5894,7 +5816,7 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     case HTML_OL:
-        me->OL_Counter[me->List_Nesting_Level < 11 ?
+	me->OL_Counter[me->List_Nesting_Level < 11 ?
 			    me->List_Nesting_Level : 11] = OL_VOID;
     case HTML_DL:
     case HTML_UL:
@@ -5910,29 +5832,29 @@ PRIVATE void HTML_end_element ARGS3(
 	UPDATE_STYLE;
 	if (me->List_Nesting_Level >= 0)
 	    LYEnsureSingleSpace(me);
-        break;
+	break;
 
     case HTML_SPAN:
-        /*
+	/*
 	 *  Should undo anything we did based on LANG and/or DIR
 	 *  attributes, and the me->node_anchor->charset and/or
 	 *  yet to be added structure elements. - FM
 	 */
-        break;
+	break;
 
     case HTML_BDO:
-        /*
+	/*
 	 *  Should undo anything we did based on DIR (and/or LANG)
 	 *  attributes, and the me->node_anchor->charset and/or
 	 *  yet to be added structure elements. - FM
 	 */
-        break;
+	break;
 
     case HTML_A:
-        /*
+	/*
 	 *  Ignore any spurious A end tags. - FM
 	 */
-        if (me->inA == FALSE)
+	if (me->inA == FALSE)
 	    break;
 	/*
 	 *  Set to know that we are no longer in an anchor.
@@ -5952,11 +5874,11 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     case HTML_MAP:
-        FREE(me->map_address);
-        break;
+	FREE(me->map_address);
+	break;
 
     case HTML_BODYTEXT:
-        /*
+	/*
 	 *  We may need to look at this someday to deal with
 	 *  OBJECTs optimally, but just ignore it for now. - FM
 	 */
@@ -5964,7 +5886,7 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     case HTML_TEXTFLOW:
-        /*
+	/*
 	 *  We may need to look at this someday to deal with
 	 *  APPLETs optimally, but just ignore it for now. - FM
 	 */
@@ -5979,7 +5901,7 @@ PRIVATE void HTML_end_element ARGS3(
 	}
 	LYResetParagraphAlignment(me);
 	me->inFIGwithP = FALSE;
-    	me->inFIG = FALSE;
+	me->inFIG = FALSE;
 	change_paragraph_style(me, me->sp->style);  /* Often won't really change */
 	if (me->List_Nesting_Level >= 0) {
 	    UPDATE_STYLE;
@@ -6000,7 +5922,7 @@ PRIVATE void HTML_end_element ARGS3(
 	    HTChunkTerminate(&me->object);
 	    data = me->object.data;
 	    while ((cp = strchr(data, '<')) != NULL) {
-	        /*
+		/*
 		 *  Look for nested OBJECTs.  This procedure
 		 *  could get tripped up if invalid comments
 		 *  are present in the content, or if an OBJECT
@@ -6011,19 +5933,19 @@ PRIVATE void HTML_end_element ARGS3(
 		    cp = data;
 		} else if (s == 0 && !strncasecomp(cp, "<PARAM", 6)) {
 		    have_param = TRUE;
-	        } else if (!strncasecomp(cp, "<OBJECT", 7)) {
+		} else if (!strncasecomp(cp, "<OBJECT", 7)) {
 		    if (s == 0)
-		        start = cp;
+			start = cp;
 		    s++;
 		} else if (!strncasecomp(cp, "</OBJECT", 8)) {
 		    if (e == 0)
-		        first_end = cp;
+			first_end = cp;
 		    e++;
 		}
 		data = ++cp;
 	    }
 	    if (s > e) {
-	        /*
+		/*
 		 *  We have nested OBJECT tags, and not yet all of the
 		 *  end tags, so restore an end tag to the content, and
 		 *  pass a dummy start tag to the SGML parser so that it
@@ -6035,22 +5957,22 @@ PRIVATE void HTML_end_element ARGS3(
 		    StrAllocCopy(*include, "<OBJECT>");
 		} else {
 		    if (0 && strstr(*include, me->object.data) == NULL) {
-		        StrAllocCat(*include, "<OBJECT>");
+			StrAllocCat(*include, "<OBJECT>");
 		    }
 		}
-	        me->object.size--;
+		me->object.size--;
 		HTChunkPuts(&me->object, "</OBJECT>");
 		change_paragraph_style(me, me->sp->style);
 		break;
 	    }
 	    if (s < e) {
-	        /*
+		/*
 		 *  We had more end tags than start tags, so
 		 *  we have bad HTML or otherwise misparsed. - FM
 		 */
 		if (TRACE) {
 		    fprintf(stderr,
-  "Bad HTML: Unmatched OBJECT start and end tags. ***** Discarding content:\n%s\n",
+  "Bad HTML: Unmatched OBJECT start and end tags.  Discarding content:\n%s\n",
 			    me->object.data);
 		} else if (!me->inBadHTML) {
 		    _statusline(BAD_HTML_USE_TRACE);
@@ -6061,54 +5983,54 @@ PRIVATE void HTML_end_element ARGS3(
 	    }
 
 	    /*
-	     *  OBJECT start and end tags are fully matched,
-	     *  assuming we weren't tripped up by comments
-	     *  or quoted attributes. - FM
+	     *	OBJECT start and end tags are fully matched,
+	     *	assuming we weren't tripped up by comments
+	     *	or quoted attributes. - FM
 	     */
 	    if (TRACE)
-	        fprintf(stderr, "HTML:OBJECT content:\n%s\n", me->object.data);
+		fprintf(stderr, "HTML:OBJECT content:\n%s\n", me->object.data);
 
 	    /*
-	     *  OBJECTs with DECLARE should be saved but
-	     *  not instantiated, and if nested, can have
-	     *  only other DECLAREd OBJECTs.  Until we have
-	     *  code to handle these, we'll just create an
-	     *  anchor for the ID, if present, and discard
-	     *  the content (sigh 8-). - FM
+	     *	OBJECTs with DECLARE should be saved but
+	     *	not instantiated, and if nested, can have
+	     *	only other DECLAREd OBJECTs.  Until we have
+	     *	code to handle these, we'll just create an
+	     *	anchor for the ID, if present, and discard
+	     *	the content (sigh 8-). - FM
 	     */
 	    if (me->object_declare == TRUE) {
-	        if (me->object_id && *me->object_id)
+		if (me->object_id && *me->object_id)
 		    LYHandleID(me, me->object_id);
 		if (TRACE)
 		    fprintf(stderr, "HTML: DECLAREd OBJECT.  Ignoring!\n");
-	        goto End_Object;
+		goto End_Object;
 	    }
 
 	    /*
-	     *  OBJECTs with NAME are for FORM submissions.
-	     *  We'll just create an anchor for the ID, if
-	     *  present, and discard the content until we
-	     *  have code to handle these. (sigh 8-). - FM
+	     *	OBJECTs with NAME are for FORM submissions.
+	     *	We'll just create an anchor for the ID, if
+	     *	present, and discard the content until we
+	     *	have code to handle these. (sigh 8-). - FM
 	     */
 	    if (me->object_name != NULL) {
-	        if (me->object_id && *me->object_id)
+		if (me->object_id && *me->object_id)
 		    LYHandleID(me, me->object_id);
 		if (TRACE)
 		    fprintf(stderr, "HTML: NAMEd OBJECT.  Ignoring!\n");
-	        goto End_Object;
+		goto End_Object;
 	    }
 
 	    /*
-	     *  Deal with any nested OBJECTs by descending
-	     *  to the inner-most OBJECT. - FM
+	     *	Deal with any nested OBJECTs by descending
+	     *	to the inner-most OBJECT. - FM
 	     */
 	    if (s > 0) {
 		if (start != NULL &&
 		    first_end != NULL && first_end > start) {
 		    /*
-		     *  Minumum requirements for the ad hoc parsing
-		     *  to have succeeded are met.  We'll hope that
-		     *  it did succeed. - FM
+		     *	Minumum requirements for the ad hoc parsing
+		     *	to have succeeded are met.  We'll hope that
+		     *	it did succeed. - FM
 		     */
 		    *first_end = '\0';
 		    data = NULL;
@@ -6128,10 +6050,10 @@ PRIVATE void HTML_end_element ARGS3(
 		} else {
 		    if (TRACE) {
 			fprintf(stderr,
-	"Bad HTML: Unmatched OBJECT start and end tags. ***** Discarding content.\n");
+     "Bad HTML: Unmatched OBJECT start and end tags.  Discarding content.\n");
 			goto End_Object;
 		    } else if (!me->inBadHTML) {
-		        _statusline(BAD_HTML_USE_TRACE);
+			_statusline(BAD_HTML_USE_TRACE);
 			me->inBadHTML = TRUE;
 			sleep(MessageSecs);
 			goto End_Object;
@@ -6140,21 +6062,21 @@ PRIVATE void HTML_end_element ARGS3(
 	    }
 
 	    /*
-	     *  If it's content has SHAPES, convert it to FIG. - FM
+	     *	If it's content has SHAPES, convert it to FIG. - FM
 	     */
 	    if (me->object_shapes == TRUE) {
 		if (TRACE)
 		    fprintf(stderr,
 		    "HTML: OBJECT has SHAPES.  Converting to FIG.\n");
-	        StrAllocCat(*include, "<FIG ISOBJECT IMAGEMAP");
+		StrAllocCat(*include, "<FIG ISOBJECT IMAGEMAP");
 		if (me->object_ismap == TRUE)
 		    StrAllocCat(*include, " IMAGEMAP");
-	        if (me->object_id != NULL) {
+		if (me->object_id != NULL) {
 		    StrAllocCat(*include, " ID=\"");
 		    StrAllocCat(*include, me->object_id);
 		    StrAllocCat(*include, "\"");
 		}
-	        if (me->object_data != NULL &&
+		if (me->object_data != NULL &&
 		    me->object_classid == NULL) {
 		    StrAllocCat(*include, " SRC=\"");
 		    StrAllocCat(*include, me->object_data);
@@ -6169,37 +6091,37 @@ PRIVATE void HTML_end_element ARGS3(
 	    }
 
 	    /*
-	     *  If it has a USEMAP attribute and didn't have SHAPES,
-	     *  convert it to IMG. - FM
+	     *	If it has a USEMAP attribute and didn't have SHAPES,
+	     *	convert it to IMG. - FM
 	     */
 	    if (me->object_usemap != NULL) {
 		if (TRACE)
 		    fprintf(stderr,
 		    "HTML: OBJECT has USEMAP.  Converting to IMG.\n");
 
-	        StrAllocCat(*include, "<IMG ISOBJECT");
-	        if (me->object_id != NULL) {
+		StrAllocCat(*include, "<IMG ISOBJECT");
+		if (me->object_id != NULL) {
 		    /*
-		     *  Pass the ID. - FM
+		     *	Pass the ID. - FM
 		     */
 		    StrAllocCat(*include, " ID=\"");
 		    StrAllocCat(*include, me->object_id);
 		    StrAllocCat(*include, "\"");
 		}
-	        if (me->object_data != NULL &&
+		if (me->object_data != NULL &&
 		    me->object_classid == NULL) {
 		    /*
-		     *  We have DATA with no CLASSID, so let's
-		     *  hope it' equivalent to an SRC. - FM
+		     *	We have DATA with no CLASSID, so let's
+		     *	hope it' equivalent to an SRC. - FM
 		     */
 		    StrAllocCat(*include, " SRC=\"");
 		    StrAllocCat(*include, me->object_data);
 		    StrAllocCat(*include, "\"");
 		}
-	        if (me->object_title != NULL) {
+		if (me->object_title != NULL) {
 		    /*
-		     *  Use the TITLE for both the MAP
-		     *  and the IMGs ALT. - FM
+		     *	Use the TITLE for both the MAP
+		     *	and the IMGs ALT. - FM
 		     */
 		    StrAllocCat(*include, " TITLE=\"");
 		    StrAllocCat(*include, me->object_title);
@@ -6214,9 +6136,9 @@ PRIVATE void HTML_end_element ARGS3(
 		    StrAllocCat(*include, " USEMAP=\"");
 		    StrAllocCat(*include, me->object_usemap);
 		    if (me->object_ismap == TRUE)
-		        StrAllocCat(*include, "\" ISMAP>");
+			StrAllocCat(*include, "\" ISMAP>");
 		    else
-		        StrAllocCat(*include, "\">");
+			StrAllocCat(*include, "\">");
 		} else {
 		    StrAllocCat(*include, ">");
 		}
@@ -6224,56 +6146,56 @@ PRIVATE void HTML_end_element ARGS3(
 	    }
 
 	    /*
-	     *  Add an ID link if needed. - FM
+	     *	Add an ID link if needed. - FM
 	     */
 	    if (me->object_id && *me->object_id)
-	        LYHandleID(me, me->object_id);
+		LYHandleID(me, me->object_id);
 
 	    /*
-	     *  Add the OBJECTs content if not empty. - FM
+	     *	Add the OBJECTs content if not empty. - FM
 	     */
 	    if (me->object.size > 1)
 		StrAllocCat(*include, me->object.data);
 
 	    /*
-	     *  Create a link to the DATA, if desired, and
-	     *  we can rule out that it involves scripting
-	     *  code.  This a risky thing to do, but we can
-	     *  toggle clickable_images mode off if it really
-	     *  screws things up, and so we may as well give
-	     *  it a try. - FM
+	     *	Create a link to the DATA, if desired, and
+	     *	we can rule out that it involves scripting
+	     *	code.  This a risky thing to do, but we can
+	     *	toggle clickable_images mode off if it really
+	     *	screws things up, and so we may as well give
+	     *	it a try. - FM
 	     */
 	    if (clickable_images) {
-	        if (me->object_data != NULL &&
-	            !have_param &&
+		if (me->object_data != NULL &&
+		    !have_param &&
 		    me->object_classid == NULL &&
 		    me->object_codebase == NULL &&
 		    me->object_codetype == NULL) {
 		    /*
-		     *  We have a DATA value and no need for scripting
-		     *  code, so close the current Anchor, if one is
-		     *  open, and add an Anchor for this source.  If
-		     *  we also have a TYPE value, check whether it's
-		     *  an image or not, and set the link name
-		     *  accordingly. - FM
+		     *	We have a DATA value and no need for scripting
+		     *	code, so close the current Anchor, if one is
+		     *	open, and add an Anchor for this source.  If
+		     *	we also have a TYPE value, check whether it's
+		     *	an image or not, and set the link name
+		     *	accordingly. - FM
 		     */
 		    if (me->inA)
-		        StrAllocCat(*include, "</A>");
+			StrAllocCat(*include, "</A>");
 		    StrAllocCat(*include, " -<A HREF=\"");
 		    StrAllocCat(*include, me->object_data);
 		    StrAllocCat(*include, "\">");
 		    if ((me->object_type != NULL) &&
-		        !strncasecomp(me->object_type, "image/", 6)) {
+			!strncasecomp(me->object_type, "image/", 6)) {
 			StrAllocCat(*include, "(IMAGE)");
 		    } else {
-		        StrAllocCat(*include, "(OBJECT)");
+			StrAllocCat(*include, "(OBJECT)");
 		    }
 		    StrAllocCat(*include, "</A> ");
 		}
 	    }
 	}
 
-        /*
+	/*
 	 *  Re-intialize all of the OBJECT elements. - FM
 	 */
 End_Object:
@@ -6303,7 +6225,7 @@ End_Object:
 	}
 	LYResetParagraphAlignment(me);
 	me->inAPPLETwithP = FALSE;
-    	me->inAPPLET = FALSE;
+	me->inAPPLET = FALSE;
 	change_paragraph_style(me, me->sp->style);  /* Often won't really change */
 	break;
 
@@ -6332,9 +6254,9 @@ End_Object:
 	 */
 	if (!me->inFORM) {
 	    if (TRACE) {
-		fprintf(stderr, "Bad HTML: Unmatched FORM end tag *****\n");
+		fprintf(stderr, "Bad HTML: Unmatched FORM end tag\n");
 	    } else if (!me->inBadHTML) {
-	        _statusline(BAD_HTML_USE_TRACE);
+		_statusline(BAD_HTML_USE_TRACE);
 		me->inBadHTML = TRUE;
 		sleep(MessageSecs);
 	    }
@@ -6387,32 +6309,32 @@ End_Object:
 	LYEnsureDoubleSpace(me);
 	LYResetParagraphAlignment(me);
 	change_paragraph_style(me, me->sp->style);  /* Often won't really change */
-        break;
+	break;
 
     case HTML_LEGEND:
 	LYEnsureDoubleSpace(me);
 	LYResetParagraphAlignment(me);
 	change_paragraph_style(me, me->sp->style);  /* Often won't really change */
-        break;
+	break;
 
     case HTML_LABEL:
-        break;
+	break;
 
     case HTML_BUTTON:
-        break;
+	break;
 
     case HTML_TEXTAREA:
-        {
-            InputFieldData I;
-            int chars;
+	{
+	    InputFieldData I;
+	    int chars;
 	    char *data;
 
 	    /*
-	     *  Make sure we had a textarea start tag.
+	     *	Make sure we had a textarea start tag.
 	     */
 	    if (!me->inTEXTAREA) {
-	        if (TRACE) {
-		    fprintf(stderr, "Bad HTML: Unmatched TEXTAREA end tag *****\n");
+		if (TRACE) {
+		    fprintf(stderr, "Bad HTML: Unmatched TEXTAREA end tag\n");
 		} else if (!me->inBadHTML) {
 		    _statusline(BAD_HTML_USE_TRACE);
 		    me->inBadHTML = TRUE;
@@ -6422,12 +6344,12 @@ End_Object:
 	    }
 
 	    /*
-	     *  Set to know that we are no longer in a textarea tag.
+	     *	Set to know that we are no longer in a textarea tag.
 	     */
 	    me->inTEXTAREA = FALSE;
 
-            /*
-	     *  Initialize.
+	    /*
+	     *	Initialize.
 	     */
 	    I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
 	    I.disabled=NO; I.error=NULL; I.height= NULL; I.id=NULL;
@@ -6436,21 +6358,21 @@ End_Object:
 	    I.type=NULL; I.value=NULL; I.width=NULL;
 	    I.value_cs = current_char_set;
 
-            UPDATE_STYLE;
-            /*
-	     *  Before any input field add a space if necessary.
+	    UPDATE_STYLE;
+	    /*
+	     *	Before any input field add a space if necessary.
 	     */
-            HTML_put_character(me, ' ');
+	    HTML_put_character(me, ' ');
 	    me->in_word = NO;
 	    /*
-	     *  Add a return.
+	     *	Add a return.
 	     */
 	    HText_appendCharacter(me->text, '\r');
 
 	    /*
-	     *  Finish the data off.
+	     *	Finish the data off.
 	     */
-            HTChunkTerminate(&me->textarea);
+	    HTChunkTerminate(&me->textarea);
 	    data = me->textarea.data;
 	    FREE(temp);
 
@@ -6464,12 +6386,12 @@ End_Object:
 	    I.id = me->textarea_id;
 
 	    /*
-	     *  SGML unescape any character references in TEXTAREA
-	     *  content, then parse it into individual lines
-	     *  to be handled as a series of INPUT fields (ugh!).
-	     *  Any raw 8-bit or multibye characters already have been
-	     *  handled in relation to the display character set
-	     *  in SGML_character().
+	     *	SGML unescape any character references in TEXTAREA
+	     *	content, then parse it into individual lines
+	     *	to be handled as a series of INPUT fields (ugh!).
+	     *	Any raw 8-bit or multibye characters already have been
+	     *	handled in relation to the display character set
+	     *	in SGML_character().
 	     */
 	    me->UsePlainSpace = TRUE;
 
@@ -6577,7 +6499,7 @@ End_Object:
 
 	    HTChunkClear(&me->textarea);
 	    FREE(me->textarea_name);
-            me->textarea_name_cs = -1;
+	    me->textarea_name_cs = -1;
 	    FREE(me->textarea_cols);
 	    FREE(me->textarea_id);
 	    break;
@@ -6588,10 +6510,10 @@ End_Object:
 	    char *ptr;
 
 	    /*
-	     *  Make sure we had a select start tag.
+	     *	Make sure we had a select start tag.
 	     */
 	    if (!me->inSELECT) {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr, "Bad HTML: Unmatched SELECT end tag *****\n");
 		} else if (!me->inBadHTML) {
 		    _statusline(BAD_HTML_USE_TRACE);
@@ -6602,20 +6524,20 @@ End_Object:
 	    }
 
 	    /*
-	     *  Set to know that we are no longer in a select tag.
+	     *	Set to know that we are no longer in a select tag.
 	     */
 	    me->inSELECT = FALSE;
 
 	    /*
-	     *  Clear the disable attribute.
+	     *	Clear the disable attribute.
 	     */
 	    me->select_disabled = FALSE;
 
 	    /*
-	     *  Make sure we're in a form.
+	     *	Make sure we're in a form.
 	     */
 	    if (!me->inFORM) {
-	        if (TRACE) {
+		if (TRACE) {
 		    fprintf(stderr,
 			    "Bad HTML: SELECT end tag not within FORM element *****\n");
 		} else if (!me->inBadHTML) {
@@ -6623,20 +6545,20 @@ End_Object:
 		    me->inBadHTML = TRUE;
 		    sleep(MessageSecs);
 		}
-	        /*
+		/*
 		 *  Hopefully won't crash, so we'll ignore it. - kw
 		 */
 	    }
 
 	    /*
-	     *  Finish the data off.
+	     *	Finish the data off.
+	     */
+	    HTChunkTerminate(&me->option);
+	    /*
+	     *	Finish the previous option.
 	     */
-       	    HTChunkTerminate(&me->option);
-	/*
-	 *  Finish the previous option.
-	 */
 	    ptr = HText_setLastOptionValue(me->text,
-	    				   me->option.data,
+					   me->option.data,
 					   me->LastOptionValue,
 					   LAST_ORDER,
 					   me->LastOptionChecked,
@@ -6647,41 +6569,41 @@ End_Object:
 	    me->LastOptionChecked = FALSE;
 
 	    if (HTCurSelectGroupType == F_CHECKBOX_TYPE ||
-	        LYSelectPopups == FALSE) {
-	            /*
-		     *  Start a newline after the last checkbox/button option.
+		LYSelectPopups == FALSE) {
+		    /*
+		     *	Start a newline after the last checkbox/button option.
 		     */
 		    LYEnsureSingleSpace(me);
 	    } else {
-	        /*
+		/*
 		 *  Output popup box with the default option to screen,
 		 *  but use non-breaking spaces for output.
 		 */
-	        if (ptr &&
+		if (ptr &&
 		    (me->sp[0].tag_number == HTML_PRE || me->inPRE == TRUE ||
 		     !me->sp->style->freeFormat) &&
 		    strlen(ptr) > 6) {
-	            /*
-		     *  The code inadequately handles OPTION fields in PRE tags.
-		     *  We'll put up a minimum of 6 characters, and if any
-		     *  more would exceed the wrap column, we'll ignore them.
+		    /*
+		     *	The code inadequately handles OPTION fields in PRE tags.
+		     *	We'll put up a minimum of 6 characters, and if any
+		     *	more would exceed the wrap column, we'll ignore them.
 		     */
 		    for (i = 0; i < 6; i++) {
-		        if (*ptr == ' ')
-	    	            HText_appendCharacter(me->text,HT_NON_BREAK_SPACE);
-		        else
-	    	            HText_appendCharacter(me->text,*ptr);
+			if (*ptr == ' ')
+			    HText_appendCharacter(me->text,HT_NON_BREAK_SPACE);
+			else
+			    HText_appendCharacter(me->text,*ptr);
 			ptr++;
 		    }
 		    HText_setIgnoreExcess(me->text, TRUE);
-	        }
-	        for (; ptr && *ptr != '\0'; ptr++) {
+		}
+		for (; ptr && *ptr != '\0'; ptr++) {
 		    if (*ptr == ' ')
-	    	        HText_appendCharacter(me->text,HT_NON_BREAK_SPACE);
+			HText_appendCharacter(me->text,HT_NON_BREAK_SPACE);
 		    else
-	    	        HText_appendCharacter(me->text,*ptr);
+			HText_appendCharacter(me->text,*ptr);
 		}
-	        /*
+		/*
 		 *  Add end option character.
 		 */
 		if (!me->first_option) {
@@ -6691,14 +6613,14 @@ End_Object:
 		}
 		HText_setIgnoreExcess(me->text, FALSE);
 	    }
-    	    HTChunkClear(&me->option);
+	    HTChunkClear(&me->option);
 
 	    if (me->Underline_Level > 0 && me->inUnderline == FALSE) {
-	        HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
-	        me->inUnderline = TRUE;
+		HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);
+		me->inUnderline = TRUE;
 	    }
 	    if (me->needBoldH == TRUE && me->inBoldH == FALSE) {
-	        HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
+		HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
 		me->inBoldH = TRUE;
 		me->needBoldH = FALSE;
 	    }
@@ -6706,7 +6628,7 @@ End_Object:
 	break;
 
     case HTML_TABLE:
-        me->inTABLE = FALSE;
+	me->inTABLE = FALSE;
 	if (!strcmp(me->sp->style->name, "Preformatted")) {
 	    break;
 	}
@@ -6714,31 +6636,31 @@ End_Object:
 	    me->Division_Level--;
 	if (me->Division_Level >= 0)
 	    me->sp->style->alignment =
-	    			me->DivisionAlignments[me->Division_Level];
+				me->DivisionAlignments[me->Division_Level];
 	change_paragraph_style(me, me->sp->style);
 	UPDATE_STYLE;
 	me->current_default_alignment = me->sp->style->alignment;
 	if (me->List_Nesting_Level >= 0)
 	    HText_NegateLineOne(me->text);
-        break;
+	break;
 
 /* These TABLE related elements may now not be SGML_EMPTY. - kw */
     case HTML_TR:
-        break;
+	break;
 
     case HTML_THEAD:
     case HTML_TFOOT:
     case HTML_TBODY:
-        break;
+	break;
 
     case HTML_COLGROUP:
-        break;
+	break;
 
     case HTML_TH:
-        break;
+	break;
 
     case HTML_TD:
-        break;
+	break;
 
 /* More stuff that may now not be SGML_EMPTY any more: */
     case HTML_DT:
@@ -6749,12 +6671,12 @@ End_Object:
 	break;
 
     case HTML_MATH:
-        /*
+	/*
 	 *  We're getting it as Litteral text, which, until we can process
 	 *  it, we'll display as is, within brackets to alert the user. - FM
 	 */
 	HTChunkPutc(&me->math, ' ');
-        HTChunkTerminate(&me->math);
+	HTChunkTerminate(&me->math);
 	if (me->math.size > 2) {
 	    LYEnsureSingleSpace(me);
 	    if (me->inUnderline == FALSE)
@@ -6779,47 +6701,47 @@ End_Object:
     } /* switch */
 #ifdef USE_COLOR_STYLE
     {
-        char *end, *start=NULL, *lookfrom;
-        char tmp[64];
-        sprintf(tmp, ";%s", HTML_dtd.tags[element_number].name);
-        strtolower(tmp);
-
-        lookfrom = Style_className;
-        do
-        {
-            end = start;
-            start = strstr(lookfrom, tmp);
-            if (start)
-                lookfrom = start + 1;
-        }
-        while (start);
+	char *end, *start=NULL, *lookfrom;
+	char tmp[64];
+	sprintf(tmp, ";%s", HTML_dtd.tags[element_number].name);
+	strtolower(tmp);
+
+	lookfrom = Style_className;
+	do
+	{
+	    end = start;
+	    start = strstr(lookfrom, tmp);
+	    if (start)
+		lookfrom = start + 1;
+	}
+	while (start);
 /* trim the last matching element off the end
 ** - should match classes here as well (rp)
 */
-        if (end)
-            *end='\0';
-        hcode=hash_code(lookfrom && *lookfrom ? lookfrom : &tmp[1]);
-        if (TRACE)
-            fprintf(stderr, "CSS:%s (trimmed %s, END_ELEMENT)\n", Style_className, tmp);
+	if (end)
+	    *end='\0';
+	hcode=hash_code(lookfrom && *lookfrom ? lookfrom : &tmp[1]);
+	if (TRACE)
+	    fprintf(stderr, "CSS:%s (trimmed %s, END_ELEMENT)\n", Style_className, tmp);
     }
 
     if (HTML_dtd.tags[element_number].contents != SGML_EMPTY)
     {
-        if (TRACE)
-            fprintf(stderr, "STYLE:end_element: ending non-EMPTY style\n");
+	if (TRACE)
+	    fprintf(stderr, "STYLE:end_element: ending non-EMPTY style\n");
 #if !defined(USE_HASH)
-        HText_characterStyle(me->text, element_number+STARTAT, STACK_OFF);
+	HText_characterStyle(me->text, element_number+STARTAT, STACK_OFF);
 #else
-        HText_characterStyle(me->text, hcode, STACK_OFF);
+	HText_characterStyle(me->text, hcode, STACK_OFF);
 #endif /* USE_HASH */
 #if defined(PREVAIL)
-        /* reset the prevailing class to the previous one */
-        {
-                char *dot=strrchr(Style_className,'.');
-                LYstrncpy(prevailing_class,
+	/* reset the prevailing class to the previous one */
+	{
+		char *dot=strrchr(Style_className,'.');
+		LYstrncpy(prevailing_class,
 			  dot ? (char*)(dot+1) : "",
 			  (TEMPSTRINGSIZE - 1));
-        }
+	}
 #endif
     }
 #endif /* USE_COLOR_STYLE */
@@ -6832,30 +6754,30 @@ End_Object:
 */
 PUBLIC int HTML_put_entity ARGS2(HTStructured *, me, int, entity_number)
 {
-    int nent = HTML_dtd.number_of_entities;
+    int nent = HTML_dtd.number_of_entities, c_out;
+    UCode_t uni;
 
     if (entity_number < nent) {
 	HTML_put_string(me, p_entity_values[entity_number]);
 	return HT_OK;
     } else if (me->UCLYhndl < 0) {
 	return HT_CANNOT_TRANSLATE;
-    } else {
-	UCode_t uni = HTML_dtd.extra_entity_info[entity_number-nent].code;
-	int c_out = UCTransUniChar(uni, me->UCLYhndl);
-	if (c_out > 0) {
-	    HTML_put_character(me, (char)c_out);
+    }
+    uni = HTML_dtd.extra_entity_info[entity_number-nent].code;
+    c_out = UCTransUniChar(uni, me->UCLYhndl);
+    if (c_out > 0) {
+	HTML_put_character(me, (char)c_out);
+	return HT_OK;
+    } else if (c_out == UCTRANS_NOTFOUND) {
+	char buf[21];
+	int c_out2 = UCTransUniCharStr(buf,20, uni, me->UCLYhndl, NO);
+
+	if (c_out2 >= 0) {
+	    HTML_put_string(me, buf);
 	    return HT_OK;
-	} else if (c_out==UCTRANS_NOTFOUND) {
-	    char buf[21];
-	    int c_out2 = UCTransUniCharStr(buf,20, uni, me->UCLYhndl, NO);
-	    if (c_out2 >= 0) {
-		HTML_put_string(me, buf);
-		return HT_OK;
-	    }
 	}
-	return HT_CANNOT_TRANSLATE;
     }
-    return HT_OK;
+    return HT_CANNOT_TRANSLATE;
 }
 
 /*	Free an HTML object
@@ -6863,7 +6785,7 @@ PUBLIC int HTML_put_entity ARGS2(HTStructured *, me, int, entity_number)
 **
 **	If the document is empty, the text object will not yet exist.
 **	So we could in fact abandon creating the document and return
-**	an error code.  In fact an empty document is an important type
+**	an error code.	In fact an empty document is an important type
 **	of document, so we don't.
 **
 **	If non-interactive, everything is freed off.   No: crashes -listrefs
@@ -6874,7 +6796,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
     char *include = NULL;
 
     if (LYMapsOnly && !me->text) {
-        /*
+	/*
 	 *  We only handled MAP, AREA and BASE tags, and didn't
 	 *  create an HText structure for the document nor want
 	 *  one now, so just make sure we free anything that might
@@ -6904,14 +6826,14 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
 	 *  and of correct wind-down on end-of-stream (in SGML_free
 	 *  SGML_abort),
 	 *  THEN these and other checks here in HTML.c should not be
-	 *  necessary.  Still it can't hurt to include them. - kw
+	 *  necessary.	Still it can't hurt to include them. - kw
 	 */
 	if (me->inUnderline) {
 	    HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);
 	    me->inUnderline = FALSE;
 	    me->Underline_Level = 0;
 	    if (TRACE)
-	        fprintf(stderr,"HTML_free: Ending underline\n");
+		fprintf(stderr,"HTML_free: Ending underline\n");
 	}
 	if (me->inA) {
 	    HTML_end_element(me, HTML_A, (char **)&include);
@@ -6927,9 +6849,9 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
 	}
 	if (me->option.size > 0) {
 	    /*
-	     *  If we still have data in the me->option chunk after
-	     *  forcing a close of a still-open form, something must
-	     *  have gone very wrong. - kw
+	     *	If we still have data in the me->option chunk after
+	     *	forcing a close of a still-open form, something must
+	     *	have gone very wrong. - kw
 	     */
 	    if (TRACE) {
 		fprintf(stderr,
@@ -6941,8 +6863,8 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
 	    }
 	    HTChunkTerminate(&me->option);
 	    /*
-	     *  Output the left-over data as text, maybe it was invalid
-	     *  markup meant to be shown somewhere. - kw
+	     *	Output the left-over data as text, maybe it was invalid
+	     *	markup meant to be shown somewhere. - kw
 	     */
 	    if (TRACE)
 		fprintf(stderr, "HTML_free: ***** leftover option data: %s\n",
@@ -6952,9 +6874,9 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
 	}
 	if (me->textarea.size > 0) {
 	    /*
-	     *  If we still have data in the me->textarea chunk after
-	     *  forcing a close of a still-open form, something must
-	     *  have gone very wrong. - kw
+	     *	If we still have data in the me->textarea chunk after
+	     *	forcing a close of a still-open form, something must
+	     *	have gone very wrong. - kw
 	     */
 	    if (TRACE) {
 		fprintf(stderr,
@@ -6966,8 +6888,8 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
 	    }
 	    HTChunkTerminate(&me->textarea);
 	    /*
-	     *  Output the left-over data as text, maybe it was invalid
-	     *  markup meant to be shown somewhere. - kw
+	     *	Output the left-over data as text, maybe it was invalid
+	     *	markup meant to be shown somewhere. - kw
 	     */
 	    if (TRACE)
 		fprintf(stderr, "HTML_free: ***** leftover textarea data: %s\n",
@@ -7042,17 +6964,17 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
     }
 
     if (me->target) {
-        (*me->targetClass._free)(me->target);
+	(*me->targetClass._free)(me->target);
     }
     if (me->sp && me->sp->style && me->sp->style->name) {
-        if (!strcmp(me->sp->style->name, "DivCenter") ||
+	if (!strcmp(me->sp->style->name, "DivCenter") ||
 	    !strcmp(me->sp->style->name, "HeadingCenter") ||
 	    !strcmp(me->sp->style->name, "Heading1")) {
 	    me->sp->style->alignment = HT_CENTER;
 	} else if (!strcmp(me->sp->style->name, "DivRight") ||
 		   !strcmp(me->sp->style->name, "HeadingRight")) {
 	    me->sp->style->alignment = HT_RIGHT;
-	} else  {
+	} else	{
 	    me->sp->style->alignment = HT_LEFT;
 	}
 	styles[HTML_PRE]->alignment = HT_LEFT;
@@ -7068,7 +6990,7 @@ PRIVATE void HTML_abort ARGS2(HTStructured *, me, HTError, e)
     char *include = NULL;
 
     if (me->text) {
-        /*
+	/*
 	 *  If we have emphasis on, or open A, FONT, or FORM
 	 *  containers, turn it off or close them now. - FM
 	 */
@@ -7128,17 +7050,17 @@ PRIVATE void HTML_abort ARGS2(HTStructured *, me, HTError, e)
     }
 
     if (me->target) {
-        (*me->targetClass._abort)(me->target, e);
+	(*me->targetClass._abort)(me->target, e);
     }
     if (me->sp && me->sp->style && me->sp->style->name) {
-        if (!strcmp(me->sp->style->name, "DivCenter") ||
+	if (!strcmp(me->sp->style->name, "DivCenter") ||
 	    !strcmp(me->sp->style->name, "HeadingCenter") ||
 	    !strcmp(me->sp->style->name, "Heading1")) {
 	    me->sp->style->alignment = HT_CENTER;
 	} else if (!strcmp(me->sp->style->name, "DivRight") ||
 		   !strcmp(me->sp->style->name, "HeadingRight")) {
 	    me->sp->style->alignment = HT_RIGHT;
-	} else  {
+	} else	{
 	    me->sp->style->alignment = HT_LEFT;
 	}
 	styles[HTML_PRE]->alignment = HT_LEFT;
@@ -7207,19 +7129,19 @@ PRIVATE void get_styles NOARGS
 
     styles[HTML_DLC] =		HTStyleNamed(styleSheet, "GlossaryCompact");
 	/* nested list styles */
-    styles[HTML_DLC1] =		HTStyleNamed(styleSheet, "GlossaryCompact1");
-    styles[HTML_DLC2] =		HTStyleNamed(styleSheet, "GlossaryCompact2");
-    styles[HTML_DLC3] =		HTStyleNamed(styleSheet, "GlossaryCompact3");
-    styles[HTML_DLC4] =		HTStyleNamed(styleSheet, "GlossaryCompact4");
-    styles[HTML_DLC5] =		HTStyleNamed(styleSheet, "GlossaryCompact5");
-    styles[HTML_DLC6] =		HTStyleNamed(styleSheet, "GlossaryCompact6");
+    styles[HTML_DLC1] = 	HTStyleNamed(styleSheet, "GlossaryCompact1");
+    styles[HTML_DLC2] = 	HTStyleNamed(styleSheet, "GlossaryCompact2");
+    styles[HTML_DLC3] = 	HTStyleNamed(styleSheet, "GlossaryCompact3");
+    styles[HTML_DLC4] = 	HTStyleNamed(styleSheet, "GlossaryCompact4");
+    styles[HTML_DLC5] = 	HTStyleNamed(styleSheet, "GlossaryCompact5");
+    styles[HTML_DLC6] = 	HTStyleNamed(styleSheet, "GlossaryCompact6");
 
     styles[HTML_ADDRESS] =	HTStyleNamed(styleSheet, "Address");
     styles[HTML_BANNER] =	HTStyleNamed(styleSheet, "Banner");
     styles[HTML_BLOCKQUOTE] =	HTStyleNamed(styleSheet, "Blockquote");
     styles[HTML_BQ] =		HTStyleNamed(styleSheet, "Bq");
     styles[HTML_FN] =		HTStyleNamed(styleSheet, "Footnote");
-    styles[HTML_NOTE] =		HTStyleNamed(styleSheet, "Note");
+    styles[HTML_NOTE] = 	HTStyleNamed(styleSheet, "Note");
     styles[HTML_PLAINTEXT] =
     styles[HTML_XMP] =		HTStyleNamed(styleSheet, "Example");
     styles[HTML_PRE] =		HTStyleNamed(styleSheet, "Preformatted");
@@ -7237,8 +7159,8 @@ PUBLIC CONST HTStructuredClass HTMLPresentation = /* As opposed to print etc */
 	"Lynx_HTML_Handler",
 	HTML_free,
 	HTML_abort,
-	HTML_put_character, 	HTML_put_string,  HTML_write,
-	HTML_start_element, 	HTML_end_element,
+	HTML_put_character,	HTML_put_string,  HTML_write,
+	HTML_start_element,	HTML_end_element,
 	HTML_put_entity
 };
 
@@ -7249,7 +7171,7 @@ PUBLIC CONST HTStructuredClass HTMLPresentation = /* As opposed to print etc */
 **	or plain text, or HTML.
 */
 PUBLIC HTStructured* HTML_new ARGS3(
-	HTParentAnchor *, 	anchor,
+	HTParentAnchor *,	anchor,
 	HTFormat,		format_out,
 	HTStream*,		stream)
 {
@@ -7257,18 +7179,18 @@ PUBLIC HTStructured* HTML_new ARGS3(
     HTStructured * me;
 
     if (format_out != WWW_PLAINTEXT && format_out != WWW_PRESENT) {
-        HTStream * intermediate = HTStreamStack(WWW_HTML, format_out,
+	HTStream * intermediate = HTStreamStack(WWW_HTML, format_out,
 						stream, anchor);
 	if (intermediate)
 	    return HTMLGenerator(intermediate);
-        fprintf(stderr, "\n** Internal error: can't parse HTML to %s\n",
-       		HTAtom_name(format_out));
+	fprintf(stderr, "\n** Internal error: can't parse HTML to %s\n",
+		HTAtom_name(format_out));
 #ifndef NOSIGHUP
-        (void) signal(SIGHUP, SIG_DFL);
+	(void) signal(SIGHUP, SIG_DFL);
 #endif /* NOSIGHUP */
-        (void) signal(SIGTERM, SIG_DFL);
+	(void) signal(SIGTERM, SIG_DFL);
 #ifndef VMS
-        (void) signal(SIGINT, SIG_DFL);
+	(void) signal(SIGINT, SIG_DFL);
 #endif /* !VMS */
 #ifdef SIGTSTP
 	if (no_suspend)
@@ -7279,12 +7201,12 @@ PUBLIC HTStructured* HTML_new ARGS3(
 
     me = (HTStructured*) calloc(sizeof(*me),1);
     if (me == NULL)
-        outofmem(__FILE__, "HTML_new");
+	outofmem(__FILE__, "HTML_new");
 
     if (!got_styles)
-        get_styles();
+	get_styles();
     else
-        default_style =	HTStyleNamed(styleSheet, "Normal");
+	default_style = HTStyleNamed(styleSheet, "Normal");
 
     me->isa = &HTMLPresentation;
     me->node_anchor = anchor;
@@ -7374,7 +7296,7 @@ PUBLIC HTStructured* HTML_new ARGS3(
     me->lastraw = -1;
 
     /*
-     *  Used for nested lists. - FM
+     *	Used for nested lists. - FM
      */
     me->List_Nesting_Level = -1; /* counter for list nesting level */
     LYZero_OL_Counter(me);	 /* Initializes OL_Counter[] and OL_Type[] */
@@ -7416,31 +7338,30 @@ PUBLIC HTStructured* HTML_new ARGS3(
 
 #ifdef NOTUSED_FOTEMODS
     /*
-    **  If the anchor already has stage info, make sure that it is
-    **  appropriate for the current display charset.  HTMIMEConvert()
-    **  does this for the http and https schemes, and HTCharsetFormat()
-    **  does it for the file and and ftp schemes, be we need to do it,
-    **  if necessary, for the gateway schemes. - FM
+    **	If the anchor already has stage info, make sure that it is
+    **	appropriate for the current display charset.  HTMIMEConvert()
+    **	does this for the http and https schemes, and HTCharsetFormat()
+    **	does it for the file and and ftp schemes, be we need to do it,
+    **	if necessary, for the gateway schemes. - FM
     */
     if (me->node_anchor->UCStages) {
 	if (HTAnchor_getUCLYhndl(me->node_anchor,
 				 UCT_STAGE_STRUCTURED) != current_char_set) {
 	    /*
-	    **  We are reloading due to a change in the display character
-	    **  set.  Free the stage info and let the stage info creation
-	    **  mechanisms create a new UCStages structure appropriate for
-	    **  the current display character set. - FM
+	    **	We are reloading due to a change in the display character
+	    **	set.  Free the stage info and let the stage info creation
+	    **	mechanisms create a new UCStages structure appropriate for
+	    **	the current display character set. - FM
 	    */
-
 	    FREE(anchor->UCStages);
 	} else if (HTAnchor_getUCLYhndl(me->node_anchor,
 					UCT_STAGE_MIME) == current_char_set) {
 	    /*
-	    **  The MIME stage is set to the current display character
-	    **  set.  If it is CJK, and HTCJK does not point to a CJK
-	    **  character set, assume we are reloading due to a raw
-	    **  mode toggle and reset the MIME and PARSER stages to
-	    **  an ISO Latin 1 default. - FM
+	    **	The MIME stage is set to the current display character
+	    **	set.  If it is CJK, and HTCJK does not point to a CJK
+	    **	character set, assume we are reloading due to a raw
+	    **	mode toggle and reset the MIME and PARSER stages to
+	    **	an ISO Latin 1 default. - FM
 	    */
 	    LYUCcharset *p_in = HTAnchor_getUCInfoStage(me->node_anchor,
 							UCT_STAGE_MIME);
@@ -7463,50 +7384,50 @@ PUBLIC HTStructured* HTML_new ARGS3(
 #endif /* NOTUSED_FOTEMODS */
 
     /*
-    **  Create a chartrans stage info structure for the anchor,
-    **  if it does not exist already (in which case the default
-    **  MIME stage info will be loaded as well), and load the
-    **  HTML stage info into me->UCI and me->UCLYhndl. - FM
+    **	Create a chartrans stage info structure for the anchor,
+    **	if it does not exist already (in which case the default
+    **	MIME stage info will be loaded as well), and load the
+    **	HTML stage info into me->UCI and me->UCLYhndl. - FM
     */
     LYGetChartransInfo(me);
     UCTransParams_clear(&me->T);
 
     /*
-    **  Load the existing or default input charset info
-    **  into the holding elements.  We'll believe what
-    **  is indicated for UCT_STAGE_PARSER. - FM
+    **	Load the existing or default input charset info
+    **	into the holding elements.  We'll believe what
+    **	is indicated for UCT_STAGE_PARSER. - FM
     */
     me->inUCLYhndl = HTAnchor_getUCLYhndl(me->node_anchor,
-			 		  UCT_STAGE_PARSER);
+					  UCT_STAGE_PARSER);
     if (me->inUCLYhndl < 0) {
-    	me->inUCLYhndl = HTAnchor_getUCLYhndl(me->node_anchor,
-			 		      UCT_STAGE_MIME);
+	me->inUCLYhndl = HTAnchor_getUCLYhndl(me->node_anchor,
+					      UCT_STAGE_MIME);
 	me->inUCI = HTAnchor_getUCInfoStage(me->node_anchor,
-			 		    UCT_STAGE_MIME);
+					    UCT_STAGE_MIME);
     } else {
 	me->inUCI = HTAnchor_getUCInfoStage(me->node_anchor,
-			 		    UCT_STAGE_PARSER);
+					    UCT_STAGE_PARSER);
     }
 
     /*
-    **  Load the existing or default output charset info
-    **  into the holding elements, UCT_STAGE_STRUCTURED
-    **  should be the same as UCT_STAGE_TEXT at this point,
-    **  but we could check, perhaps. - FM
+    **	Load the existing or default output charset info
+    **	into the holding elements, UCT_STAGE_STRUCTURED
+    **	should be the same as UCT_STAGE_TEXT at this point,
+    **	but we could check, perhaps. - FM
     */
     me->outUCI = HTAnchor_getUCInfoStage(me->node_anchor,
-			 		 UCT_STAGE_STRUCTURED);
+					 UCT_STAGE_STRUCTURED);
     me->outUCLYhndl = HTAnchor_getUCLYhndl(me->node_anchor,
-			 		   UCT_STAGE_STRUCTURED);
+					   UCT_STAGE_STRUCTURED);
 #ifdef NOTUSED_FOTEMODS
     UCSetTransParams(&me->T,
-    		     me->inUCLYhndl, me->inUCI,
+		     me->inUCLYhndl, me->inUCI,
 		     me->outUCLYhndl, me->outUCI);
 #endif
 
     me->target = stream;
     if (stream)
-        me->targetClass = *stream->isa;			/* Copy pointers */
+	me->targetClass = *stream->isa; 		/* Copy pointers */
 
     return (HTStructured*) me;
 }
@@ -7623,15 +7544,15 @@ PUBLIC HTStream* HTMLPresent ARGS3(
 **	marking at such so that it is retried on reload.
 **
 ** On entry,
-**	sink 	is a stream to the output device if any
+**	sink	is a stream to the output device if any
 **	number	is the HTTP error number
-**	message	is the human readable message.
+**	message is the human readable message.
 **
 ** On exit,
-**	returns	a negative number to indicate lack of success in the load.
+**	returns a negative number to indicate lack of success in the load.
 */
 PUBLIC int HTLoadError ARGS3(
-	HTStream *, 	sink,
+	HTStream *,	sink,
 	int,		number,
 	CONST char *,	message)
 {
diff --git a/src/HTML.h b/src/HTML.h
index afee69f9..7507d3ea 100644
--- a/src/HTML.h
+++ b/src/HTML.h
@@ -215,6 +215,10 @@ struct _HTStream {
     /* .... */
 };
 
+extern  HTStyle *styles[HTML_ELEMENTS+31]; /* adding 24 nested list styles  */
+					   /* and 3 header alignment styles */
+					   /* and 3 div alignment styles    */
+
 /*
  *	Semi-Private functions. - FM
  */
@@ -222,6 +226,11 @@ extern void HTML_put_character PARAMS((HTStructured *me, char c));
 extern void HTML_put_string PARAMS((HTStructured *me, CONST char *s));
 extern void HTML_write PARAMS((HTStructured *me, CONST char *s, int l));
 extern int HTML_put_entity PARAMS((HTStructured *me, int entity_number));
+extern void actually_set_style PARAMS((HTStructured * me));
+
+/*	Style buffering avoids dummy paragraph begin/ends.
+*/
+#define UPDATE_STYLE if (me->style_change) { actually_set_style(me); }
 #endif /* Lynx_HTML_Handler */
 
 extern void strtolower PARAMS((char* i));
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index 6b0812d9..7d5d0635 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -420,6 +420,9 @@ PUBLIC LYUCcharset LYCharSet_UC[MAXCHARSETS]=
  *  Add the code of the the lowest character with the high bit set
  *  that can be directly displayed.
  *  The order of LYCharSets and LYlowest_eightbit MUST be the same.
+ *
+ *  (If charset have chartrans unicode table,
+ *  LYlowest_eightbit will be verified/modified anyway.)
  */
 PUBLIC int LYlowest_eightbit[MAXCHARSETS]={
 	160,	/* ISO Latin 1		*/
@@ -778,13 +781,21 @@ PUBLIC CONST char * HTMLGetEntityName ARGS1(
  *  Function to return the UCode_t (long int) value for entity names
  *  in the ISO_Latin1 and UC_entity_info extra_entities arrays.  It
  *  returns 0 if not found. - FM
+ *
+ *  Unicode-based extra_entities[] table now handles all the names from old
+ *  style entities[] too.  In the future we will try to redirect all calls to
+ *  both entities[] and extra_entities[] through HTMLGetEntityUCValue() only.
+ *  Also, we should not worry about control characters, they will pass through
+ *  Unicode anyway and should be processed *after* calling this function.
+ *  (see put_special_unicodes() in SGML.c).  - LP
  */
 PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
 	CONST char *,	name)
 {
     UCode_t value = 0;
-    int i, high, low, diff = 0;
-    CONST char ** entities = HTML_dtd.entity_names;
+    size_t i, high, low;
+    int diff = 0;
+/*  CONST char ** entities = HTML_dtd.entity_names;  */
     CONST UC_entity_info * extra_entities = HTML_dtd.extra_entity_info;
 
     /*
@@ -793,6 +804,12 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
     if (!(name && *name))
 	return(value);
 
+
+#ifdef NOTDEFINED
+/*
+**  extra_entities[] now handle all names from entities[], so disable latter.
+*/
+
     /*
      *	Handle names that have control characters
      *	or strings in ISO_Latin1[]. - FM
@@ -849,6 +866,11 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
     /*
      *	Not yet found, so try UC_entity_info extra_entities[]. - FM
      */
+#endif /* NOTDEFINED */
+
+    /*
+     *	Try UC_entity_info extra_entities[].
+     */
     for (low = 0, high = HTML_dtd.number_of_extra_entities;
 	 high > low;
 	 diff < 0 ? (low = i+1) : (high = i)) {
@@ -920,7 +942,7 @@ PUBLIC void HTMLUseCharacterSet ARGS1(int,i)
 
 /*
  *  Initializer, calls initialization function for the
- *  CHARTRANS handling if compiled in. - KW
+ *  CHARTRANS handling. - KW
  */
 PUBLIC int LYCharSetsDeclared NOPARAMS
 {
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 47a0ece5..e830d9ea 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -833,6 +833,614 @@ PUBLIC void LYGetChartransInfo ARGS1(
 				      UCT_STAGE_STRUCTURED);
 }
 
+#if 0
+/*
+**  This function reallocates an allocated string and converts
+**  characters for the current display character set.  It assumes
+**  that invalid control characters have been dealt with by the
+**  SGML (or other initial) parser of the document input stream
+**  (i.e. are present only if elements or global flags have been
+**  set to allow them), and that otherwise this is a copy of the
+**  string with the charset of the input stream.  It handles Lynx
+**  special characters based on the 'me' structure's element values
+**  (the me->UsePlainSpace and me->HiddenValue elements, and its
+**  chartrans related elements), and calls to other functions which
+**  return structure element values.  HTChunk functions are used to
+**  keep memory allocations at a minimum. - FM
+*/
+PUBLIC void LYExpandString ARGS2(
+	HTStructured *,		me,
+	char **,		str)
+{
+    char *p = *str;
+    HTChunk *s;
+    BOOLEAN plain_space, hidden;
+    char c;
+    unsigned char c_unsign;
+    char saved_char_in = '\0';
+    BOOLEAN chk;
+    UCode_t code, uck;
+    char replace_buf [64];
+    char utf_buf[8], utf_count = 0;
+    char *utf_buf_p = utf_buf;
+    UCode_t utf_char = 0, value;
+    CONST char *name;
+    int i, j, high, low, diff = 0;
+
+    /*
+    **  Don't do anything if we have no structure
+    **  or string, or are in CJK mode. - FM
+    */
+    if (!me || !p || *p == '\0' ||
+        HTCJK != NOCJK)
+        return;
+
+    /*
+    **  Set "convenience copies" of me structure
+    **  elements. - FM
+    */
+    plain_space = me->UsePlainSpace;
+    hidden = me->HiddenValue;
+
+    /*
+    **  Check for special input charsets - FM
+    */
+    if (!strcmp(me->inUCI->MIMEname, "x-transparent")) {
+	/*
+	**  Conversions not intended. - FM
+	*/
+	return;
+    }
+    if (!strcmp(me->inUCI->MIMEname, "mnemonic") ||
+	!strcmp(me->inUCI->MIMEname, "mnemonic+ascii+0")) {
+	/*
+	**  All ASCII representations of Unicode characters,
+	**  and we have no reverse translation code for the
+	**  multibyte characters, so punt. - FM
+	*/
+	return;
+    }
+    if (me->inUCLYhndl < 0 || me->outUCLYhndl < 0) {
+	/*
+	**  The chartrans procedure failed, so we don't
+	**  do anything, and hope for the best. - FM
+	*/
+	if (TRACE) {
+	    fprintf(stderr,
+		    "LYExpandString: Bad in (%d) or out (%d) handle(s).\n",
+		    me->inUCLYhndl, me->outUCLYhndl);
+	}
+	return;
+    }
+
+    /*
+    **  Zero the UTF-8 multibytes buffer. - FM
+    */
+    utf_buf[0] = utf_buf[6] = utf_buf[7] = '\0';
+
+    /*
+    **  Set up an HTChunk for accumulating the expanded copy
+    **  of the string, so that allocations are done in 128
+    **  byte increments, only as required. - FM
+    */
+    s = HTChunkCreate(128);
+
+    /*
+    **  Check each character in the original string,
+    **  and add the characters or substitutions to
+    **  our clean copy. - FM
+    */
+    for (i = 0; p[i]; i++) {
+	/*
+	**  Make sure the character is handled as Unicode
+	**  whenever that's appropriate.  - FM
+	*/
+	c = p[i];
+	c_unsign = (unsigned char)c;
+	code = (UCode_t)c_unsign;
+	saved_char_in = '\0';
+	/*
+	**  Combine any UTF-8 multibytes into Unicode
+	**  to check for special characters. - FM
+	*/
+	if (me->T.decode_utf8) {
+	    /*
+	    **  Our input charset is UTF-8, so check
+	    **  for non-ASCII characters. - FM
+	    */
+	    if (c_unsign > 127) {
+		/*
+		**  We have an octet from a multibyte character. - FM
+		*/
+		if (utf_count > 0 && (c & 0xc0) == 0x80) {
+		    /*
+		    **  Adjust the UCode_t value, add the octet
+		    **  to the buffer, and decrement the byte
+		    **  count. - FM
+		    */
+		    utf_char = (utf_char << 6) | (c & 0x3f);
+		    utf_count--;
+		    *utf_buf_p = c;
+		    utf_buf_p++;
+		    if (utf_count == 0) {
+			/*
+			**  We have all of the bytes, so terminate
+			**  the buffer and set 'code' to the UCode_t
+			**  value. - FM
+			*/
+			*utf_buf_p = '\0';
+			code = utf_char;
+			/*
+			**  Set up the monobyte character
+			**  values or non-character flags
+			**  and fall through. - FM
+			*/
+			if (code > 0 && code < 256) {
+			    c = ((char)(code & 0xff));
+			    c_unsign = (unsigned char)c;
+			}
+		    } else {
+			/*
+			**  Get the next byte. - FM
+			*/
+			continue;
+		    }
+		} else {
+		    /*
+		    **  Start handling a new multibyte character. - FM
+		    */
+		    utf_buf[0] = c;
+		    utf_buf_p = &utf_buf[1];
+		    if ((c & 0xe0) == 0xc0) {
+			utf_count = 1;
+			utf_char = (c & 0x1f);
+		    } else if ((c & 0xf0) == 0xe0) {
+			utf_count = 2;
+			utf_char = (c & 0x0f);
+		    } else if ((c & 0xf8) == 0xf0) {
+			utf_count = 3;
+			utf_char = (c & 0x07);
+		    } else if ((c & 0xfc) == 0xf8) {
+			utf_count = 4;
+			utf_char = (c & 0x03);
+		    } else if ((c & 0xfe) == 0xfc) {
+			utf_count = 5;
+			utf_char = (c & 0x01);
+		    } else {
+			/*
+			**  We got garbage, even though it should
+			**  have been filtered out by the SGML or
+			**  input stream parser, so we'll ignore
+			**  it. - FM
+			*/
+			utf_count = 0;
+			utf_buf[0] = '\0';
+			utf_buf_p = utf_buf;
+		    }
+		    /*
+		    **  Get the next byte. - FM
+		    */
+		    continue;
+		}
+	    } else if (utf_count > 0) {
+		/*
+		**  Got an ASCII character when expecting
+		**  UTF-8 multibytes, so ignore the buffered
+		**  multibye characters and fall through with
+		**  the current ASCII character. - FM
+		*/
+		utf_count = 0;
+		utf_buf[0] = '\0';
+		utf_buf_p = utf_buf;
+		code = (UCode_t)c_unsign;
+	    } else {
+		/*
+		**  Got a valid ASCII character, so fall
+		**  through with it. - FM
+		*/
+		code = (UCode_t)c_unsign;
+	    }
+	}
+	/*
+	**  Convert characters from non-UTF-8 charsets
+	**  to Unicode (if appropriate). - FM
+	*/
+	if (!(me->T.decode_utf8 &&
+	      (unsigned char)p[i] > 127)) {
+#ifdef NOTDEFINED
+	    if (me->T.strip_raw_char_in)
+		saved_char_in = c;
+#endif /* NOTDEFINED */
+	    if (me->T.trans_to_uni &&
+		(code >= 127 ||
+		 (code < 32 && code != 0 &&
+		  me->T.trans_C0_to_uni))) {
+		/*
+		**  Convert the octet to Unicode. - FM
+		*/
+		code = (UCode_t)UCTransToUni(c, me->inUCLYhndl);
+		if (code > 0) {
+		    saved_char_in = c;
+		    if (code < 256) {
+			c = ((char)(code & 0xff));
+			c_unsign = (unsigned char)c;
+		    }
+		}
+	    } else if (code < 32 && code != 0 &&
+		       me->T.trans_C0_to_uni) {
+		/*
+		**  Quote from SGML.c:
+		**  	"This else if may be too ugly to keep. - KW"
+		*/
+		if (me->T.trans_from_uni &&
+		    (((code = UCTransToUni(c, me->inUCLYhndl)) >= 32) ||
+		     (me->T.transp &&
+		      (code = UCTransToUni(c, me->inUCLYhndl)) > 0))) {
+		    saved_char_in = c;
+		    if (code < 256) {
+			c = ((char)(code & 0xff));
+			c_unsign = (unsigned char)c;
+		    }
+		} else {
+		    uck = -1;
+		    if (me->T.transp) {
+			uck = UCTransCharStr(replace_buf, 60, c,
+					     me->inUCLYhndl,
+					     me->inUCLYhndl, NO);
+		    }
+		    if (!me->T.transp || uck < 0) {
+			uck = UCTransCharStr(replace_buf, 60, c,
+					     me->inUCLYhndl,
+					     me->outUCLYhndl, YES);
+		    }
+		    if (uck == 0) {
+			continue;
+		    } else if (uck < 0) {
+			utf_buf[0] = '\0';
+			code = (unsigned char)c;
+		    } else {
+			c = replace_buf[0];
+			if (c && replace_buf[1]) {
+			    HTChunkPuts(s, replace_buf);
+			    continue;
+			}
+		    }
+		    utf_buf[0] = '\0';
+		    code = (unsigned char)c;
+		} /*  Next line end of ugly stuff for C0. - KW */
+	    } else {
+		utf_buf[0] = '\0';
+		code = (unsigned char)c;
+	    }
+	}
+	/*
+	**  Ignore low ISO 646 7-bit control characters
+	**  if they sneeked through (should have been
+	**  filtered by the parser). - FM
+	*/
+	if (code < 32 &&
+	    c != 9 && c != 10 && c != 13) {
+	    continue;
+	}
+	/*
+	**  Ignore 127 if we don't have HTPassHighCtrlRaw
+	**  and it sneeked through (should have been
+	**  filtered by the parser). - FM
+	*/
+	if (c == 127 &&
+	    !(me->T.transp ||
+	      code >= LYlowest_eightbit[me->inUCLYhndl])) {
+	    continue;
+	}
+	/*
+	**  Ignore 8-bit control characters 128 - 159 if we don't
+	**  have HTPassHighCtrlRaw set and they sneeked through
+	**  (should have been filtered by the parser). - FM
+	*/
+	if (code > 127 && code < 160 &&
+	    !(me->T.transp ||
+	      code >= LYlowest_eightbit[me->inUCLYhndl])) {
+	    continue;
+	}
+	/*
+	**  For 160 (nbsp), substitute Lynx special character
+	**  (or a space if plain_space or hidden is set) if
+	**  HTPassHighCtrlRaw is not set. - FM
+	*/
+        if (code == 160) {
+	    if (!me->T.pass_160_173_raw) {
+		if (plain_space || hidden) {
+		    HTChunkPutc(s, ' ');
+		} else {
+		    HTChunkPutc(s, HT_NON_BREAK_SPACE);
+		}
+	    } else if (!me->T.output_utf8) {
+		HTChunkPutc(s, ((char)(code & 0xff)));
+	    } else if (me->T.decode_utf8 && *utf_buf) {
+		HTChunkPuts(s, utf_buf);
+		utf_buf[0] == '\0';
+		utf_buf_p = utf_buf;
+	    } else {
+		HTChunkPutUtf8Char(s, code);
+	    }
+	    continue;
+	}
+	/*
+	**  For 173 (shy), substitute Lynx special character
+	**  (or skip it if plain_space or hidden is set) if
+	**  HTPassHighCtrlRaw is not set. - FM
+	*/
+        if (code == 173) {
+	    if (!me->T.pass_160_173_raw) {
+		if (!(plain_space || hidden)) {
+		    HTChunkPutc(s, LY_SOFT_HYPHEN);
+		}
+	    } else if (!me->T.output_utf8) {
+		HTChunkPutc(s, ((char)(code & 0xff)));
+	    } else if (me->T.decode_utf8 && *utf_buf) {
+		HTChunkPuts(s, utf_buf);
+		utf_buf[0] == '\0';
+		utf_buf_p = utf_buf;
+	    } else {
+		HTChunkPutUtf8Char(s, code);
+	    }
+	    continue;
+	}
+	/*
+	**  For 8194 (ensp), 8195 (emsp), or 8201 (thinsp), use
+	**  an ASCII space (32) if plain_space or hidden is TRUE,
+	**  otherwise use the Lynx special character. - FM
+	*/
+	if (code == 8194 || code == 8195 || code == 8201) {
+	    if (plain_space || hidden) {
+		HTChunkPutc(s, ' ');
+	    } else {
+		HTChunkPutc(s, HT_EM_SPACE);
+	    }
+	    if (me->T.decode_utf8 && *utf_buf) {
+		utf_buf[0] == '\0';
+		utf_buf_p = utf_buf;
+	    }
+	    continue;
+	}
+	/*
+	**  For 8211 (ndash) or 8212 (mdash), use an ASCII dash. - FM
+	*/
+	if (code == 8211 || code == 8212) {
+	    HTChunkPutc(s, '-');
+	    if (me->T.decode_utf8 && *utf_buf) {
+		utf_buf[0] == '\0';
+		utf_buf_p = utf_buf;
+	    }
+	    continue;
+	}
+	/*
+	**  If we want the raw character, pass it now. - FM
+	*/
+	if (me->T.use_raw_char_in && saved_char_in) {
+	    HTChunkPutc(s, saved_char_in);
+	    continue;
+	}
+	/*
+	**  Seek a translation from the chartrans tables.
+	*/
+	if ((chk = (me->T.trans_from_uni && code >= 160)) &&
+	    (uck = UCTransUniChar(code, me->outUCLYhndl)) >= 32 &&
+	    uck < 256 &&
+	    (uck < 127 ||
+	     uck >= LYlowest_eightbit[me->outUCLYhndl])) {
+	    if (uck == 160 && me->outUCLYhndl == 0) {
+		/*
+		**  Would only happen if some other Unicode
+		**  is mapped to Latin-1 160.
+		*/
+		if (!(hidden ||
+		      me->T.pass_160_173_raw)) {
+		    if (plain_space) {
+			HTChunkPutc(s, ' ');
+		    } else {
+			HTChunkPutc(s, HT_NON_BREAK_SPACE);
+		    }
+		} else {
+		    HTChunkPutc(s, ((char)(uck & 0xff)));
+		}
+		continue;
+	    } else if (uck == 173 && me->outUCLYhndl == 0) {
+		/*
+		**  Would only happen if some other Unicode
+		**  is mapped to Latin-1 173.
+		*/
+		if (!(hidden ||
+		      me->T.pass_160_173_raw)) {
+		    if (!plain_space) {
+			HTChunkPutc(s, LY_SOFT_HYPHEN);
+		    }
+		} else {
+		    HTChunkPutc(s, ((char)(uck & 0xff)));
+		}
+		continue;
+	    }
+	    HTChunkPutc(s, ((char)(uck & 0xff)));
+	    continue;
+	} else if (chk &&
+		   (uck == -4 ||
+		    (me->T.repl_translated_C0 &&
+		     uck > 0 && uck < 32)) &&
+		   /*
+		   **  Not found; look for replacement string.
+		   */
+		   (uck = UCTransUniCharStr(replace_buf,
+					    60, code,
+					    me->outUCLYhndl,
+					    0) >= 0)) { 
+	    /*
+	    **  Got a replacement string.
+	    */
+	    HTChunkPuts(s, replace_buf);
+	    continue;
+    	}
+	/*
+	**  If we want raw UTF-8, output that now. - FM
+	*/
+	if (me->T.output_utf8 &&
+	    code > 127 && code <= 0x7fffffffL) {
+	    if (me->T.decode_utf8 && *utf_buf) {
+		HTChunkPuts(s, utf_buf);
+		utf_buf[0] == '\0';
+		utf_buf_p = utf_buf;
+	    } else {
+		HTChunkPutUtf8Char(s, code);
+	    }
+	    continue;
+	}
+	/*
+	**  If it's 8482 (trade), or is any other (> 160) 8-bit
+	**  chararcter and we have not set HTPassEightBitRaw
+	**  nor have the "ISO Latin 1" character set selected,
+	**  back translate for our character set. - FM
+	*/
+	if ((code == 8482) ||
+	    (code > 160 && code < 256 &&
+	     me->outUCLYhndl != 0 &&
+	     (!(HTPassEightBitRaw ||
+	        (me->T.do_8bitraw && !me->T.trans_from_uni))))) {
+	    if (code == 8482) {
+	        name = "trade";
+	    } else {
+		value = (code - 160);
+		name = HTMLGetEntityName(value);
+	    }
+	    for (low = 0, high = HTML_dtd.number_of_entities;
+		 high > low;
+		 diff < 0 ? (low = j+1) : (high = j)) {
+		/*
+		**  Binary search.
+		*/
+		j = (low + (high-low)/2);
+		diff = strcmp(HTML_dtd.entity_names[j], name);
+		if (diff == 0) {
+		    HTChunkPuts(s, LYCharSets[me->outUCLYhndl][j]);
+		    break;
+		}
+	    }
+	    if (diff == 0) {
+		continue;
+	    }
+	}
+	/*
+	**  If it's ASCII at this point, use it. - FM
+	*/
+	if (code < 127 && code > 0) {
+	    HTChunkPutc(s, ((char)(code & 0xff)));
+	    continue;
+	}
+	/*
+	**  At this point, if we should have translated, the
+	**  translation has failed.  We should have sent UTF-8
+	**  output to the parser already, but what the heck,
+	**  try again. - FM
+	*/
+	if (me->T.output_utf8 && *utf_buf) {
+	    HTChunkPuts(s, utf_buf);
+	    utf_buf[0] == '\0';
+	    utf_buf_p = utf_buf;
+	    continue;
+	}
+#ifdef NOTDEFINED
+	/*
+	**  Check for a strippable koi8-r 8-bit character. - FM
+	*/
+	if (me->T.strip_raw_char_in &&
+	    (unsigned char)saved_char_in >= 192 &&
+	    (unsigned char)saved_char_in < 255 &&
+	    saved_char_in) {
+	    /*
+	    **  KOI8 special: strip high bit, gives (somewhat) readable
+	    **  ASCII or KOI7 - it was constructed that way! - KW
+	    */
+	    HTChunkPutc(s, (saved_char_in & 0x7f));
+	    continue;
+	}
+#endif /* NOTDEFINED */
+	/*
+	**  Ignore 8204 (zwnj), 8205 (zwj)
+	**  8206 (lrm), and 8207 (rlm),
+	**  if we get to here. - FM
+	*/
+	if (code == 8204 || code == 8205 ||
+	    code == 8206 || code == 8207) {
+	    if (TRACE) {
+		fprintf(stderr,
+			"LYExpandString: Ignoring '%ld'.\n", code);
+	    }
+	    if (me->T.decode_utf8 && *utf_buf) {
+		utf_buf[0] == '\0';
+		utf_buf_p = utf_buf;
+	    }
+	    continue;
+	}
+	/*
+	**  If we don't actually want the character,
+	**  make it safe and output that now. - FM
+	*/
+	if ((c_unsign > 0 &&
+	     c_unsign < LYlowest_eightbit[me->outUCLYhndl]) ||
+	    (me->T.trans_from_uni && !HTPassEightBitRaw)) {
+	    /*
+	    **  If we do not have the "7-bit approximations" as our
+	    **  output character set (in which case we did it already)
+	    **  seek a translation for that.  Otherwise, or if the
+	    **  translation fails, use UHHH notation. - FM
+	    */
+	    if ((chk = (me->outUCLYhndl !=
+			UCGetLYhndl_byMIME("us-ascii"))) &&
+		(uck = UCTransUniChar(code,
+				      UCGetLYhndl_byMIME("us-ascii")))
+				      >= 32 && uck < 127) {
+		/*
+		**  Got an ASCII character (yippey). - FM
+		*/
+		c = ((char)(uck & 0xff));
+		HTChunkPutc(s, c);
+		continue;
+	    } else if ((uck == -4) &&
+		       (uck = UCTransUniCharStr(replace_buf,
+						60, code,
+						UCGetLYhndl_byMIME("us-ascii"),
+						0) >= 0)) {
+		/*
+		**  Got a repacement string (yippey). - FM
+		*/
+		HTChunkPuts(s, replace_buf);
+		continue;
+	    } else {
+		/*
+		**  Out of luck, so use the UHHH notation (ugh). - FM
+		*/
+		sprintf(replace_buf, "U%.2lX", code);
+		HTChunkPuts(s, replace_buf);
+		continue;
+	    }
+	}
+	/*
+	**  If we get to here and have a monobyte character,
+	**  pass it. - FM
+	*/
+	if (c_unsign > 0 && c_unsign < 256) {
+	    HTChunkPutc(s, c);
+	}
+    }
+
+    /*
+    **  Terminate the expanded string,
+    **  replace the original, and free
+    **  the chunk. - FM
+    */
+    HTChunkTerminate(s);
+    StrAllocCopy(*str, s->data);
+    HTChunkFree(s);
+}
+#endif
 
 /*
 ** Get UCS character code for one character from UTF-8 encoded string.
@@ -1042,7 +1650,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
     enum _state
 	{ S_text, S_esc, S_dollar, S_paren, S_nonascii_text, S_dollar_paren,
 	S_trans_byte, S_check_ent, S_ncr, S_check_uni, S_named, S_check_name,
-	S_check_name_trad, S_recover,
+	S_recover,
 	S_got_oututf8, S_got_outstring, S_put_urlstring,
 	S_got_outchar, S_put_urlchar, S_next_char, S_done} state = S_text;
     enum _parsing_what
@@ -1082,7 +1690,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	do_ent = FALSE;
 
     /* Can't do, caller should figure out what to do... */
-    if (UCCanTranslateFromTo(cs_from, cs_to) == TQ_NO) {
+    if (!UCCanTranslateFromTo(cs_from, cs_to)) {
 	if (cs_to < 0)
 	    return NULL;
 	if (!do_ent && no_bytetrans)
@@ -1116,21 +1724,8 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
     **	Create a buffer string seven times the length of the original,
     **	so we have plenty of room for expansions. - FM
     */
-#ifdef OLDSTUFF
-    len = (strlen(p) * 7) + 1;
-    if (len < 16)
-	len = 16;
-    if ((Str = (char *)calloc(1, len)) == NULL) {
-	fprintf(stderr,
-		"LYUCFullyTranslateString_1: calloc(1, %lu) failed for '%s'\r\n",
-		(unsigned long)len, *str);
-	outofmem(__FILE__, "LYUCFullyTranslateString_1");
-    }
-    q = Str;
-#else
     len = strlen(p) + 16;
     q = p;
-#endif /* OLDSTUFF */
 
     qs = q;
 
@@ -1651,7 +2246,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 		    } else {
 			name = HTMLGetEntityName(code - 160);
 		    }
-		    state = S_check_name_trad;
+		    state = S_check_name;
 		    break;
 		}
 
@@ -1705,127 +2300,9 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	    state = S_check_name;
 	    break;
 
-	case S_check_name_trad:
-	    /*
-	     *	Check for an entity name in the traditional (LYCharSets.c)
-	     *	table.
-	     */
-	    for (low = 0, high = HTML_dtd.number_of_entities;
-		 high > low;
-		 diff < 0 ? (low = i+1) : (high = i)) {
-		/*
-		**  Binary search.
-		*/
-		i = (low + (high-low)/2);
-		diff = strcmp(entities[i], name);
-		if (diff == 0) {
-		    strncpy(replace_buf,
-			    (cs_to >= 0 && LYCharSets[cs_to]) ?
-			    LYCharSets[cs_to][i] : LYCharSets[0][i],
-			    sizeof(replace_buf));
-		    replace_buf[sizeof(replace_buf) - 1] = '\0';
-		    /*
-		    **	Found the entity.  If the length
-		    **	of the value exceeds the length of
-		    **	replace_buf it is cut off.
-		    */
-		    state = S_got_outstring;
-		    break;
-		}
-	    }
-	    if (diff == 0) {
-		break;
-	    }
-	    /*
-	    **	Entity name lookup failed (diff != 0).
-	    **	Recover and continue.
-	    */
-	    state = S_recover;
-	    break;
-
 	case S_check_name:
 	    /*
-	     *	Check for a name that was really given as a named
-	     *	entity. - kw
-	     */
-	    if (hidden) {
-		/*
-		**  If it's hidden, use 160 for nbsp. - FM
-		*/
-		if (!strcmp("nbsp", name) ||
-		    (replace_buf[1] == '\0' &&
-		     replace_buf[0] == HT_NON_BREAK_SPACE)) {
-		    replace_buf[0] = 160;
-		    replace_buf[1] = '\0';
-		    state = S_got_outstring;
-		    break;
-		    /*
-		    **	If it's hidden, use 173 for shy. - FM
-		    */
-		} else if (!strcmp("shy", name) ||
-			   (replace_buf[1] == '\0' &&
-			    replace_buf[0] == LY_SOFT_HYPHEN)) {
-		    replace_buf[0] = 173;
-		    replace_buf[1] = '\0';
-		    state = S_got_outstring;
-		    break;
-		}
-		/*
-		**  Check whether we want a plain space for nbsp,
-		**  ensp, emsp or thinsp. - FM
-		*/
-	    } else if (plain_space) {
-		if (!strcmp("nbsp", name) ||
-		    !strcmp("emsp", name) ||
-		    !strcmp("ensp", name) ||
-		    !strcmp("thinsp", name) ||
-		    (replace_buf[1] == '\0' &&
-		     replace_buf[0] == HT_EM_SPACE)) {
-		    code = ' ';
-		    state = S_got_outchar;
-		    break;
-		    /*
-		    **	If plain_space is set, ignore shy. - FM
-		    */
-		} else if (!strcmp("shy", name) ||
-			   (replace_buf[1] == '\0' &&
-			    replace_buf[0] == LY_SOFT_HYPHEN)) {
-		    replace_buf[0] = '\0';
-		    state = S_got_outstring;
-		    break;
-		}
-	    }
-	    /*
-	    **	Not recognized specially, look up in extra entities table.
-	    */
-	    for (low = 0, high = HTML_dtd.number_of_extra_entities;
-		 high > low;
-		 diff < 0 ? (low = i+1) : (high = i)) {
-		/*
-		**  Binary search.
-		*/
-		i = (low + (high - low)/2);
-		diff = strcmp(extra_entities[i].name, p);
-		if (diff == 0) {
-		    /*
-		    **	Found the entity.
-		    */
-		    code = extra_entities[i].code;
-		    if (code <= 0x7fffffffL && code > 0) {
-			state = S_check_uni;
-		    } else {
-			state = S_recover;
-		    }
-		    break;
-		}
-	    }
-	    if (diff == 0)
-		break;
-
-	    /*
-	    **	Seek the Unicode value for the entity.
-	    **	This could possibly replace all the rest of
-	    **	`case S_check_name'. - kw
+	    **	Seek the Unicode value for the named entity.
 	    */
 	    if ((code = HTMLGetEntityUCValue(name)) > 0) {
 		state = S_check_uni;
@@ -1835,7 +2312,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	    **	Didn't find the entity.
 	    **	Check the traditional tables.
 	    */
-	    state = S_check_name_trad;
+	    state = S_recover;
 	    break;
 
 				/* * * O U T P U T   S T A T E S * * */
@@ -1924,1214 +2401,6 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	}
     }
 
-#if 0
-    while (*p) {
-	if ((HTCJK != NOCJK && !hidden) || stype != st_HTML) {
-	    /*
-	    **	Handle CJK escape sequences, based on patch
-	    **	from Takuya ASADA (asada@three-a.co.jp). - FM
-	    */
-	    switch(state) {
-		case S_text:
-		    if (*p == '\033') {
-			state = S_esc;
-			if (stype == st_URL) {
-			    *q++ = '%'; *q++ = '1'; *q++ = 'B';
-			    p++;
-			} else {
-			    *q++ = *p++;
-			}
-			continue;
-		    }
-		    break;
-
-		case S_esc:
-		    if (*p == '$') {
-			state = S_dollar;
-			*q++ = *p++;
-			continue;
-		    } else if (*p == '(') {
-			state = S_paren;
-			*q++ = *p++;
-			continue;
-		    } else {
-			state = S_text;
-		    }
-
-		case S_dollar:
-		    if (*p == '@' || *p == 'B' || *p == 'A') {
-			state = S_nonascii_text;
-			*q++ = *p++;
-			continue;
-		    } else if (*p == '(') {
-			state = S_dollar_paren;
-			*q++ = *p++;
-			continue;
-		    } else {
-			state = S_text;
-		    }
-		    break;
-
-		case S_dollar_paren:
-		    if (*p == 'C') {
-			state = S_nonascii_text;
-			*q++ = *p++;
-			continue;
-		    } else {
-			state = S_text;
-		    }
-		    break;
-
-		case S_paren:
-		    if (*p == 'B' || *p == 'J' || *p == 'T')  {
-			state = S_text;
-			*q++ = *p++;
-			continue;
-		    } else if (*p == 'I') {
-			state = S_nonascii_text;
-			*q++ = *p++;
-			continue;
-		    } else {
-			state = S_text;
-		    }
-		    break;
-
-		case S_nonascii_text:
-		    if (*p == '\033') {
-			state = S_esc;
-			if (stype == st_URL) {
-			    *q++ = '%'; *q++ = '1'; *q++ = 'B';
-			    p++;
-			    continue;
-			}
-		    }
-		    *q++ = *p++;
-		    continue;
-
-	    }
-	} else if (*p == '\033' &&
-		   !hidden) {
-	    /*
-	    **	CJK handling not on, and not a hidden INPUT,
-	    **	so block escape. - FM
-	    */
-	    p++;
-	    continue;
-	}
-
-	code = *p;
-	/*
-	**  Check for a numeric or named entity. - FM
-	*/
-	if (*p == '&') {
-	    BOOL isHex = FALSE;
-	    BOOL isDecimal = FALSE;
-	    p++;
-	    len = strlen(p);
-	    /*
-	    **	Check for a numeric entity. - FM
-	    */
-	    if (*p == '#' && len > 2 &&
-		TOLOWER((unsigned char)*(p+1)) == 'x' &&
-		(unsigned char)*(p+2) < 127 &&
-		isxdigit((unsigned char)*(p+2))) {
-		isHex = TRUE;
-	    } else if (*p == '#' && len > 2 &&
-		       (unsigned char)*(p+1) < 127 &&
-		       isdigit((unsigned char)*(p+1))) {
-		isDecimal = TRUE;
-	    }
-	    if (isHex || isDecimal) {
-		if (isHex) {
-		    p += 2;
-		    cp = p;
-		} else {
-		    cp = ++p;
-		}
-		while (*p && (unsigned char)*p < 127 &&
-		       (isHex ? isxdigit((unsigned char)*p) :
-				isdigit((unsigned char)*p))) {
-		    p++;
-		}
-		/*
-		**  Save the terminator and isolate the digit(s). - FM
-		*/
-		cpe = *p;
-		if (*p)
-		    *p++ = '\0';
-		/*
-		** Show the numeric entity if the value:
-		**  (1) Is greater than 255 and unhandled Unicode.
-		**  (2) Is less than 32, and not valid and we don't
-		**	have HTCJK set.
-		**  (3) Is 127 and we don't have HTPassHighCtrlRaw
-		**	or HTCJK set.
-		**  (4) Is 128 - 159 and we don't have HTPassHighCtrlNum set.
-		*/
-		if (((isHex ? sscanf(cp, "%lx", &lcode) :
-			      sscanf(cp, "%ld", &lcode)) != 1) ||
-		    lcode > 0x7fffffffL || lcode < 0 ||
-		    ((code =lcode) < 32 &&
-		     code != 9 && code != 10 && code != 13 &&
-		     HTCJK == NOCJK) ||
-		    (code == 127 &&
-		     !(HTPassHighCtrlRaw || HTCJK != NOCJK)) ||
-		    (code > 127 && code < 160 &&
-		     !HTPassHighCtrlNum)) {
-		    /*
-		    **	Illegal or not yet handled value.
-		    **	Recover the "&#" and continue
-		    **	from there. - FM
-		    */
-		    *q++ = '&';
-		    *q++ = '#';
-		    if (isHex)
-			*q++ = 'x';
-		    if (cpe != '\0')
-			*(p-1) = cpe;
-		    p = cp;
-		    continue;
-		}
-		/*
-		**  Convert the value as an unsigned char,
-		**  hex escaped if isURL is set and it's
-		**  8-bit, and then recycle the terminator
-		**  if it is not a semicolon. - FM
-		*/
-		if (code > 159 && stype == st_URL) {
-		    int e;
-		    if (LYCharSet_UC[cs_to].enc == UCT_ENC_UTF8) {
-			UCPutUtf8ToBuffer(replace_buf, code, YES);
-			esc = HTEscape(replace_buf, URL_XALPHAS);
-		    } else {
-			buf[0] = code;
-			esc = HTEscape(buf, URL_XALPHAS);
-		    }
-		    for (e = 0; esc[e]; e++)
-			*q++ = esc[e];
-		    FREE(esc);
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		}
-		    /*
-		    **	For 160 (nbsp), use that value if it's
-		    **	a hidden INPUT, otherwise use an ASCII
-		    **	space (32) if plain_space is TRUE,
-		    **	otherwise use the Lynx special character. - FM
-		    */
-		if (code == 160) {
-		    if (hidden) {
-			*q++ = 160;
-		    } else if (plain_space) {
-			*q++ = ' ';
-		    } else {
-			*q++ = HT_NON_BREAK_SPACE;
-		    }
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		}
-		    if ((code == 1) ||
-			(code > 129 && code < 156)) {
-			/*
-			**  Assume these are MicroSoft code points,
-			**  inflicted on us by FrontPage. - FM
-			*/
-			switch (code) {
-			    case 1:
-				/*
-				**  WHITE SMILING FACE
-				*/
-				code = 0x263a;
-				break;
-			    case 130:
-				/*
-				**  SINGLE LOW-9 QUOTATION MARK (sbquo)
-				*/
-				code = 0x201a;
-				break;
-			    case 132:
-				/*
-				**  DOUBLE LOW-9 QUOTATION MARK (bdquo)
-				*/
-				code = 0x201e;
-				break;
-			    case 133:
-				/*
-				**  HORIZONTAL ELLIPSIS (hellip)
-				*/
-				code = 0x2026;
-				break;
-			    case 134:
-				/*
-				**  DAGGER (dagger)
-				*/
-				code = 0x2020;
-				break;
-			    case 135:
-				/*
-				**  DOUBLE DAGGER (Dagger)
-				*/
-				code = 0x2021;
-				break;
-			    case 137:
-				/*
-				**  PER MILLE SIGN (permil)
-				*/
-				code = 0x2030;
-				break;
-			    case 139:
-				/*
-				**  SINGLE LEFT-POINTING ANGLE QUOTATION MARK
-				**  (lsaquo)
-				*/
-				code = 0x2039;
-				break;
-			    case 145:
-				/*
-				**  LEFT SINGLE QUOTATION MARK (lsquo)
-				*/
-				code = 0x2018;
-				break;
-			    case 146:
-				/*
-				**  RIGHT SINGLE QUOTATION MARK (rsquo)
-				*/
-				code = 0x2019;
-				break;
-			    case 147:
-				/*
-				**  LEFT DOUBLE QUOTATION MARK (ldquo)
-				*/
-				code = 0x201c;
-				break;
-			    case 148:
-				/*
-				**  RIGHT DOUBLE QUOTATION MARK (rdquo)
-				*/
-				code = 0x201d;
-				break;
-			    case 149:
-				/*
-				**  BULLET (bull)
-				*/
-				code = 0x2022;
-				break;
-			    case 150:
-				/*
-				**  EN DASH (ndash)
-				*/
-				code = 0x2013;
-				break;
-			    case 151:
-				/*
-				**  EM DASH (mdash)
-				*/
-				code = 0x2014;
-				break;
-			    case 152:
-				/*
-				**  SMALL TILDE (tilde)
-				*/
-				code = 0x02dc;
-				break;
-			    case 153:
-				/*
-				**  TRADE MARK SIGN (trade)
-				*/
-				code = 0x2122;
-				break;
-			    case 155:
-				/*
-				**  SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
-				**  (rsaquo)
-				*/
-				code = 0x203a;
-				break;
-			    default:
-				/*
-				**  Do not attempt a conversion
-				**  to valid Unicode values.
-				*/
-				break;
-			}
-		    }
-		/*
-		    **	For 173 (shy), use that value if it's
-		    **	a hidden INPUT, otherwise ignore it
-		    **	if plain_space is TRUE, otherwise use
-		    **	the Lynx special character. - FM
-		    */
-		if (code == 173) {
-		    if (hidden) {
-			*q++ = 173;
-		    } else if (plain_space) {
-			;
-		    } else {
-			*q++ = LY_SOFT_HYPHEN;
-		    }
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		}
-		    /*
-		    **	For 8211 (ndash or endash), and 8212
-		    **	(mdash or emdash), use an ASCII hyphen
-		    **	('-'). - FM
-		    */
-		    if (code == 8211 ||
-			code == 8212) {
-			HTChunkPutc(s, '-');
-			if (cpe != ';' && cpe != '\0') {
-			    p--;
-			    *p = cpe;
-			}
-			continue;
-		    }
-		/*
-		**  Seek a translation from the chartrans tables.
-		*/
-		if ((uck = UCTransUniChar(code,
-					  cs_to)) >= 32 &&
-		    uck < 256 &&
-		    (uck < 127 || uck >= lowest_8)) {
-		    if (uck == 160 && cs_to == 0) {
-			/*
-			**  Would only happen if some other unicode
-			**  is mapped to Latin-1 160.
-			    */
-			if (hidden) {
-			    *q++ = 160;
-			} else if (plain_space) {
-			    *q++ = ' ';
-			} else {
-			    *q++ = HT_NON_BREAK_SPACE;
-			}
-			if (cpe != ';' && cpe != '\0') {
-			    p--;
-			    *p = cpe;
-			}
-			continue;
-		    } else if (uck == 173 && cs_to == 0) {
-			/*
-			    **	Would only happen if some other unicode
-			    **	is mapped to Latin-1 173.
-			    */
-			if (hidden) {
-			    *q++ = 173;
-			} else if (plain_space) {
-			    ;
-			} else {
-			    *q++ = LY_SOFT_HYPHEN;
-			}
-			if (cpe != ';' && cpe != '\0') {
-			    p--;
-			    *p = cpe;
-			}
-			continue;
-		    } else {
-			*q++ = (char)uck;
-		    }
-		} else if ((uck == -4 ||
-			    (repl_translated_C0 &&
-			     uck > 0 && uck < 32)) &&
-			   /*
-			       **  Not found; look for replacement string.
-			       */
-			   (uck = UCTransUniCharStr(replace_buf,
-						    60, code,
-						    current_char_set,
-						    0) >= 0)) {
-		    for (i = 0; replace_buf[i]; i++) {
-			*q++ = replace_buf[i];
-		    }
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		} else if (output_utf8 &&
-			   code > 127 && code < 0x7fffffffL) {
-		    UCPutUtf8ToBuffer(q, code, NO);
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		/*
-		**  For 8482 (trade) use the character reference if it's
-		**  a hidden INPUT, otherwise use whatever the tables have
-		**  for &trade;. - FM & KW
-		*/
-		} else if (code == 8482 && hidden) {
-			*q++ = '&';
-			*q++ = '#';
-			if (isHex)
-			    *q++ = 'x';
-			if (cpe != '\0')
-			    *(p-1) = cpe;
-			p = cp;
-			continue;
-		/*
-		**  For 8194 (ensp), 8195 (emsp), or 8201 (thinsp),
-		**  use the character reference if it's a hidden INPUT,
-		**  otherwise use an ASCII space (32) if plain_space is
-		**  TRUE, otherwise use the Lynx special character. - FM
-		*/
-		} else if (code == 8194 || code == 8195 || code == 8201) {
-		    if (hidden) {
-			*q++ = '&';
-			*q++ = '#';
-			if (isHex)
-			    *q++ = 'x';
-			if (cpe != '\0')
-			    *(p-1) = cpe;
-			p = cp;
-			continue;
-		    } else if (plain_space) {
-			*q++ = ' ';
-		    } else {
-			*q++ = HT_EM_SPACE;
-		    }
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		    /*
-		    **	For 8211 (ndash) or 8212 (mdash), use the character
-		    **	reference if it's a hidden INPUT, otherwise use an
-		    **	ASCII dash. - FM
-		    */
-		} else if (code == 8211 || code == 8212) {
-		    if (hidden) {
-			*q++ = '&';
-			*q++ = '#';
-			if (isHex)
-			    *q++ = 'x';
-			if (cpe != '\0')
-			    *(p-1) = cpe;
-			p = cp;
-			continue;
-		    } else {
-			*q++ = '-';
-		    }
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		    /*
-		    **	Ignore (8204) zwnj, if we get to here. - FM
-		    */
-		} else if (code == 8204) {
-			if (TRACE) {
-			    fprintf(stderr,
-				    "LYUnEscapeEntities: Ignoring '%s%s;'.\n",
-				    (isHex ? "&#x" : "&#"),
-				    cp);
-			}
-			if (cpe != ';' && cpe != '\0') {
-			    p--;
-			    *p = cpe;
-			}
-			continue;
-		    } else
-		    /*
-		    **	Ignore 8205 (zwj),
-		    **	8206 (lrm), and 8207 (rln), if we get to here. - FM
-		    */
-		    if (code == 8205 ||
-			code == 8206 ||
-			code == 8207) {
-			if (TRACE) {
-			    fprintf(stderr,
-				    "LYUnEscapeEntities: Ignoring '%s%s'.\n",
-				    (isHex ? "&#x" : "&#"),
-				    cp);
-			}
-			if (cpe != ';' && cpe != '\0') {
-			    p--;
-			    *p = cpe;
-			}
-			continue;
-		    /*
-		    **	Show the numeric entity if the value:
-		    **	(1) Is greater than 255 and unhandled Unicode.
-		    */
-		} else if (code > 255 && code != 8482) {
-		    /*
-			**  Illegal or not yet handled value.
-			**  Recover the "&#" and continue
-			**  from there. - FM
-			*/
-		    *q++ = '&';
-		    *q++ = '#';
-		    if (isHex)
-			*q++ = 'x';
-		    if (cpe != '\0')
-			*(p-1) = cpe;
-		    p = cp;
-		    continue;
-		/*
-		**  If it's ASCII, or is 8-bit but HTPassEightBitNum
-		**  is set or the character set is "ISO Latin 1",
-		**  use it's value. - FM
-		*/
-		} else if (code < 161 ||
-			   (code < 256 &&
-			    (HTPassEightBitNum ||
-			     !strncmp(LYchar_set_names[current_char_set],
-				      "ISO Latin 1", 11)))) {
-		    /*
-		    **	No conversion needed.
-		    */
-		    *q++ = (unsigned char)code;
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		    /*
-		    **	If we get to here, convert and handle
-		    **	the character as a named entity. - FM
-		    */
-		} else {
-		    if (code == 8482) {
-			/*
-			**  Trade mark sign falls through to here. - KW
-			*/
-			name = "trade";
-		    } else {
-			code -= 160;
-			name = HTMLGetEntityName(code);
-		    }
-		    for (low = 0, high = HTML_dtd.number_of_entities;
-			 high > low;
-			 diff < 0 ? (low = i+1) : (high = i)) {
-			/*
-			**  Binary search.
-			*/
-			i = (low + (high-low)/2);
-			diff = strcmp(entities[i], name);
-			if (diff == 0) {
-			    /*
-			    **	Found the entity.
-			    */
-			    int j;
-			    for (j = 0; p_entity_values[i][j]; j++)
-				*q++ = (unsigned char)(p_entity_values[i][j]);
-			    break;
-			}
-		    }
-			/*
-			**  No point in repeating for extra entities. - kw
-			*/
-		    if (diff != 0) {
-			/*
-			**  Didn't find the entity.
-			**  Recover the "&#" and continue
-			**  from there. - FM
-			*/
-			*q++ = '&';
-			*q++ = '#';
-			if (isHex)
-			    *q++ = 'x';
-			if (cpe != '\0')
-			    *(p-1) = cpe;
-			p = cp;
-			continue;
-		    }
-		    /*
-		    **	Recycle the terminator if it isn't the
-		    **	standard ';' for HTML. - FM
-		    */
-		    if (cpe != ';' && cpe != '\0') {
-			p--;
-			*p = cpe;
-		    }
-		    continue;
-		}
-
-	    /*
-	    **	Check for a named entity. - FM
-	    */
-	    } else if ((unsigned char)*p < 127 &&
-		       isalnum((unsigned char)*p)) {
-		cp = p;
-		while (*cp && (unsigned char)*cp < 127 &&
-		       isalnum((unsigned char)*cp))
-		    cp++;
-		cpe = *cp;
-		*cp = '\0';
-
-		/*
-		**  For 160 (nbsp), use an ASCII space (32) if
-		**  plain_space or hidden is TRUE, otherwise use
-		**  the Lynx special character. - FM
-		*/
-		if (!strcmp(p, "nbsp")) {
-		    if (hidden || plain_space) {
-			HTChunkPutc(s, ' ');
-		    } else {
-			HTChunkPutc(s, HT_NON_BREAK_SPACE);
-		    }
-		    *cp = cpe;
-		    if (*cp != ';')
-			p = cp;
-		    else
-			p = (cp+1);
-		    continue;
-		}
-		/*
-		**  For 173 (shy), skip it if plain_space or hidden is
-		**  TRUE, otherwise use the Lynx special character. - FM
-		*/
-		if (!strcmp(p, "shy")) {
-		    if (!(plain_space || hidden)) {
-			HTChunkPutc(s, LY_SOFT_HYPHEN);
-		    }
-		    *cp = cpe;
-		    if (*cp != ';')
-			p = cp;
-		    else
-			p = (cp+1);
-		    continue;
-		}
-		/*
-		**  For 8194 (ensp), 8195 (emsp), and 8201
-		**  (thinsp), use an ASCII space (32) if
-		**  hidden or plain_space is TRUE, otherwise
-		**  use the Lynx special character. - FM
-		*/
-		if (!strcmp(p, "ensp") || !strcmp(p, "emsp") ||
-		    !strcmp(p, "thinsp")) {
-		    if (hidden || plain_space) {
-			HTChunkPutc(s, ' ');
-		    } else {
-			HTChunkPutc(s, HT_EM_SPACE);
-		    }
-		    *cp = cpe;
-		    if (*cp != ';')
-			p = cp;
-		    else
-			p = (cp+1);
-		    continue;
-		}
-		/*
-		**  For 8211 (ndash or endash), and 8212
-		**  (mdash or emdash), use an ASCII space
-		**  (32). - FM
-		*/
-		if (!strcmp(p, "ndash") ||
-		    !strcmp(p, "endash") ||
-		    !strcmp(p, "mdash") ||
-		    !strcmp(p, "emdash")) {
-		    HTChunkPutc(s, '-');
-		    *cp = cpe;
-		    if (*cp != ';')
-			p = cp;
-		    else
-			p = (cp+1);
-		    continue;
-		}
-		for (low = 0, high = HTML_dtd.number_of_entities;
-		     high > low ;
-		     diff < 0 ? (low = i+1) : (high = i)) {
-		    /*
-		    **	Binary search.
-		    */
-		    i = (low + (high-low)/2);
-		    diff = strcmp(entities[i], p);
-		    if (diff == 0) {
-			/*
-			**  Found the entity.  Assume that the length
-			**  of the value does not exceed the length of
-			**  the raw entity, so that the overall string
-			**  does not need to grow.  Make sure this stays
-			**  true in the LYCharSets arrays. - FM
-			*/
-			int j;
-			/*
-			**  Found the entity. Convert it to
-			**  an ISO-8859-1 character, or our
-			**  substitute for any non-ISO-8859-1
-			**  character, hex escaped if isURL
-			**  is set and it's 8-bit. - FM
-			*/
-			if (stype != st_HTML) {
-			    int e;
-			    buf[0] = HTMLGetLatinOneValue(i);
-			    if (buf[0] == '\0') {
-				/*
-				**  The entity does not have an 8859-1
-				**  representation of exactly one char length.
-				**  Try to deal with it anyway - either HTEscape
-				**  the whole mess, or pass through raw.  So
-				**  make sure the ISO_Latin1 table, which is the
-				**  first table in LYCharSets, has reasonable
-				**  substitution strings! (if it really must
-				**  have any longer than one char) - KW
-				*/
-				if (!LYCharSets[0][i][0]) {
-				    /*
-				    **	Totally empty, skip. - KW
-				    */
-				    ; /* do nothing */
-				} else if (stype == st_URL) {
-				    /*
-				    **	All will be HTEscape'd. - KW
-				    */
-				    esc = HTEscape(LYCharSets[0][i], URL_XALPHAS);
-				    for (e = 0; esc[e]; e++)
-					*q++ = esc[e];
-				    FREE(esc);
-				} else {
-				    /*
-				    **	Nothing will be HTEscape'd. - KW
-				    */
-				    for (e = 0; LYCharSets[0][i][e]; e++) {
-					*q++ =
-					    (unsigned char)(LYCharSets[0][i][e]);
-				    }
-				}
-			    } else if ((unsigned char)buf[0] > 159 &&
-				       stype == st_URL) {
-				if (LYCharSet_UC[cs_to].enc == UCT_ENC_UTF8) {
-				    UCPutUtf8ToBuffer(replace_buf, code, YES);
-				    esc = HTEscape(replace_buf, URL_XALPHAS);
-				} else {
-				    buf[0] = code;
-				    esc = HTEscape(buf, URL_XALPHAS);
-				}
-				for (e = 0; esc[e]; e++)
-				    *q++ = esc[e];
-				FREE(esc);
-			    } else {
-				*q++ = buf[0];
-			    }
-			/*
-			**  If it's hidden, use 160 for nbsp. - FM
-			*/
-			} else if (hidden &&
-			    !strcmp("nbsp", entities[i])) {
-			    *q++ = 160;
-			/*
-			**  If it's hidden, use 173 for shy. - FM
-			*/
-			} else if (hidden &&
-				   !strcmp("shy", entities[i])) {
-			    *q++ = 173;
-			/*
-			**  Check whether we want a plain space for nbsp,
-			**  ensp, emsp or thinsp. - FM
-			*/
-			} else if (plain_space &&
-				   (!strcmp("nbsp", entities[i]) ||
-				    !strcmp("emsp", entities[i]) ||
-				    !strcmp("ensp", entities[i]) ||
-				    !strcmp("thinsp", entities[i]))) {
-			    *q++ = ' ';
-			/*
-			**  If plain_space is set, ignore shy. - FM
-			*/
-			} else if (plain_space &&
-				   !strcmp("shy", entities[i])) {
-			    ;
-			/*
-			**  If we haven't used something else, use the
-			**  the translated value or string. - FM
-			*/
-			} else {
-			    for (j = 0; p_entity_values[i][j]; j++) {
-				*q++ = (unsigned char)(p_entity_values[i][j]);
-			    }
-			}
-			/*
-			**  Recycle the terminator if it isn't the
-			**  standard ';' for HTML. - FM
-			*/
-			*cp = cpe;
-			if (*cp != ';')
-			    p = cp;
-			else
-			    p = (cp+1);
-			break;
-		    }
-		}
-		if (diff != 0) {
-		    /*
-		    **	Not found, repeat for extra entities. - FM
-		    */
-		    for (low = 0, high = HTML_dtd.number_of_extra_entities;
-			 high > low;
-			 diff < 0 ? (low = i+1) : (high = i)) {
-			/*
-			**  Binary search.
-			*/
-			i = (low + (high - low)/2);
-			diff = strcmp(extra_entities[i].name, p);
-			if (diff == 0) {
-			    /*
-			    **	Found the entity.
-			    */
-			    code = extra_entities[i].code;
-			    if ((stype == st_URL && code > 127) ||
-				(stype == st_other &&
-				 (code > 255 ||
-				  LYCharSet_UC[cs_to].enc == UCT_ENC_UTF8))) {
-				int e;
-				if (stype == st_URL) {
-				    if (LYCharSet_UC[cs_to].enc == UCT_ENC_UTF8 ||
-					code > 255) {
-					UCPutUtf8ToBuffer(replace_buf, code, YES);
-					esc = HTEscape(replace_buf, URL_XALPHAS);
-				    } else {
-					buf[0] = code;
-					esc = HTEscape(buf, URL_XALPHAS);
-				    }
-				    for (e = 0; esc[e]; e++)
-					*q++ = esc[e];
-				    FREE(esc);
-				} else if (LYCharSet_UC[cs_to].enc == UCT_ENC_UTF8 ||
-					   code > 255) {
-				    UCPutUtf8ToBuffer(q, code, NO);
-				} else {
-				    *q++ = buf[0];
-				}
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-				/*
-				**  If it's hidden, use 160 for nbsp. - FM
-				*/
-			    }
-			    if (code == 160) {
-				/*
-				**  nbsp.
-				*/
-				if (hidden) {
-				    *q++ = 160;
-				} else if (plain_space) {
-				    *q++ = ' ';
-				} else {
-				    *q++ = HT_NON_BREAK_SPACE;
-				}
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    } else if (code == 173) {
-				/*
-				**  shy.
-				*/
-				if (hidden) {
-				    *q++ = 173;
-				} else if (plain_space) {
-				    ;
-				} else {
-				    *q++ = LY_SOFT_HYPHEN;
-				}
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    } else if (code == 8194 ||
-				       code == 8195 ||
-				       code == 8201) {
-				/*
-				**  ensp, emsp or thinsp.
-				*/
-				if (hidden) {
-				    *q++ = '&';
-				    *cp = cpe;
-				    break;
-				} else if (plain_space) {
-				    *q++ = ' ';
-				} else {
-				    *q++ = HT_EM_SPACE;
-				}
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    } else if (code == 8211 ||
-				       code == 8212) {
-				/*
-				**  ndash or mdash.
-				*/
-				if (hidden) {
-				    *q++ = '&';
-				    *cp = cpe;
-				    break;
-				} else {
-				    *q++ = '-';
-				}
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    } else if (output_utf8 &&
-				       code > 127 &&
-				       code < 0x7fffffffL) {
-				UCPutUtf8ToBuffer(q, code, NO);
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    }
-		    if ((chk && uck == -4) &&
-			(uck = UCTransUniCharStr(replace_buf,
-						 60, code,
-					      UCGetLYhndl_byMIME("us-ascii"),
-						 0) >= 0)) {
-			/*
-			**  Got a replacement string (yippey). - FM
-			*/
-			HTChunkPuts(s, replace_buf);
-			*cp = cpe;
-			if (*cp != ';')
-			    p = cp;
-			else
-			    p = (cp+1);
-			continue;
-		    }
-		    /*
-		    **	Ignore (8204) zwnj, if we get to here. - FM
-		    */
-		    if (!strcmp(p, "zwnj")) {
-			if (TRACE) {
-			    fprintf(stderr,
-				    "LYUnEscapeEntities: Ignoring '%s'.\n",
-				    p);
-			}
-			*cp = cpe;
-			if (*cp != ';')
-			    p = cp;
-			else
-			    p = (cp+1);
-			continue;
-		    }
-		    /*
-		    **	Ignore 8205 (zwj),
-		    **	8206 (lrm), and 8207 (rln), if we get to here. - FM
-		    */
-		    if (!strcmp(p, "zwj") ||
-			!strcmp(p, "lrm") ||
-			!strcmp(p, "rlm")) {
-			if (TRACE) {
-			    fprintf(stderr,
-				    "LYUnEscapeEntities: Ignoring '%s'.\n",
-				    p);
-			}
-			*cp = cpe;
-			if (*cp != ';')
-			    p = cp;
-			else
-			    p = (cp+1);
-			continue;
-		    }
-			    /*
-			    **	Seek a translation from the chartrans tables.
-			    */
-			    if (((uck = UCTransUniChar(code,
-						current_char_set)) >= 32 ||
-				 uck == 9 || uck == 10 || uck == 13) &&
-				 uck < 256 &&
-				 (uck < 127 ||
-				  uck >= lowest_8)) {
-				if (uck == 160 && current_char_set == 0) {
-				    /*
-				    **	Would only happen if some other unicode
-				    **	is mapped to Latin-1 160.
-				    */
-				    if (hidden) {
-					*q++ = 160;
-				    } else if (plain_space) {
-					*q++ = ' ';
-				    } else {
-					*q++ = HT_NON_BREAK_SPACE;
-				    }
-				    /*
-				    **	Recycle the terminator if it isn't the
-				    **	standard ';' for HTML. - FM
-				    */
-				    *cp = cpe;
-				    if (*cp != ';')
-					p = cp;
-				    else
-					p = (cp+1);
-				    break;
-				} else if (uck == 173 &&
-					   current_char_set == 0) {
-				    /*
-				    **	Would only happen if some other unicode
-				    **	is mapped to Latin-1 173.
-				    */
-				    if (hidden) {
-					*q++ = 173;
-				    } else if (plain_space) {
-					;
-				    } else {
-					*q++ = LY_SOFT_HYPHEN;
-				    }
-				    /*
-				    **	Recycle the terminator if it isn't the
-				    **	standard ';' for HTML. - FM
-				    */
-				    *cp = cpe;
-				    if (*cp != ';')
-					p = cp;
-				    else
-					p = (cp+1);
-				    break;
-				} else if (!hidden && uck == 10 &&
-					   q != Str && *(q-1) == 13) {
-				    /*
-				    **	If this is not a hidden string, and we
-				    **	have an encoded encoded LF (&#10) of a
-				    **	CRLF pair, drop the CR. - kw
-				    */
-				    *(q-1) = (char)uck;
-				} else {
-				    *q++ = (char)uck;
-				}
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    } else if ((uck == -4 ||
-					(repl_translated_C0 &&
-					 uck > 0 && uck < 32)) &&
-				       /*
-				       **  Not found.  Look for
-				       **  replacement string.
-				       */
-				       (uck =
-					    UCTransUniCharStr(replace_buf,
-							      60,
-							      code,
-							    current_char_set,
-							       0) >= 0)) {
-				for (i = 0; replace_buf[i]; i++) {
-				    *q++ = replace_buf[i];
-				}
-				/*
-				**  Recycle the terminator if it isn't the
-				**  standard ';' for HTML. - FM
-				*/
-				*cp = cpe;
-				if (*cp != ';')
-				    p = cp;
-				else
-				    p = (cp+1);
-				break;
-			    }
-			    *cp = cpe;
-			    *q++ = '&';
-			    break;
-			}
-		    }
-		}
-		*cp = cpe;
-		if (diff != 0) {
-		    /*
-		    **	Entity not found.  Add the '&' and
-		    **	continue processing from there. - FM
-		    */
-		    *q++ = '&';
-		}
-		continue;
-	    /*
-	    **	If we get to here, it's a raw ampersand. - FM
-	    */
-	    } else {
-		*q++ = '&';
-		continue;
-	    }
-	/*
-	**  Not an entity.  Check whether we want nbsp, ensp,
-	**  emsp (if translated elsewhere) or 160 converted to
-	**  a plain space. - FM
-	*/
-	} else {
-	    if ((plain_space) &&
-		(*p == HT_NON_BREAK_SPACE || *p == HT_EM_SPACE ||
-		 (((unsigned char)*p) == 160 &&
-		  !(hidden ||
-		    HTPassHighCtrlRaw || HTPassHighCtrlNum ||
-		    HTCJK != NOCJK)))) {
-		*q++ = ' ';
-		p++;
-	    } else if (stype == st_URL &&
-		       (code >= 127 ||
-			(code < 32 && (code != 9 && code != 10)))) {
-		*q++ = '%';
-		*q++ = hex[(code >> 4) & 15];
-		*q++ = hex[(code & 15)];
-		p++;
-		/*
-		**  If it's hidden, use 160 for nbsp. - FM
-		*/
-	    } else if (!hidden && *p == 10 && q != Str && *(q-1) == 13) {
-		/*
-		**  If this is not a hidden string, and the current char is
-		**  the LF ('\n') of a CRLF pair, drop the CR ('\r'). - KW
-		*/
-		*(q-1) = *p++;
-	    } else {
-		*q++ = *p++;
-	    }
-	}
-    }
-#endif /* 0 */
-
     *q = '\0';
     if (chunk) {
 	HTChunkPutb(CHUNK, qs, q-qs + 1); /* also terminates */
@@ -3153,243 +2422,6 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 #undef REPLACE_CHAR
 #undef REPLACE_STRING
 
-#ifdef OLDSTUFF
-
-/*
-**  This is a generalized version of what was previously LYExpandString.
-**
-**  This function translates a string from charset
-**  cs_from to charset cs_to, reallocating it if necessary.
-**
-**  If use_lynx_specials is YES, translate 160 and 173
-**  (U+00A0 and U+00AD) to HT_NON_BREAK_SPACE and
-**  LY_SOFT_HYPHEN, respectively (unless input and output
-**  charset are both iso-8859-1, for compatibility with
-**  usage in HTML.c).
-**
-**  Returns YES if string translated or translation
-**		unnecessary,
-**	    NO otherwise.
-**
-*/
-#define REPLACE_STRING(s) \
-		p[i] = '\0'; \
-		StrAllocCat(*str, q); \
-		StrAllocCat(*str, s); \
-		q = (puni > p+i ? puni+1 : &p[i+1])
-
-#define REPLACE_CHAR(c) if (puni > &p[i]) { \
-		p[i] = c; \
-		p[i+1] = '\0'; \
-		StrAllocCat(*str, q); \
-		q = puni + 1; \
-	    } else \
-		p[i] = c
-
-/*
- *  Back: try 'backward' translation
- *  PlainText: only used with Back (?)
- */
-PRIVATE BOOL LYUCTranslateString ARGS7(
-	char **, str,
-	int,	cs_from,
-	int,	cs_to,
-	BOOL,	use_lynx_specials,
-	BOOLEAN,	PlainText,
-	BOOL,	Back,
-	CharUtil_st,	stype)	/* stype unused */
-{
-    char *p = *str;
-    char *q = *str;
-    CONST char *name;
-    char replace_buf[21];
-    UCode_t unsign_c, uck;
-    UCTransParams T;
-    BOOL from_is_utf8, done;
-    char * puni;
-    int i, j, value, high, low, diff = 0;
-
-    /*
-    **	Don't do anything if we have no string,
-    **	or if original AND target character sets
-    **	are both iso-8859-1,
-    **	or if we are in CJK mode.
-    */
-    if (!p || *p == '\0' ||
-	(cs_to == 0 && cs_from == cs_to) ||
-	HTCJK != NOCJK)
-	return YES;
-
-    /* No need to translate or examine the string any further */
-    else if (!use_lynx_specials && !Back &&
-	     UCNeedNotTranslate(cs_from, cs_to))
-	return YES;
-
-    /* Can't do, caller should figure out what to do... */
-    else if (UCCanTranslateFromTo(cs_from, cs_to) == TQ_NO)
-	return NO;
-    /*
-    **	Start a clean copy of the string, without
-    **	invalidating our pointer to the original. - FM
-    */
-    *str = NULL;
-    StrAllocCopy(*str, "");
-
-    UCTransParams_clear(&T);
-    UCSetTransParams(&T, cs_from, &LYCharSet_UC[cs_from],
-		     cs_to, &LYCharSet_UC[cs_to]);
-    from_is_utf8 = (LYCharSet_UC[cs_from].enc == UCT_ENC_UTF8);
-    puni = p;
-    /*
-    **	Check each character in the original string,
-    **	and add the characters or substitutions to
-    **	our clean copy. - FM
-    */
-    for (i = 0; p[i]; i++) {
-	unsign_c = (unsigned char)p[i];
-	done = NO;
-	if (Back) {
-	    int rev_c;
-	    if (p[i] == HT_NON_BREAK_SPACE ||
-		p[i] == HT_EM_SPACE) {
-		if (PlainText) {
-		    unsign_c = p[i] = ' ';
-		    done = YES;
-		} else {
-		    p[i] = 160;
-		    unsign_c = 160;
-		    if (LYCharSet_UC[cs_to].enc == UCT_ENC_8859 ||
-			(LYCharSet_UC[cs_to].like8859 & UCT_R_8859SPECL)) {
-			done = YES;
-		    }
-		}
-	    } else if (p[i] == LY_SOFT_HYPHEN) {
-		p[i] = 173;
-		unsign_c = 173;
-		if (LYCharSet_UC[cs_to].enc == UCT_ENC_8859 ||
-		    (LYCharSet_UC[cs_to].like8859 & UCT_R_8859SPECL)) {
-		    done = YES;
-		}
-	    } else if (unsign_c < 127 || T.transp) {
-		done = YES;
-	    }
-	    if (!done) {
-		rev_c = UCReverseTransChar(p[i], cs_to, cs_from);
-		if (rev_c > 127) {
-		    p[i] = rev_c;
-		    done = YES;
-		}
-	    }
-	} else if (unsign_c < 127)
-	    done = YES;
-
-	if (!done) {
-	    if (from_is_utf8) {
-		if ((p[i]&0xc0)==0xc0) {
-		    puni = p+i;
-		    unsign_c = UCGetUniFromUtf8String(&puni);
-		    if (unsign_c <= 0) {
-			unsign_c = (unsigned char)p[i];
-			puni = p+i;
-		    }
-		}
-	    } else if (use_lynx_specials && !Back &&
-		       (unsign_c == 160 || unsign_c == 173) &&
-		       (LYCharSet_UC[cs_from].enc == UCT_ENC_8859 ||
-			(LYCharSet_UC[cs_from].like8859 & UCT_R_8859SPECL))) {
-		if (unsign_c == 160)
-		    p[i] = HT_NON_BREAK_SPACE;
-		else if (unsign_c == 173)
-		    p[i] = LY_SOFT_HYPHEN;
-		done = YES;
-	    } else if (T.trans_to_uni) {
-		unsign_c = UCTransToUni(p[i], cs_from);
-		if (unsign_c <= 0) {
-		    /* What else can we do? */
-		    unsign_c = (unsigned char)p[i];
-		}
-#ifdef NOTUSED_FOTEMODS
-	    } else if (T.strip_raw_char_in &&
-		       (unsigned char)p[i] >= 0xc0 &&
-		       (unsigned char)p[i] < 255) {
-		REPLACE_CHAR((p[i] & 0x7f));
-		done = YES;
-#endif /* NOTUSED_FOTEMODS */
-	    } else if (!T.trans_from_uni) {
-		done = YES;
-	    }
-	    /*
-	    **	Substitute Lynx special character for
-	    **	160 (nbsp) if use_lynx_specials is set.
-	    */
-	    if (!done && use_lynx_specials && !Back &&
-		(unsign_c == 160 || unsign_c == 173)) {
-		REPLACE_CHAR((unsign_c==160 ? HT_NON_BREAK_SPACE : LY_SOFT_HYPHEN));
-		done = YES;
-	    }
-	}
-	/* At this point we should have the UCS value in unsign_c */
-	if (!done) {
-	    if (T.output_utf8 && UCPutUtf8ToBuffer(replace_buf, unsign_c, YES)) {
-		REPLACE_STRING(replace_buf);
-	    } else if ((uck = UCTransUniChar(unsign_c, cs_to)) >= 32 &&
-		uck < 256) {
-		REPLACE_CHAR((char)uck) ;
-	    } else if (uck == UCTRANS_NOTFOUND &&
-			(uck = UCTransUniCharStr(replace_buf,21, unsign_c,
-						 cs_to, 0)) >= 0) {
-		REPLACE_STRING(replace_buf);
-	    }
-	    /*
-	    ** fall through to old method:
-	    **
-	    **	Substitute other 8-bit characters based on
-	    **	the LYCharsets.c tables if HTPassEightBitRaw
-	    **	is not set. - FM
-	    */
-	    else if (unsign_c > 160 && unsign_c <= 255 &&
-		     !HTPassEightBitRaw) {
-		value = (int)(unsign_c - 160);
-		name = HTMLGetEntityName(value);
-		for (low = 0, high = HTML_dtd.number_of_entities;
-		     high > low;
-		     diff < 0 ? (low = j+1) : (high = j)) {
-		    /* Binary search */
-		    j = (low + (high-low)/2);
-		    diff = strcmp(HTML_dtd.entity_names[j], name);
-		    if (diff == 0) {
-			REPLACE_STRING(LYCharSets[cs_to][j]);
-			break;
-		    }
-		}
-		if (diff != 0) {
-		    sprintf(replace_buf, "U%.2lX", unsign_c);
-		    REPLACE_STRING(replace_buf);
-		}
-	    } else if (unsign_c > 255) {
-#ifdef NOTUSED_FOTEMODS
-		if (T.strip_raw_char_in &&
-		    (unsigned char)p[i] >= 0xc0 &&
-		    (unsigned char)p[i] < 255) {
-		    REPLACE_CHAR((p[i] & 0x7f));
-		} else
-#endif /* NOTUSED_FOTEMODS */
-		{
-		    sprintf(replace_buf, "U%.2lX", unsign_c);
-		    REPLACE_STRING(replace_buf);
-		}
-	    }
-	}
-	if ((puni-p) > i)
-	    i = (puni-p);	/* point to last byte of UTF sequence */
-    }
-    StrAllocCat(*str, q);
-    free_and_clear(&p);
-    return YES;
-}
-
-#endif /* OLDSTUFF */
-
 PUBLIC BOOL LYUCFullyTranslateString ARGS7(
 	char **, str,
 	int,	cs_from,
@@ -3401,13 +2433,6 @@ PUBLIC BOOL LYUCFullyTranslateString ARGS7(
 {
     BOOL ret = YES;
     /* May reallocate *str even if cs_to == 0 */
-#ifdef OLDSTUFF
-    if (!LYUCTranslateString(str, cs_from, cs_to, use_lynx_specials, FALSE, NO, stype)) {
-	LYExpandString_old(str);
-	ret = NO;
-    }
-#endif
-
     if (!LYUCFullyTranslateString_1(str, cs_from, cs_to, TRUE,
 				    use_lynx_specials, plain_space, hidden,
 				    NO, stype)) {
@@ -3424,14 +2449,10 @@ PUBLIC BOOL LYUCTranslateBackFormData ARGS4(
 {
     char ** ret;
     /* May reallocate *str */
-#ifdef OLDSTUFF
-    return (LYUCTranslateString(str, cs_from, cs_to, NO, plain_space, YES, st_HTML));
-#else
     ret = (LYUCFullyTranslateString_1(str, cs_from, cs_to, FALSE,
 				       NO, plain_space, YES,
 				       YES, st_HTML));
     return (ret != NULL);
-#endif
 }
 
 /*
@@ -3656,6 +2677,7 @@ PUBLIC void LYHandleMETA ARGS4(
 	    cp1 += 7;
 	    while (*cp1 == ' ' || *cp1 == '=' || *cp1 == '"')
 		cp1++;
+
 	    StrAllocCopy(cp3, cp1); /* copy to mutilate more */
 	    for (cp4 = cp3; (*cp4 != '\0' && *cp4 != '"' &&
 			     *cp4 != ';'  && *cp4 != ':' &&
@@ -3665,7 +2687,7 @@ PUBLIC void LYHandleMETA ARGS4(
 	    *cp4 = '\0';
 	    cp4 = cp3;
 	    chndl = UCGetLYhndl_byMIME(cp3);
-	    if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
+	    if (UCCanTranslateFromTo(chndl, current_char_set)) {
 		chartrans_ok = YES;
 		StrAllocCopy(me->node_anchor->charset, cp4);
 		HTAnchor_setUCInfoStage(me->node_anchor, chndl,
@@ -3676,7 +2698,7 @@ PUBLIC void LYHandleMETA ARGS4(
 		 *  Got something but we don't recognize it.
 		 */
 		chndl = UCLYhndl_for_unrec;
-		if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
+		if (UCCanTranslateFromTo(chndl, current_char_set)) {
 		    chartrans_ok = YES;
 		    HTAnchor_setUCInfoStage(me->node_anchor, chndl,
 					    UCT_STAGE_PARSER,
@@ -3758,8 +2780,11 @@ PUBLIC void LYHandleMETA ARGS4(
 				"ISO Latin 2", 11)) {
 		StrAllocCopy(me->node_anchor->charset, "iso-8859-2");
 		HTPassEightBitRaw = TRUE;
-
+	    /*
+	     *  Check for an iso-8859-# we don't know. - FM
+	     */
 	    } else if (!strncmp(cp4, "iso-8859-", 9) &&
+		       isdigit(cp4[9]) &&
 		       !strncmp(LYchar_set_names[current_char_set],
 				"Other ISO Latin", 15)) {
 		/*
@@ -4038,7 +3063,6 @@ free_META_copies:
     FREE(content);
 }
 
-#ifdef NOTDEFINED
 /*
 **  This function handles P elements in HTML streams.
 **  If start is TRUE it handles a start tag, and if
@@ -4125,7 +3149,7 @@ PUBLIC void LYHandleP ARGS5(
 		me->sp->style->alignment = HT_LEFT;
 	}
 
-	LYCheckForID(me, present, value, (int)HTML_P_ID);
+	CHECK_ID(HTML_P_ID);
 
 	/*
 	 *  Mark that we are starting a new paragraph
@@ -4137,7 +3161,6 @@ PUBLIC void LYHandleP ARGS5(
 
     return;
 }
-#endif /* NOTDEFINED */
 
 /*
 **  This function handles SELECT elements in HTML streams.
diff --git a/src/LYCharUtils.h b/src/LYCharUtils.h
index 3cf7cb76..0f510b0a 100644
--- a/src/LYCharUtils.h
+++ b/src/LYCharUtils.h
@@ -6,6 +6,8 @@
 #include "HTUtils.h"
 #endif /* HTUTILS_H */
 
+#define CHECK_ID(code) LYCheckForID(me, present, value, (int)code)
+
 typedef enum {
     st_HTML	= 0,	/* attributes and content found in HTML, probably meant for display */
     st_URL,		/* URLs, fragments, NAME and ID */
@@ -54,10 +56,8 @@ extern char *LYUppercaseI_OL_String PARAMS((
 	int			seqnum));
 extern char *LYLowercaseI_OL_String PARAMS((
 	int			seqnum));
-#ifdef HTML_H
 extern void LYGetChartransInfo PARAMS((
 	HTStructured *		me));
-#endif
 extern void add_META_charset_to_fd PARAMS((
 	FILE *			fp,
 	int			disp_chndl));
@@ -66,14 +66,12 @@ extern void LYHandleMETA PARAMS((
 	CONST BOOL*		present,
 	CONST char **		value,
 	char ** 		include));
-#ifdef NOTDEFINED
 extern void LYHandleP PARAMS((
 	HTStructured *		me,
 	CONST BOOL*		present,
 	CONST char **		value,
 	char ** 		include,
 	BOOL			start));
-#endif
 extern void LYHandleSELECT PARAMS((
 	HTStructured *		me,
 	CONST BOOL*		present,
diff --git a/src/LYClean.c b/src/LYClean.c
index ec0f3a8c..424560e6 100644
--- a/src/LYClean.c
+++ b/src/LYClean.c
@@ -57,15 +57,20 @@ PUBLIC void cleanup_sig ARGS1(
 	/*
 	 *  Ask if exit is intended.
 	 */
-	_statusline(REALLY_EXIT);
+	if (LYQuitDefaultYes == TRUE) {
+	    _statusline(REALLY_EXIT_Y);
+	} else {
+	    _statusline(REALLY_EXIT_N);
+	}
 	c = LYgetch();
-#ifdef QUIT_DEFAULT_YES
-	if (TOUPPER(c) == 'N' ||
-	    c == 7)
-#else
-	if (TOUPPER(c) != 'Y')
-#endif /* QUIT_DEFAULT_YES */
+	if (LYQuitDefaultYes == TRUE) {
+	    if (TOUPPER(c) == 'N' ||
+		c == 7) {
+		return;
+	    }
+	} else if (TOUPPER(c) != 'Y') {
 	    return;
+	}
     }
 #endif /* VMS */
 
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 9d5885ff..b23c7662 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -855,7 +855,7 @@ PUBLIC void lynx_enable_mouse ARGS1(int,state)
       button 1 is clicked */
 #ifndef _WINDOWS
    if (state)
-     mousemask(BUTTON1_CLICKED | BUTTON2_CLICKED, NULL);
+     mousemask(BUTTON1_CLICKED | BUTTON3_CLICKED, NULL);
    else
      mousemask(0, NULL);
 #else
@@ -1673,26 +1673,6 @@ PUBLIC void lynx_force_repaint NOARGS
     clearok(curscr, TRUE);
 }
 
-PUBLIC void lynx_start_underline_color NOARGS
-{
-    start_underline ();
-}
-
-PUBLIC void lynx_stop_underline_color NOARGS
-{
-    stop_underline ();
-}
-
-PUBLIC void lynx_start_bold_color NOARGS
-{
-    start_bold ();
-}
-
-PUBLIC void lynx_stop_bold_color NOARGS
-{
-    stop_bold ();
-}
-
 PUBLIC void lynx_start_title_color NOARGS
 {
 }
@@ -1727,7 +1707,7 @@ PUBLIC void lynx_start_link_color ARGS2(
 	 *  will be underlined if appropriate. - LE & FM
 	 */
 	if (pending)
-	    lynx_start_underline_color();
+	    start_underline();
      }
 }
 
@@ -1754,7 +1734,7 @@ PUBLIC void lynx_stop_link_color ARGS2(
 	 *  If underlining was turned on above, turn it off. - LE & FM
 	 */
 	if (pending)
-	    lynx_stop_underline_color();
+	    stop_underline();
     }
 #endif
 }
diff --git a/src/LYCurses.h b/src/LYCurses.h
index 3f685cbc..c25eb0db 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -328,10 +328,6 @@ extern int  lynx_chg_color PARAMS((int, int, int));
 
 extern void lynx_enable_mouse PARAMS((int));
 extern void lynx_force_repaint NOPARAMS;
-extern void lynx_start_underline_color NOPARAMS;
-extern void lynx_stop_underline_color NOPARAMS;
-extern void lynx_start_bold_color NOPARAMS;
-extern void lynx_stop_bold_color NOPARAMS;
 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/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 5ee6fde3..80cba706 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -326,6 +326,8 @@ extern BOOLEAN LYForceSSLCookiesSecure;
 extern BOOLEAN LYNoCc;
 extern BOOLEAN LYPreparsedSource;	/* Show source as preparsed?	 */
 extern BOOLEAN LYPrependBaseToSource;
+extern BOOLEAN LYPrependCharsetToSource;
+extern BOOLEAN LYQuitDefaultYes;
 
 #ifdef RAWDOSKEYHACK
 extern BOOLEAN raw_dos_key_hack; /* Turn on and off DOS key hack */
diff --git a/src/LYMain.c b/src/LYMain.c
index 0037fc8a..1af4cfd4 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -292,13 +292,13 @@ PUBLIC char *LYHostName = NULL;		/* treat as a local host name */
 PUBLIC char *LYLocalDomain = NULL;	/* treat as a local domain tail */
 PUBLIC BOOLEAN clickable_images = MAKE_LINKS_FOR_ALL_IMAGES;
 PUBLIC BOOLEAN pseudo_inline_alts = MAKE_PSEUDO_ALTS_FOR_INLINES;
-PUBLIC BOOLEAN crawl=FALSE;	     /* Do crawl? */
-PUBLIC BOOLEAN traversal=FALSE;     /* Do traversals? */
-PUBLIC BOOLEAN check_realm=FALSE;   /* Restrict to the starting realm? */
+PUBLIC BOOLEAN crawl = FALSE;	     /* Do crawl? */
+PUBLIC BOOLEAN traversal = FALSE;    /* Do traversals? */
+PUBLIC BOOLEAN check_realm = FALSE;  /* Restrict to the starting realm? */
 	       /* Links beyond a displayed page with no links? */
-PUBLIC BOOLEAN more_links=FALSE;
-PUBLIC int     ccount=0;  /* Starting number for lnk#.dat files in crawls */
-PUBLIC BOOLEAN LYCancelledFetch=FALSE; /* TRUE if cancelled binary fetch */
+PUBLIC BOOLEAN more_links = FALSE;
+PUBLIC int     ccount = 0; /* Starting number for lnk#.dat files in crawls */
+PUBLIC BOOLEAN LYCancelledFetch = FALSE; /* TRUE if cancelled binary fetch */
 	       /* Include mime headers with source dump */
 PUBLIC BOOLEAN keep_mime_headers = FALSE;
 PUBLIC BOOLEAN no_url_redirection = FALSE; /* Don't follow URL redirections */
@@ -366,6 +366,8 @@ PUBLIC BOOLEAN LYForceSSLCookiesSecure = FALSE;
 PUBLIC BOOLEAN LYNoCc = FALSE;
 PUBLIC BOOLEAN LYPreparsedSource = FALSE;	/* Show source as preparsed?	 */
 PUBLIC BOOLEAN LYPrependBaseToSource = TRUE;
+PUBLIC BOOLEAN LYPrependCharsetToSource = FALSE;
+PUBLIC BOOLEAN LYQuitDefaultYes = QUIT_DEFAULT_YES;
 
 /* These are declared in cutil.h for current freeWAIS libraries. - FM */
 #ifdef DECLARE_WAIS_LOGFILES
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 925aa7de..9dfd785c 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -2137,16 +2137,23 @@ new_cmd:  /*
 #endif /* NOT_DONE_YET */
 
 	case LYK_QUIT:	/* quit */
-	    _statusline(REALLY_QUIT);
+	    if (LYQuitDefaultYes == TRUE) {
+		_statusline(REALLY_QUIT_Y);
+	    } else {
+		_statusline(REALLY_QUIT_N);
+	    }
 	    c = LYgetch();
-#ifdef QUIT_DEFAULT_YES
-	    if (TOUPPER(c) != 'N' &&
-		c != 7)
-#else
-	    if (TOUPPER(c) == 'Y')
-#endif /* QUIT_DEFAULT_YES */
+	    if (LYQuitDefaultYes == TRUE) {
+		if (TOUPPER(c) != 'N' &&
+		    c != 7) {
+		    return(0);
+		} else {
+		    statusline(NO_CANCEL);
+		    sleep(InfoSecs);
+		}
+	    } else if (TOUPPER(c) == 'Y') {
 		return(0);
-	    else {
+	    } else {
 		statusline(NO_CANCEL);
 		sleep(InfoSecs);
 	    }
diff --git a/src/LYPrint.c b/src/LYPrint.c
index ea87e2a5..c1799a16 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -464,6 +464,39 @@ PUBLIC int printfile ARGS1(
 			    "<!-- X-URL: %s -->\n<BASE HREF=\"%s\">\n",
 			    newdoc->address, content_base);
 		}
+
+		if (LYPrependCharsetToSource && HTisDocumentSource()) {
+		    /*
+		     *	Added the document's charset as a META CHARSET tag
+		     *	to the top of the file.  May create
+		     *	technically invalid HTML, but will help to resolve
+		     *	properly the document converted via chartrans:
+		     *  printed document correspond to a display charset
+		     *  and we *should* override both assume_local_charset
+		     *  and original document's META CHARSET (if any).
+		     *
+		     *  Currently, if several META CHARSET found
+		     *  Lynx use the first only, and it is opposite to BASE
+		     *  where original BASE in the <HEAD>
+		     *  override ones from the top.
+		     *
+		     *  Like in print-to-email we write charset only if
+		     *  the document has 8-bit characters, and
+		     *  we have no CJK or an inofficial "x-" charset.
+		     *
+		     */
+			use_cte = HTLoadedDocumentEightbit();
+			disp_charset = LYCharSet_UC[current_char_set].MIMEname;
+			if (!use_cte || LYHaveCJKCharacterSet ||
+			    strncasecomp(disp_charset, "x-", 2) == 0) {
+			} else {
+			fprintf(outfile_fp,
+				"<META HTTP-EQUIV=\"Content-Type\" "
+				"CONTENT=\"text/html; charset=%s\">\n\n",
+				disp_charset);
+			}
+		}
+
 		print_wwwfile_to_fd(outfile_fp,0);
 		if (keypad_mode)
 		    printlist(outfile_fp,FALSE);
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index efca2346..d8509a00 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1047,6 +1047,9 @@ PUBLIC void read_cfg ARGS1(
 	} else if (!strncasecomp(buffer, "PREPEND_BASE_TO_SOURCE:", 23)) {
 	    LYPrependBaseToSource = is_true(buffer+23);
 
+	} else if (!strncasecomp(buffer, "PREPEND_CHARSET_TO_SOURCE:", 26)) {
+	    LYPrependCharsetToSource = is_true(buffer+26);
+
 	} else if (!strncasecomp(buffer, "PRINTER:", 8)) {
 	    add_printer_to_list(&buffer[8], &printers);
 	}
@@ -1060,6 +1063,12 @@ PUBLIC void read_cfg ARGS1(
 	break;
 #endif /* RAWDOSKEYHACK */
 
+	case 'Q':
+	if (!strncasecomp(buffer, "QUIT_DEFAULT_YES:", 17)) {
+	    LYQuitDefaultYes = is_true(buffer+17);
+	}
+	break;
+
 	case 'S':
 	if (!strncasecomp(buffer, "SAVE_SPACE:", 11)) {
 	    StrAllocCopy(lynx_save_space, buffer+11);
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 90464eb4..99f54b2d 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -664,7 +664,7 @@ re_read:
 	   err=getmouse(&event);
 	   if (event.bstate & BUTTON1_CLICKED) {
 	     c = set_clicked_link(event.x, event.y);
-	   } else if (event.bstate & BUTTON2_CLICKED) {
+	   } else if (event.bstate & BUTTON3_CLICKED) {
 	     c = map_function_to_key (LYK_PREV_DOC);
 	   }
 #else /* pdcurses version */
diff --git a/src/UCAux.c b/src/UCAux.c
index 09fa6833..13685036 100644
--- a/src/UCAux.c
+++ b/src/UCAux.c
@@ -9,43 +9,35 @@
 extern HTCJKlang HTCJK;
 extern LYUCcharset LYCharSet_UC[];
 
-PUBLIC UCTQ_t UCCanUniTranslateFrom ARGS1(
+PUBLIC BOOL UCCanUniTranslateFrom ARGS1(
 	int,		from)
 {
     if (from < 0)
-	return TQ_NO;
+	return NO;
     if (LYCharSet_UC[from].enc == UCT_ENC_7BIT ||
 	LYCharSet_UC[from].enc == UCT_ENC_UTF8)
-	return TQ_EXCELLENT;
+	return YES;
     if (LYCharSet_UC[from].codepoints & (UCT_CP_SUBSETOF_LAT1))
-	return TQ_EXCELLENT;
-    return ((LYCharSet_UC[from].UChndl >= 0) ? TQ_GOOD : TQ_NO);
+	return YES;
+    return (LYCharSet_UC[from].UChndl >= 0);
 }
 
-PUBLIC UCTQ_t UCCanTranslateUniTo ARGS1(
+PUBLIC BOOL UCCanTranslateUniTo ARGS1(
 	int,		to)
 {
     if (to < 0)
-	return TQ_NO;
-    if (LYCharSet_UC[to].enc == UCT_ENC_7BIT)
-	return TQ_POOR;
-    if (LYCharSet_UC[to].enc == UCT_ENC_UTF8)
-	return TQ_EXCELLENT;
-    if (LYCharSet_UC[to].enc == UCT_ENC_CJK)
-	return TQ_POOR;
-    if (LYCharSet_UC[to].UChndl >= 0)
-	return TQ_GOOD;
-    return TQ_GOOD;	/* at least some characters, we don't know more */
+	return NO;
+    return YES;			/* well at least some characters... */
 }
 
-PUBLIC UCTQ_t UCCanTranslateFromTo ARGS2(
+PUBLIC BOOL UCCanTranslateFromTo ARGS2(
 	int,		from,
 	int,		to)
 {
     if (from == to)
-	return TQ_EXCELLENT;
+	return YES;
     if (from < 0 || to < 0)
-	return TQ_NO;
+	return NO;
     if (from == 0)
 	return UCCanTranslateUniTo(to);
     if (to == 0 || LYCharSet_UC[to].enc == UCT_ENC_UTF8)
@@ -55,9 +47,9 @@ PUBLIC UCTQ_t UCCanTranslateFromTo ARGS2(
 	CONST char * toname = LYCharSet_UC[to].MIMEname;
 	if (!strcmp(fromname, "x-transparent") ||
 	    !strcmp(toname, "x-transparent")) {
-	    return TQ_GOOD;
+	    return YES;
 	} else if (!strcmp(fromname, "us-ascii")) {
-	    return TQ_GOOD;
+	    return YES;
 	}
 	if (LYCharSet_UC[from].enc == UCT_ENC_CJK) {
 	    /*
@@ -66,25 +58,25 @@ PUBLIC UCTQ_t UCCanTranslateFromTo ARGS2(
 	    **  be for capability in relation to another document,
 	    **  for which CJK mode might be turned on when retrieved.
 	    **  Thus, when the from charset is CJK, check if the to
-	    **  charset is CJK, and return TQ_NO or TQ_GOOD depending on
+	    **  charset is CJK, and return NO or YES in relation to
 	    **  that. - FM
 	    */
 	    if (LYCharSet_UC[to].enc != UCT_ENC_CJK)
-		return TQ_NO;
+		return NO;
 	    if ((!strcmp(toname, "euc-jp") ||
 		 !strcmp(toname, "shift_jis")) &&
 		(!strcmp(fromname, "euc-jp") ||
 		 !strcmp(fromname, "shift_jis")))
-		return TQ_GOOD;
+		return YES;
 	    /*
 	    **  The euc-cn and euc-kr charsets were handled
 	    **  by the (from == to) above, so we need not
 	    **  check those. - FM
 	    **/
-	    return TQ_NO;
+	    return NO;
 	}
-	return ((LYCharSet_UC[from].UChndl >= 0) ? TQ_GOOD : TQ_NO);
     }
+    return (LYCharSet_UC[from].UChndl >= 0);
 }
 
 /*
@@ -242,7 +234,7 @@ PUBLIC void UCSetTransParams ARGS5(
 	    **  treated as already Unicode here.
 	    */
 	    pT->trans_to_uni = (!intm_ucs &&
-				UCCanUniTranslateFrom(cs_in) != TQ_NO);
+				UCCanUniTranslateFrom(cs_in));
 	    /*
 	    **  We set this if we are translating to Unicode and
 	    **  what normally are low value control characters in
@@ -255,27 +247,11 @@ PUBLIC void UCSetTransParams ARGS5(
 	    **  We set this, presently, for VISCII. - FM
 	    */
 	    pT->repl_translated_C0 = (p_out->enc == UCT_ENC_8BIT_C0);
-#ifdef NOTDEFINED
 	    /*
-	    **  This is a flag for whether we are dealing with koi8-r
-	    **  as the input, and could do 8th-bit stripping for other
-	    **  output charsets.  Note that this always sets 8th-bit
-	    **  stripping if the input charset is KOI8-R and the output
-	    **  charset needs it, i.e., regardless of the RawMode and
-	    **  consequent HTPassEightBitRaw setting, so you can't look
-	    **  at raw koi8-r without selecting that as the display
-	    **  character set (or transparent).  That's just as well,
-	    **  but worth noting for developers - FM
+	    **  Currently unused for any charset combination.
+	    **  Should always be FALSE
 	    */
-	    pT->strip_raw_char_in = ((!intm_ucs ||
-				      (p_out->enc == UCT_ENC_7BIT) ||
-				      (p_out->repertoire &
-				       UCT_REP_SUBSETOF_LAT1)) &&
-				     cs_in != cs_out &&
-				     !strcmp(p_in->MIMEname, "koi8-r"));
-#else
 	    pT->strip_raw_char_in = FALSE;
-#endif /* NOTDEFINED */
 	    /*
 	    **  use_ucs should be set TRUE if we have or will create
 	    **  Unicode values for input octets or UTF multibytes. - FM
@@ -314,7 +290,7 @@ PUBLIC void UCSetTransParams ARGS5(
 	    */
 	    pT->trans_from_uni = (use_ucs && !pT->do_8bitraw &&
 				  !pT->use_raw_char_in &&
-				  UCCanTranslateUniTo(cs_out) != TQ_NO);
+				  UCCanTranslateUniTo(cs_out));
 	}
     }
 }
diff --git a/src/UCdomap.c b/src/UCdomap.c
index 4e6ff500..84ab6ed3 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -28,13 +28,13 @@
 /*
  *  Include tables & parameters.
  */
-#include "cp1250_uni.h"		/* WinLatin2 (cp1250)	*/
-#include "cp1251_uni.h"		/* WinCyrillic (cp1251)	*/
-#include "cp1252_uni.h"		/* WinLatin1 (cp1252)	*/
-#include "cp1253_uni.h"		/* WinGreek (cp1253)	*/
-#include "cp1255_uni.h"		/* WinHebrew (cp1255)	*/
-#include "cp1256_uni.h"		/* WinArabic (cp1256)	*/
-#include "cp1257_uni.h"		/* WinBaltRim (cp1257)	*/
+#include "cp1250_uni.h" 	/* WinLatin2 (cp1250)	*/
+#include "cp1251_uni.h" 	/* WinCyrillic (cp1251) */
+#include "cp1252_uni.h" 	/* WinLatin1 (cp1252)	*/
+#include "cp1253_uni.h" 	/* WinGreek (cp1253)	*/
+#include "cp1255_uni.h" 	/* WinHebrew (cp1255)	*/
+#include "cp1256_uni.h" 	/* WinArabic (cp1256)	*/
+#include "cp1257_uni.h" 	/* WinBaltRim (cp1257)	*/
 #include "cp437_uni.h"		/* DosLatinUS (cp437)	*/
 #include "cp737_uni.h"		/* DosGreek (cp737)	*/
 #include "cp775_uni.h"		/* DosBaltRim (cp775)	*/
@@ -54,15 +54,15 @@
 #include "iso06_uni.h"		/* ISO 8859-6 Arabic	*/
 #include "iso07_uni.h"		/* ISO 8859-7 Greek	*/
 #include "iso08_uni.h"		/* ISO 8859-8 Hebrew	*/
-#include "iso09_uni.h"		/* ISO 8859-9 (Latin 5)	*/
+#include "iso09_uni.h"		/* ISO 8859-9 (Latin 5) */
 #include "iso10_uni.h"		/* ISO 8859-10		*/
 #include "koi8r_uni.h"		/* KOI8-R Cyrillic	*/
 #include "mac_uni.h"		/* Macintosh (8 bit)	*/
-#include "mnem2_suni.h"		/* RFC 1345 Mnemonic	*/
+#include "mnem2_suni.h" 	/* RFC 1345 Mnemonic	*/
 #include "next_uni.h"		/* NeXT character set	*/
 #include "rfc_suni.h"		/* RFC 1345 w/o Intro	*/
 #include "utf8_uni.h"		/* UNICODE UTF 8	*/
-#include "viscii_uni.h"		/* Vietnamese (VISCII)	*/
+#include "viscii_uni.h" 	/* Vietnamese (VISCII)	*/
 #ifdef NOTDEFINED
 #include "mnem_suni.h"
 #endif /* NOTDEFINED */
@@ -342,7 +342,7 @@ PRIVATE void set_inverse_transl ARGS1(
 	glyph = conv_uni_to_pc(p[j], 0);
 	if (glyph >= 0 && glyph < MAX_GLYPH && q[glyph] < 32) {
 	    /*
-	     *  Prefer '-' above SHY etc.
+	     *	Prefer '-' above SHY etc.
 	     */
 	    q[glyph] = j;
 	}
@@ -485,7 +485,7 @@ PRIVATE void UC_con_set_trans ARGS3(
     return;			/* nothing to be done */
   }
     /*
-     *  The font is always 256 characters - so far.
+     *	The font is always 256 characters - so far.
      */
   con_clear_unimap();
 #endif
@@ -500,7 +500,7 @@ PRIVATE void UC_con_set_trans ARGS3(
 	}
     }
     if (update_flag) {
-	set_inverse_transl(Gn);	/* Update inverse translation for this one */
+	set_inverse_transl(Gn); /* Update inverse translation for this one */
     }
 }
 
@@ -603,7 +603,7 @@ PRIVATE int con_insert_unipair ARGS3(
 
 PRIVATE int con_insert_unipair_str ARGS3(
 	u16,		unicode,
-	char *,		replace_str,
+	char *, 	replace_str,
 	int,		fordefault)
 {
     int i, n;
@@ -642,7 +642,7 @@ PRIVATE int con_insert_unipair_str ARGS3(
     return 0;
 }
 
-/* 
+/*
  *  ui arg was a leftover, deleted. - KW
  */
 PRIVATE void con_clear_unimap ARGS1(
@@ -694,7 +694,7 @@ PRIVATE void con_clear_unimap_str ARGS1(int, fordefault)
       unidefault_pagedir_str[i] = NULL;
     }
 
-    unidefault_str_contents_valid = 1;  /* ??? probably no use... */
+    unidefault_str_contents_valid = 1;	/* ??? probably no use... */
   } else {
     for (i = 0; i < 32; i++) {
 	if ((p1 = uni_pagedir_str[i]) != NULL) {
@@ -743,7 +743,7 @@ PRIVATE void con_set_default_unimap NOARGS
     u16 *p;
 
     /*
-     *  The default font is always 256 characters.
+     *	The default font is always 256 characters.
      */
     con_clear_unimap(1);
 
@@ -795,7 +795,7 @@ PRIVATE int UC_con_set_unimap ARGS2(
     UC_current_unitable = p;
 
     /*
-     *  The font is always 256 characters - so far.
+     *	The font is always 256 characters - so far.
      */
     con_clear_unimap(0);
 
@@ -831,7 +831,7 @@ PRIVATE int UC_con_set_unimap_str ARGS3(
     }
 
     /*
-     *  No inverse translations for replacement strings!
+     *	No inverse translations for replacement strings!
      */
     if (!err) {
 	if (fordefault)
@@ -847,7 +847,7 @@ PRIVATE int UC_con_set_unimap_str ARGS3(
 PRIVATE int con_get_unimap ARGS3(
 	u16,			ct,
 	u16 *,			uct,
-	struct unipair *, 	list)
+	struct unipair *,	list)
 {
     int i, j, k, ect;
     u16 **p1, *p2;
@@ -882,9 +882,9 @@ PRIVATE int conv_uni_to_pc ARGS2(
 {
     int h;
     u16 **p1, *p2;
-  
+
     /*
-     *  Only 16-bit codes supported at this time.
+     *	Only 16-bit codes supported at this time.
      */
     if (ucs > 0xffff) {
 	/*
@@ -928,7 +928,7 @@ PRIVATE int conv_uni_to_pc ARGS2(
     }
 
     /*
-     *  Not found.
+     *	Not found.
      */
     return -4;
 }
@@ -946,7 +946,7 @@ PRIVATE int conv_uni_to_str ARGS4(
     char ***p1, **p2;
 
     /*
-     *  Only 16-bit codes supported at this time.
+     *	Only 16-bit codes supported at this time.
      */
     if (ucs > 0xffff) {
 	/*
@@ -954,7 +954,7 @@ PRIVATE int conv_uni_to_str ARGS4(
 	 */
 	ucs = 0xfffd;
     /*
-     *  Maybe the following two cases should be allowed here?? - KW
+     *	Maybe the following two cases should be allowed here?? - KW
      */
     } else if (ucs < 0x20 || ucs >= 0xfffe) {
 	/*
@@ -996,7 +996,7 @@ PRIVATE int conv_uni_to_str ARGS4(
     }
 
     /*
-     *  Not found.
+     *	Not found.
      */
     return -4;
 }
@@ -1070,7 +1070,7 @@ PUBLIC int UCTransUniChar ARGS2(
  *  Returns string length, or negative value for error.
  */
 PUBLIC int UCTransUniCharStr ARGS5(
-	char *,		outbuf,
+	char *, 	outbuf,
 	int,		buflen,
 	long,		unicode,
 	int,		charset_out,
@@ -1369,7 +1369,7 @@ PUBLIC int UCReverseTransChar ARGS3(
  *  Returns string length, or negative value for error.
  */
 PUBLIC int UCTransCharStr ARGS6(
-	char *,		outbuf,
+	char *, 	outbuf,
 	int,		buflen,
 	char,		ch_in,
 	int,		charset_in,
@@ -1533,7 +1533,7 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 	if (!strcmp(UC_MIMEcharset, "unicode-1-1-utf-8") ||
 	    !strcmp(UC_MIMEcharset, "utf8")) {
 	    /*
-	     *  Treat these as synonyms for the IANA registered name. - FM
+	     *	Treat these as synonyms for the IANA registered name. - FM
 	     */
 	    return UCGetLYhndl_byMIME("utf-8");
 	}
@@ -1570,8 +1570,8 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 	    !strcmp(UC_MIMEcharset, "ibm1252") ||
 	    !strcmp(UC_MIMEcharset, "iso-8859-1-windows-3.0-latin-1")) {
 	    /*
-	     *  Treat these as synonyms for windows-1252, which is more
-	     *  commonly used than the IANA registered name. - FM
+	     *	Treat these as synonyms for windows-1252, which is more
+	     *	commonly used than the IANA registered name. - FM
 	     */
 	    return UCGetLYhndl_byMIME("windows-1252");
 	}
@@ -1580,7 +1580,7 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 	    !strcmp(UC_MIMEcharset, "cp-1250") ||
 	    !strcmp(UC_MIMEcharset, "ibm1250")) {
 	    /*
-	     *  Treat these as synonyms for windows-1250. - FM
+	     *	Treat these as synonyms for windows-1250. - FM
 	     */
 	    return UCGetLYhndl_byMIME("windows-1250");
 	}
@@ -1590,8 +1590,8 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 	    isdigit((unsigned char)UC_MIMEcharset[4]) &&
 	    isdigit((unsigned char)UC_MIMEcharset[5])) {
 	    /*
-	     *  For "ibmNNN<...>" or "cp-NNN", try "cpNNN<...>"
-	     *  if not yet found. - KW & FM
+	     *	For "ibmNNN<...>" or "cp-NNN", try "cpNNN<...>"
+	     *	if not yet found. - KW & FM
 	     */
 	    char * cptmp = NULL;
 
@@ -1603,7 +1603,7 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 		return LYhndl;
 	    }
 	    /*
-	     *  Try windows-NNN<...> if not yet found. - FM
+	     *	Try windows-NNN<...> if not yet found. - FM
 	     */
 	    StrAllocCopy(cptmp, "windows-");
 	    StrAllocCat(cptmp, (UC_MIMEcharset + 3));
@@ -1616,7 +1616,7 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 	    isdigit((unsigned char)UC_MIMEcharset[9]) &&
 	    isdigit((unsigned char)UC_MIMEcharset[10])) {
 	    /*
-	     *  For "windows-NNN<...>", try "cpNNN<...>" - FM
+	     *	For "windows-NNN<...>", try "cpNNN<...>" - FM
 	     */
 	    char * cptmp = NULL;
 
@@ -1631,7 +1631,7 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
 	  return UCGetLYhndl_byMIME("koi8-r");
   }
     }
-  return LYhndl;        /* returns -1 if no charset found by that MIME name */
+  return LYhndl;	/* returns -1 if no charset found by that MIME name */
 }
 
 /*
@@ -1641,7 +1641,7 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1(
  *  any more), but it works (as far as it goes..).
  *
  *  We try to be conservative and only allocate new memory for this
- *  if needed.  If not needed, just point to SevenBitApproximations[i].
+ *  if needed.	If not needed, just point to SevenBitApproximations[i].
  *  [Could do the same for ISO_Latin1[] if it's identical to that, but
  *   would make it even *more* messy than it already is...]
  *  This the only function in this file that knows, or cares, about the
@@ -1692,7 +1692,7 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
     u8 *ti;
 
     /*
-     *  Create a temporary table for reverse lookup of latin1 codes:
+     *	Create a temporary table for reverse lookup of latin1 codes:
      */
     tp = (char **)malloc(96 * sizeof(char *));
     if (!tp)
@@ -1710,9 +1710,9 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
     pp = UCInfo[UC_charset_in_hndl].unitable;
 
     /*
-     *  Determine if we have any mapping of a Unicode in the range 160-255
-     *  to an allowed code point > 0x80 in our new charset...
-     *  Store any mappings found in ti[].
+     *	Determine if we have any mapping of a Unicode in the range 160-255
+     *	to an allowed code point > 0x80 in our new charset...
+     *	Store any mappings found in ti[].
      */
     if (UCInfo[UC_charset_in_hndl].num_uni > 0) {
 	for (i = 0; i < 256; i++) {
@@ -1745,9 +1745,9 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
 	}
     }
     /*
-     *  Now allocate a new table compatible with LYCharSets[]
-     *  and with the HTMLDTD for entities.
-     *  We don't know yet whether we'll keep it around. */
+     *	Now allocate a new table compatible with LYCharSets[]
+     *	and with the HTMLDTD for entities.
+     *	We don't know yet whether we'll keep it around. */
     p = prepl = (char **)malloc(HTML_dtd.number_of_entities * sizeof(char *));
     if (!p) {
 	FREE(tp);
@@ -1766,8 +1766,8 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
 	*p = s7;
 	if (s8 && (unsigned char)(*s8) >= 160 && strlen(s8) == 1) {
 	    /*
-	     *  We have an entity that is mapped to
-	     *  one valid eightbit latin1 char.
+	     *	We have an entity that is mapped to
+	     *	one valid eightbit latin1 char.
 	     */
 	    if (ti[(unsigned char)(*s8) - 160] >= lowest8 &&
 		!(s7[0] == ti[(unsigned char)(*s8) - 160] &&
@@ -1795,10 +1795,10 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
 		    (*p)[1] = '\0';
 #else
 		    /*
-		     *  Use this instead... make those 1-char strings
-		     *  into HTAtoms, so they will be cleaned up
-		     *  at exit... all for the sake of preventing
-		     *  memory leaks, sigh.
+		     *	Use this instead... make those 1-char strings
+		     *	into HTAtoms, so they will be cleaned up
+		     *	at exit... all for the sake of preventing
+		     *	memory leaks, sigh.
 		     */
 		    static char dummy[2];	/* one char dummy string */
 
@@ -1851,8 +1851,8 @@ PRIVATE int UC_Register_with_LYCharSets ARGS4(
     }
 
     /*
-     *  Do different kinds of searches...
-     *  Normally the first should find the match if there is one!
+     *	Do different kinds of searches...
+     *	Normally the first should find the match if there is one!
      */
     for (i = 0; i < MAXCHARSETS && LYchar_set_names[i] && LYhndl < 0; i++) {
 	if (!strcmp(UC_LYNXcharset, LYchar_set_names[i])) {
@@ -1896,15 +1896,15 @@ PRIVATE int UC_Register_with_LYCharSets ARGS4(
     }
   LYCharSet_UC[LYhndl].UChndl = s;
     /*
-     *  Can we just copy the pointer?  Hope so...
+     *	Can we just copy the pointer?  Hope so...
      */
   LYCharSet_UC[LYhndl].MIMEname = UC_MIMEcharset;
   LYCharSet_UC[LYhndl].enc = UCInfo[s].enc;
 
     /*
-     *  @@@ We really SHOULD get more info from the table files,
-     *  and set relevant flags in the LYCharSet_UC[] entry with
-     *  that info...  For now, let's try it without. - KW
+     *	@@@ We really SHOULD get more info from the table files,
+     *	and set relevant flags in the LYCharSet_UC[] entry with
+     *	that info...  For now, let's try it without. - KW
      */
     if (lowest_eightbit < LYlowest_eightbit[LYhndl]) {
     LYlowest_eightbit[LYhndl] = lowest_eightbit;
@@ -1917,7 +1917,7 @@ PRIVATE int UC_Register_with_LYCharSets ARGS4(
     if (repl) {
       LYCharSets[LYhndl] = repl;
 	    /*
-	     *  Remember to FREE at exit.
+	     *	Remember to FREE at exit.
 	     */
       remember_allocated_LYCharSets[LYhndl]=repl;
     }
@@ -1943,7 +1943,7 @@ PUBLIC void UC_Charset_Setup ARGS8(
     int i, status = 0, found;
 
     /*
-     *  Get (new?) slot.
+     *	Get (new?) slot.
      */
     found = -1;
     for (i = 0; i < UCNumCharsets && found < 0; i++) {
@@ -2012,23 +2012,29 @@ PUBLIC void UCInit NOARGS
 
     UC_CHARSET_SETUP;	/* us-ascii */	  /* 7 bit approximations */
 
+/*
+ *  The order of charset names visible in Lynx Options menu
+ *  correspond to the order of lines below,
+ *  except for CJK and others described in LYCharSet.c
+ */
+
     UC_CHARSET_SETUP_iso_8859_1;	  /* ISO Latin 1	  */
     UC_CHARSET_SETUP_cp850;		  /* DosLatin1 (cp850)	  */
-    UC_CHARSET_SETUP_windows_1252;	  /* WinLatin1 (cp1252)	  */
-    UC_CHARSET_SETUP_cp437;		  /* DosLatinUS (cp437)	  */
+    UC_CHARSET_SETUP_windows_1252;	  /* WinLatin1 (cp1252)   */
+    UC_CHARSET_SETUP_cp437;		  /* DosLatinUS (cp437)   */
 
-    UC_CHARSET_SETUP_dec_mcs;		  /* DEC Multinational    */
-    UC_CHARSET_SETUP_macintosh;		  /* Macintosh (8 bit)    */
+    UC_CHARSET_SETUP_dec_mcs;		  /* DEC Multinational	  */
+    UC_CHARSET_SETUP_macintosh; 	  /* Macintosh (8 bit)	  */
     UC_CHARSET_SETUP_next;		  /* NeXT character set   */
 
     UC_CHARSET_SETUP_viscii;		  /* Vietnamese (VISCII)  */
 
     UC_CHARSET_SETUP_iso_8859_2;	  /* ISO Latin 2	  */
     UC_CHARSET_SETUP_cp852;		  /* DosLatin2 (cp852)	  */
-    UC_CHARSET_SETUP_windows_1250;	  /* WinLatin2 (cp1250)	  */
+    UC_CHARSET_SETUP_windows_1250;	  /* WinLatin2 (cp1250)   */
     UC_CHARSET_SETUP_iso_8859_3;	  /* ISO Latin 3	  */
     UC_CHARSET_SETUP_iso_8859_4;	  /* ISO Latin 4	  */
-    UC_CHARSET_SETUP_cp775;		  /* DosBaltRim (cp775)	  */
+    UC_CHARSET_SETUP_cp775;		  /* DosBaltRim (cp775)   */
     UC_CHARSET_SETUP_windows_1257;	  /* WinBaltRim (cp1257)  */
     UC_CHARSET_SETUP_iso_8859_5;	  /* ISO 8859-5 Cyrillic  */
     UC_CHARSET_SETUP_cp866;		  /* DosCyrillic (cp866)  */
@@ -2036,21 +2042,26 @@ PUBLIC void UCInit NOARGS
     UC_CHARSET_SETUP_koi8_r;		  /* KOI8-R Cyrillic	  */
     UC_CHARSET_SETUP_iso_8859_6;	  /* ISO 8869-6 Arabic	  */
     UC_CHARSET_SETUP_cp864;		  /* DosArabic (cp864)	  */
-    UC_CHARSET_SETUP_windows_1256;	  /* WinArabic (cp1256)	  */
+    UC_CHARSET_SETUP_windows_1256;	  /* WinArabic (cp1256)   */
     UC_CHARSET_SETUP_iso_8859_7;	  /* ISO 8859-7 Greek	  */
     UC_CHARSET_SETUP_cp737;		  /* DosGreek (cp737)	  */
     UC_CHARSET_SETUP_cp869;		  /* DosGreek2 (cp869)	  */
     UC_CHARSET_SETUP_windows_1253;	  /* WinGreek (cp1253)	  */
     UC_CHARSET_SETUP_iso_8859_8;	  /* ISO 8859-8 Hebrew	  */
     UC_CHARSET_SETUP_cp862;		  /* DosHebrew (cp862)	  */
-    UC_CHARSET_SETUP_windows_1255;	  /* WinHebrew (cp1255)	  */
+    UC_CHARSET_SETUP_windows_1255;	  /* WinHebrew (cp1255)   */
     UC_CHARSET_SETUP_iso_8859_9;	  /* ISO 8859-9 (Latin 5) */
     UC_CHARSET_SETUP_iso_8859_10;	  /* ISO 8859-10	  */
 
     UC_CHARSET_SETUP_utf_8;		  /* UNICODE UTF-8	  */
-    UC_CHARSET_SETUP_mnemonic_ascii_0;	  /* RFC 1345 w/o Intro	  */
+    UC_CHARSET_SETUP_mnemonic_ascii_0;	  /* RFC 1345 w/o Intro   */
     UC_CHARSET_SETUP_mnemonic;		  /* RFC 1345 Mnemonic	  */
 #ifdef NOTDEFINED
     UC_CHARSET_SETUP_mnem;
 #endif /* NOTDEFINED */
+
+/*
+ *  To add synonyms for any charset name
+ *  check function UCGetLYhndl_byMIME in this file.
+ */
 }
diff --git a/src/chrtrans/README.format b/src/chrtrans/README.format
index 8c21714c..7afc1c68 100644
--- a/src/chrtrans/README.format
+++ b/src/chrtrans/README.format
@@ -45,7 +45,7 @@ b) directives:
 
     RawOrEnc
 	a number which flags some special property (encoding) for this
-        charset [see utf8.uni for example, see UCDefs.h for details].
+        charset [see utf8_uni.tbl for example, see UCDefs.h for details].
 
 c) character translation definitions:
    they look like
@@ -91,7 +91,8 @@ d) string replacement definitions:
 
   which would mean "Replace Unicode U+00cd (LATIN CAPITAL LETTER I WITH 
   ACUTE" with the string (consisting of two character) I' (if no other
-  translation is available)."
+  translation is available)."  Please note that replacement definitions
+  in certnain charset table will override ones from Default table.
 
   Note that everything after the ':' is currently taken VERBATIM, so
   careful with trailing blanks etc.
diff --git a/src/chrtrans/README.tables b/src/chrtrans/README.tables
index 7f095f2f..e6df45ef 100644
--- a/src/chrtrans/README.tables
+++ b/src/chrtrans/README.tables
@@ -1,7 +1,7 @@
 The translation table files in this directory are _examples only_.
-They were collected from several sources (among them Linux kbd package, 
-ftp://dkuug.dk/, ftp://unicode.org/) and automatically converted (if
-applicable), but not checked in detail.  The Unicode/UCS2 values
+They were collected from several sources (among them ftp://ftp.unicode.org,
+Linux kbd package, ftp://dkuug.dk/) and are believed to be correct
+in their mappings, but not checked in detail.  The Unicode/UCS2 values
 for some of the RFC 1345 Mnemonic codes are out of date, a cleanup and
 update would be needed for serious use (including removing the mappings
 from the "private zone" U+E000 etc.).
diff --git a/src/chrtrans/cp1253_uni.tbl b/src/chrtrans/cp1253_uni.tbl
index 83b85c56..097dae2b 100644
--- a/src/chrtrans/cp1253_uni.tbl
+++ b/src/chrtrans/cp1253_uni.tbl
@@ -152,6 +152,3 @@ OWinGreek (cp1253)
 0xFD	U+03CD	#GREEK SMALL LETTER UPSILON WITH TONOS
 0xFE	U+03CE	#GREEK SMALL LETTER OMEGA WITH TONOS
 #0xFF		#UNDEFINED
-
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp1255_uni.tbl b/src/chrtrans/cp1255_uni.tbl
index 47c58b6e..5f4d761a 100644
--- a/src/chrtrans/cp1255_uni.tbl
+++ b/src/chrtrans/cp1255_uni.tbl
@@ -152,6 +152,3 @@ OWinHebrew (cp1255)
 0xFD	U+200E	#LEFT-TO-RIGHT MARK
 0xFE	U+200F	#RIGHT-TO-LEFT MARK
 #0xFF		#UNDEFINED
-
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp1256_uni.tbl b/src/chrtrans/cp1256_uni.tbl
index 0f43728a..6d85d221 100644
--- a/src/chrtrans/cp1256_uni.tbl
+++ b/src/chrtrans/cp1256_uni.tbl
@@ -152,6 +152,3 @@ OWinArabic (cp1256)
 0xFD	U+200E	#LEFT-TO-RIGHT MARK
 0xFE	U+200F	#RIGHT-TO-LEFT MARK
 #0xFF		#UNDEFINED
-
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp437_uni.tbl b/src/chrtrans/cp437_uni.tbl
index 3e3188fb..ad8d9940 100644
--- a/src/chrtrans/cp437_uni.tbl
+++ b/src/chrtrans/cp437_uni.tbl
@@ -292,10 +292,3 @@ U+03cc:o'
 U+03cd:u'
 U+03ce:w'
 
-
-# TRADE MARK SIGN:
-U+2122:(TM)
-
-0x60    U+2018          # left single quotation mark
-0x27    U+2019-U+201b   # various single quotation marks
-0x22    U+201c-U+201f   # various double quotation marks
diff --git a/src/chrtrans/cp737_uni.tbl b/src/chrtrans/cp737_uni.tbl
index b1d44adf..32f01c8c 100644
--- a/src/chrtrans/cp737_uni.tbl
+++ b/src/chrtrans/cp737_uni.tbl
@@ -153,6 +153,3 @@ ODosGreek (cp737)
 0xfd	U+00b2	#SUPERSCRIPT TWO
 0xfe	U+25a0	#BLACK SQUARE
 0xff	U+00a0	#NO-BREAK SPACE
-
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp775_uni.tbl b/src/chrtrans/cp775_uni.tbl
index 7fbf3b82..02a8b61b 100644
--- a/src/chrtrans/cp775_uni.tbl
+++ b/src/chrtrans/cp775_uni.tbl
@@ -276,6 +276,3 @@ ODosBaltRim (cp775)
 0xfd	U+00b2	#SUPERSCRIPT TWO
 0xfe	U+25a0	#BLACK SQUARE
 0xff	U+00a0	#NO-BREAK SPACE
-
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp850_uni.tbl b/src/chrtrans/cp850_uni.tbl
index 85f9684a..8a191fb7 100644
--- a/src/chrtrans/cp850_uni.tbl
+++ b/src/chrtrans/cp850_uni.tbl
@@ -284,10 +284,3 @@ ODosLatin1 (cp850)
 0xfe	U+25a0	#BLACK SQUARE
 0xff	U+00a0	#NO-BREAK SPACE
 
-
-# TRADE MARK SIGN:
-U+2122:(TM)
-
-0x60    U+2018          # left single quotation mark
-0x27    U+2019-U+201b   # various single quotation marks
-0x22    U+201c-U+201f   # various double quotation marks
diff --git a/src/chrtrans/cp852_uni.tbl b/src/chrtrans/cp852_uni.tbl
index ec812352..0658d893 100644
--- a/src/chrtrans/cp852_uni.tbl
+++ b/src/chrtrans/cp852_uni.tbl
@@ -278,10 +278,3 @@ ODosLatin2 (cp852)
 0xfe    U+25a0  #BLACK SQUARE
 0xff    U+00a0  #NO-BREAK SPACE
 
-
-# TRADE MARK SIGN:
-U+2122:(TM)
-
-0x60    U+2018          # left single quotation mark
-0x27    U+2019-U+201b   # various single quotation marks
-0x22    U+201c-U+201f   # various double quotation marks
diff --git a/src/chrtrans/cp862_uni.tbl b/src/chrtrans/cp862_uni.tbl
index f1a7dd02..3d21c138 100644
--- a/src/chrtrans/cp862_uni.tbl
+++ b/src/chrtrans/cp862_uni.tbl
@@ -153,5 +153,3 @@ ODosHebrew (cp862)
 0xfe	U+25a0	#BLACK SQUARE
 0xff	U+00a0	#NO-BREAK SPACE
 
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp864_uni.tbl b/src/chrtrans/cp864_uni.tbl
index 14097a6e..d6e92431 100644
--- a/src/chrtrans/cp864_uni.tbl
+++ b/src/chrtrans/cp864_uni.tbl
@@ -153,5 +153,3 @@ ODosArabic (cp864)
 0xfe	U+25a0	#BLACK SQUARE
 #0xff		#UNDEFINED
 
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/cp869_uni.tbl b/src/chrtrans/cp869_uni.tbl
index 412fb8a7..21cdeb95 100644
--- a/src/chrtrans/cp869_uni.tbl
+++ b/src/chrtrans/cp869_uni.tbl
@@ -153,5 +153,3 @@ ODosGreek2 (cp869)
 0xfe	U+25a0	#BLACK SQUARE
 0xff	U+00a0	#NO-BREAK SPACE
 
-# TRADE MARK SIGN:
-U+2122:(TM)
diff --git a/src/chrtrans/def7_uni.tbl b/src/chrtrans/def7_uni.tbl
index 267fa751..880e932e 100644
--- a/src/chrtrans/def7_uni.tbl
+++ b/src/chrtrans/def7_uni.tbl
@@ -10,8 +10,8 @@ Mus-ascii
 D1
 
 
-# this letters should not normally pass here,
-# but may come from named and numbered entities:
+# us-ascii characters should not normally pass here,
+# they are always processed directly but let declare it here:
 0x20-0x7e  idem
 
 
@@ -92,60 +92,60 @@ U+00fc:u:
 0x79	U+00fd
 U+00fe:th
 0x79	U+00ff
-0x41	U+0100	U+0102	U+0104
-0x61	U+0101	U+0103	U+0105
-0x43	U+0106	U+0108	U+010a	U+010c
+0x41	U+0100	U+0102	U+0104			# A
+0x61	U+0101	U+0103	U+0105			# a
+0x43	U+0106	U+0108	U+010a	U+010c		# C
 # The following line is an example for mapping several accented versions
 # of small letter 'c' to 'c':
-0x63	U+0107	U+0109	U+010b	U+010d
+0x63	U+0107	U+0109	U+010b	U+010d		# c
 0x44	U+010e
 0x64	U+010f
 U+0110:D/
 U+0111:d/
-0x45	U+0112	U+0114	U+0116	U+0118	U+011a
-0x65	U+0113	U+0115	U+0117	U+0119	U+011b
-0x47	U+011c	U+011e	U+0120	U+0122
-0x67	U+011d	U+011f	U+0121	U+0123
+0x45	U+0112	U+0114	U+0116	U+0118	U+011a	# E
+0x65	U+0113	U+0115	U+0117	U+0119	U+011b	# e
+0x47	U+011c	U+011e	U+0120	U+0122		# G
+0x67	U+011d	U+011f	U+0121	U+0123		# g
 0x48	U+0124
 0x68	U+0125
 U+0126:H/
 0x48	U+0127 #	LATIN SMALL LETTER H BAR	-> H
-0x49	U+0128	U+012a	U+012c	U+012e	U+0130
-0x69	U+0129	U+012b	U+012d	U+012f	U+0131
+0x49	U+0128	U+012a	U+012c	U+012e	U+0130	# I
+0x69	U+0129	U+012b	U+012d	U+012f	U+0131	# i
 U+0132:IJ
 U+0133:ij
 0x4a	U+0134
 0x6a	U+0135
 0x4b	U+0136
-0x4b	U+0137
+0x6b	U+0137
 U+0138:kk
-0x4c	U+0139	U+013b	U+013d
-0x6c	U+013a	U+013c	U+013e
+0x4c	U+0139	U+013b	U+013d			# L
+0x6c	U+013a	U+013c	U+013e			# l
 U+013f:L.
 U+0140:l.
 U+0141:L/
 U+0142:l/
-0x4e	U+0143	U+0145	U+0147
-0x6e	U+0144	U+0146	U+0148
+0x4e	U+0143	U+0145	U+0147			# N
+0x6e	U+0144	U+0146	U+0148			# n
 U+0149:'n
 U+014a:NG
 0x4e	U+014B #	LATIN SMALL LETTER ENG	-> N
-0x4f	U+014c	U+014e
-0x6f	U+014d	U+014f
+0x4f	U+014c	U+014e				# O
+0x6f	U+014d	U+014f				# o
 U+0150:O"
 U+0151:o"
 U+0152:OE
 U+0153:oe
-0x52	U+0154	U+0156	U+0158
-0x72	U+0155	U+0157	U+0159
-0x53	U+015a	U+015c	U+015e	U+0160
-0x73	U+015b	U+015d	U+015f	U+0161
-0x54	U+0162	U+0164
-0x74	U+0163	U+0165
+0x52	U+0154	U+0156	U+0158			# R
+0x72	U+0155	U+0157	U+0159			# r
+0x53	U+015a	U+015c	U+015e	U+0160		# S
+0x73	U+015b	U+015d	U+015f	U+0161		# s
+0x54	U+0162	U+0164				# T
+0x74	U+0163	U+0165				# t
 U+0166:T/
 U+0167:t/
-0x55	U+0168	U+016a	U+016c	U+016e	U+0172
-0x75	U+0169	U+016b	U+016d	U+016f	U+0173
+0x55	U+0168	U+016a	U+016c	U+016e	U+0172	# U
+0x75	U+0169	U+016b	U+016d	U+016f	U+0173	# u
 U+0170:U"
 U+0171:u"
 0x57	U+0174
@@ -2168,9 +2168,9 @@ U+001f:US
 U+007f:DT
 U+0080:PA
 U+0081:HO
-# most of that characters (82-9F) processed in the code
-# as windows-1250,1252 if passed silently (HTTP default is iso-latin-1),
-# so should not happen:
+# most of this characters (82-9F) may be switched ON in the code
+# as windows-1252 if come silently (HTTP default is iso-latin-1,
+# but windows-1252 is superset of iso-latin-1)
 #U+0082:BH
 #U+0083:NH
 #U+0084:IN
diff --git a/src/chrtrans/koi8r_uni.tbl b/src/chrtrans/koi8r_uni.tbl
index ebe4fe55..09e8743c 100644
--- a/src/chrtrans/koi8r_uni.tbl
+++ b/src/chrtrans/koi8r_uni.tbl
@@ -6,6 +6,8 @@ Mkoi8-r
 
 0x20-0x7f       idem
 # Based on a table received from "Glenn E. Thobe" <thobe@lafn.org>
+# (verified against RFC1489).
+#
 #hex unicode # description     
 #--- U+---- # ---------------     
 0x80 U+2500 # FORMS LIGHT HORIZONTAL   
@@ -137,9 +139,3 @@ Mkoi8-r
 0xFE U+0427 # CAP CHE    
 0xFF U+042A # CAP HARD SIGN   
 
-# TRADE MARK SIGN:
-U+2122:(TM)
-
-0x60    U+2018          # left single quotation mark <`>
-0x27    U+2019-U+201b   # various single quotation marks <'>
-0x22    U+201c-U+201f   # various double quotation marks <">
diff --git a/src/chrtrans/mac_uni.tbl b/src/chrtrans/mac_uni.tbl
index 61c630f3..ea76d078 100644
--- a/src/chrtrans/mac_uni.tbl
+++ b/src/chrtrans/mac_uni.tbl
@@ -338,5 +338,3 @@ U+00FD:y'
 # small thorn, Icelandic (&#254;) - thorn
 U+00FE:p
 #
-# TRADE MARK SIGN
-U+2122:(TM)
diff --git a/src/chrtrans/next_uni.tbl b/src/chrtrans/next_uni.tbl
index 35ccf541..d2bc974f 100644
--- a/src/chrtrans/next_uni.tbl
+++ b/src/chrtrans/next_uni.tbl
@@ -174,9 +174,4 @@ ONeXT character set
 0xfd	U+00ff	# LATIN SMALL LETTER Y WITH DIAERESIS
 #0xfe	U+fffd	# .notdef, REPLACEMENT CHARACTER
 #0xff	U+fffd	# .notdef, REPLACEMENT CHARACTER
-#
-# degree sign (&#176;) - deg
-U+00B0:DEG
-#
-# TRADE MARK SIGN
-U+2122:(TM)
+
diff --git a/src/chrtrans/utf8_uni.tbl b/src/chrtrans/utf8_uni.tbl
index f65bef47..67ff3460 100644
--- a/src/chrtrans/utf8_uni.tbl
+++ b/src/chrtrans/utf8_uni.tbl
@@ -12,7 +12,7 @@ OUNICODE UTF-8
 # Some kind of raw Unicode?
 # Use 6 for for really "raw" 16bit UCS-2, 7 for UTF-8, ...
 
-# most of these codes currently don't make much sense in a *.uni file,
+# most of these codes currently don't make much sense in a *.tbl file,
 # but for completeness (from UCDefs.h):
 #  #define UCT_ENC_7BIT 0
 #  #define UCT_ENC_8BIT 1
diff --git a/src/chrtrans/viscii_uni.tbl b/src/chrtrans/viscii_uni.tbl
index 33677163..5b055856 100644
--- a/src/chrtrans/viscii_uni.tbl
+++ b/src/chrtrans/viscii_uni.tbl
@@ -18,7 +18,7 @@ OVietnamese (VISCII)
 # Special 'enc' flag to signal that some C0 characters are used.
 # Tables with R3 should properly map the allowed C0 control chars!
 #
-# most of these codes currently don't make much sense in a *.uni file,
+# most of these codes currently don't make much sense in a *.tbl file,
 # but for completeness (from UCDefs.h):
 #  #define UCT_ENC_7BIT 0
 #  #define UCT_ENC_8BIT 1
@@ -298,9 +298,3 @@ U+1ef6:Y?
 U+1ef8:Y~
 0xdb	U+1ef9
 
-# TRADE MARK SIGN:
-U+2122:(TM)
-
-0x60    U+2018          # left single quotation mark <`>
-0x27    U+2019-U+201b   # various single quotation marks <'>
-0x22    U+201c-U+201f   # various double quotation marks <">
diff --git a/src/makefile.dos b/src/makefile.dos
index 3ab548c0..ce485b18 100644
--- a/src/makefile.dos
+++ b/src/makefile.dos
@@ -12,7 +12,7 @@ LYStyle.o LYHash.o
 CFLAGS= $(MCFLAGS) -I.. $(SLANGINC)

 

 CC = gcc

-MCFLAGS = -O3 -DALT_CHAR_SET -DUSE_ZLIB -DUSE_EXTERNALS -DNCURSES_VERSION -DCOLOR_CURSES -DNCURSES -DFANCY_CURSES -DACCESS_AUTH -DNO_CUSERID -DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP -Ichrtrans -I../WWW/library/implementation -I../curses  -I../djgpp/tcplib/include -I../djgpp/tcplib/include/tcp

+MCFLAGS = -O3 -DUSE_ZLIB -DUSE_EXTERNALS -DCOLOR_CURSES -DNCURSES -DFANCY_CURSES -DACCESS_AUTH -DNO_CUSERID -DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP -Ichrtrans -I../WWW/library/implementation -I../curses  -I../djgpp/tcplib/include -I../djgpp/tcplib/include/tcp

 WWWLIB = ../WWW/library/djgpp/libwww.a ../curses/pdcurses.a ../djgpp/tcplib/obj/libtcp.a

 LIBS=-lz

 

diff --git a/userdefs.h b/userdefs.h
index 591424ce..275c9f2d 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -31,12 +31,12 @@
 
 /*******************************************************************
  * Things you must change
- *  Section 1. 
+ *  Section 1.
  */
 
 /*******************************************************************
  * Things you must change  VMS specific
- *  Section 1a). 
+ *  Section 1a).
  */
 #ifdef VMS
 /**************************
@@ -92,7 +92,7 @@
 #endif /* LYNX_CFG_FILE */
 
 /**************************
- * The EXTENSION_MAP file allows you to map file suffix's to 
+ * The EXTENSION_MAP file allows you to map file suffix's to
  * mime types.
  * These global and personal files override anything in
  * lynx.cfg or src/HTInit.c
@@ -101,11 +101,11 @@
 #define PERSONAL_EXTENSION_MAP "mime.types"
 
 /**************************
- * The MAILCAP file allows you to map file MIME types to 
+ * The MAILCAP file allows you to map file MIME types to
  * external viewers.
  * These global and personal files override anything in
  * lynx.cfg or src/HTInit.c
- */ 
+ */
 #define GLOBAL_MAILCAP "Lynx_Dir:mailcap"
 #define PERSONAL_MAILCAP ".mailcap"
 
@@ -225,7 +225,7 @@
 
 /*******************************************************************
  * Things you must change  UNIX specific
- *  Section 1b). 
+ *  Section 1b).
  */
 #else     /* UNIX */
 
@@ -266,7 +266,7 @@
 #endif /* LYNX_CFG_FILE */
 
 /**************************
- * The EXTENSION_MAP file allows you to map file suffix's to 
+ * The EXTENSION_MAP file allows you to map file suffix's to
  * mime types.
  * These global and personal files override anything in
  * lynx.cfg or src/HTInit.c
@@ -275,7 +275,7 @@
 #define PERSONAL_EXTENSION_MAP ".mime.types"
 
 /**************************
- * The MAILCAP file allows you to map file MIME types to 
+ * The MAILCAP file allows you to map file MIME types to
  * external viewers.
  * These global and personal files override anything in
  * lynx.cfg or src/HTInit.c
@@ -317,7 +317,7 @@
 
 /**************************
  * For UNIX systems this should be sendmail
- * sendmail should be in /usr/lib 
+ * sendmail should be in /usr/lib
  *
  * You definitely want sendmail, not mail or elm or something else,
  * except in the case where MMDF is your mail agent.
@@ -330,14 +330,14 @@
  */
 #ifndef HAVE_CONFIG_H
 #ifdef MMDF
-#define SYSTEM_MAIL "/usr/mmdf/bin/submit" 
+#define SYSTEM_MAIL "/usr/mmdf/bin/submit"
 #define SYSTEM_MAIL_FLAGS "-mlruxto,cc\\*"
 #else
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
 #define SYSTEM_MAIL "/usr/sbin/sendmail"
 #define SYSTEM_MAIL_FLAGS "-t -oi"
 #else /* everything else: */
-#define SYSTEM_MAIL "/usr/lib/sendmail" 
+#define SYSTEM_MAIL "/usr/lib/sendmail"
 #define SYSTEM_MAIL_FLAGS "-t -oi"
 #endif /* __FreeBSD || __NetBSD__ || __bsdi__ */
 #endif /* MMDF */
@@ -437,14 +437,14 @@
 /*****************************
  * STARTFILE is the default file if none is specified in lynx.cfg,
  *  on the command line, or via a WWW_HOME environment variable.
- * 
+ *
  * note: STARTFILE must be a URL.  See the Lynx online help for more
  *       information on URLs
  */
 #define STARTFILE "http://lynx.browser.org/"
 
 /*****************************
- * HELPFILE must be defined as a URL and must have a 
+ * HELPFILE must be defined as a URL and must have a
  * complete path if local:
  * file://localhost/PATH_TO/lynx_help/lynx_help_main.html
  *   Replace PATH_TO with the path to the lynx_help subdirectory
@@ -641,6 +641,7 @@
  *   DosLatin2 (cp852)			cp852
  *   DosLatinUS (cp437)			cp437
  *   ISO 8859-10			iso-8859-10
+ *   ISO 8859-5 Cyrillic		iso-8859-5
  *   ISO 8859-6 Arabic			iso-8859-6
  *   ISO 8859-7 Greek			iso-8859-7
  *   ISO 8859-8 Hebrew			iso-8859-8
@@ -649,14 +650,12 @@
  *   ISO Latin 2			iso-8859-2
  *   ISO Latin 3			iso-8859-3
  *   ISO Latin 4			iso-8859-4
- *   ISO 8859-5 Cyrillic		iso-8859-5
  *   Japanese (EUC)			euc-jp
  *   Japanese (SJIS)			shift_jis
  *   KOI8-R Cyrillic			koi8-r
  *   Korean				euc-kr
  *   Macintosh (8 bit)			macintosh
  *   NeXT character set			next
- *   Other ISO Latin			x-iso-8859-other
  *   RFC 1345 Mnemonic			mnemonic
  *   RFC 1345 w/o Intro			mnemonic+ascii+0
  *   Taipei (Big5)			big5
@@ -904,7 +903,7 @@
  * umlaut.  If defined, a digraph is displayed, e.g., auml --> ae
  * Otherwise, a single character is displayed,  e.g., auml --> a
  * Note that this is currently not supported with the chartrans code,
- * or rather it doesn't have an effect if translations for a display 
+ * or rather it doesn't have an effect if translations for a display
  * character set are taken from one of the *.tbl files in src/chrtrans.
  * One would have to modify the corresponding *.tbl file for this.
  */
@@ -958,7 +957,7 @@
  * very serious security risk to your system and its
  * users.  If you do define these I suggest that
  * you only allow users to execute files/scripts
- * that reside on your local machine. 
+ * that reside on your local machine.
  *
  * YOU HAVE BEEN WARNED!
  *
@@ -966,13 +965,13 @@
  * also see src/HTInit.c to verify/change the execution
  * script extensions and/or commands.
  */
-/* #define EXEC_LINKS  */ 
-/* #define EXEC_SCRIPTS  */ 
+/* #define EXEC_LINKS  */
+/* #define EXEC_SCRIPTS  */
 
 /**********
  * UNIX:
  * =====
- * CGI script support. Defining LYNXCGI_LINKS allows you to use the 
+ * CGI script support. Defining LYNXCGI_LINKS allows you to use the
  *
  *   lynxcgi:path
  *
@@ -1007,7 +1006,7 @@
 #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS)
 
 /**********
- * if ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS 
+ * if ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS
  * is defined then the user will be able to change
  * the execution status within the options screen.
  */
@@ -1031,7 +1030,7 @@
  * EXEC_SCRIPTS defined.
  *
  * The first two settings:
- * LOCAL_EXECUTION_LINKS_ALWAYS_ON 
+ * LOCAL_EXECUTION_LINKS_ALWAYS_ON
  * LOCAL_EXECUTION_LINKS_ON_BUT_NOT_REMOTE
  * specify the DEFAULT setting of the users execution link
  * options, but the user may still change those options.
@@ -1042,7 +1041,7 @@
  * LOCAL_EXECUTION_LINKS_ALWAYS_ON will be FALSE
  * if NEVER_ALLOW_REMOTE_EXEC has been defined.
  *
- * if LOCAL_EXECUTION_LINKS_ALWAYS_OFF_FOR_ANONYMOUS is 
+ * if LOCAL_EXECUTION_LINKS_ALWAYS_OFF_FOR_ANONYMOUS is
  * true all execution links will be disabled when the
  * -anonymous command line option is used.  Anonymous
  * users are not allowed to change the execution options
@@ -1061,7 +1060,7 @@
 #endif /*  defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) */
 
 /*********************************
- *  MAIL_SYSTEM_ERROR_LOGGING will send a message to the owner of 
+ *  MAIL_SYSTEM_ERROR_LOGGING will send a message to the owner of
  *  the information if there is one, every time
  *  that a document cannot be accessed!
  *
@@ -1102,7 +1101,7 @@
 /*********************************
  * DEFAULT_KEYPAD_MODE specifies whether by default the user
  * has numbers that work like arrows or else numbered links
- * DEFAULT KEYPAD MODE may be set to 
+ * DEFAULT KEYPAD MODE may be set to
  *	NUMBERS_AS_ARROWS   or
  *	LINKS_ARE_NUMBERED  or
  *	LINKS_AND_FORM_FIELDS_ARE_NUMBERED
@@ -1169,12 +1168,13 @@
 #define SUBSTITUTE_UNDERSCORES	FALSE /* Use _underline_ format in dumps */
 
 /********************************
- * If QUIT_DEFAULT_YES is defined then when the QUIT command is entered,
- * any response other than n or N will confirm.  Comment this out if
- * you prefer the more conservative action of requiring an explicit
- * Y or y to confirm.
+ * If QUIT_DEFAULT_YES is defined as TRUE then when the QUIT command
+ * is entered, any response other than n or N will confirm.  Define it
+ * as FALSE if you prefer the more conservative action of requiring an
+ * explicit Y or y to confirm.  The default defined here can be changed
+ * in lynx.cfg.
  */
-#define QUIT_DEFAULT_YES
+#define QUIT_DEFAULT_YES	TRUE
 
 /********************************
  * These definitions specify files created or used in conjunction
@@ -1206,7 +1206,7 @@
  * the version definition with the Project Version on checkout. Just
  * ignore it. - kw */
 /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.7.1ac-0.111"
+#define LYNX_VERSION "2.7.1ac-0.113"
 
 #ifndef MAXINT
 #define MAXINT 2147483647	/* max integer */
@@ -1352,7 +1352,7 @@
  *
  * It is very important to have this correctly defined or include
  * the "-anonymous" command line option for invocation of Lynx
- * in an anonymous account!  If you do not you will be putting 
+ * in an anonymous account!  If you do not you will be putting
  * yourself at GREAT security risk!
  */
 #define ANONYMOUS_USER ""