about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-02-19 10:57:28 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1998-02-19 10:57:28 -0500
commit899516a7c8880df05e30bbbed72ca1d3cb7a4f00 (patch)
tree14b895432dc4e84686c36bdeee4c689706af5361 /src
parentc82d2a4041724afe1dce249c78c4f034ca6a8d69 (diff)
downloadlynx-snapshots-899516a7c8880df05e30bbbed72ca1d3cb7a4f00.tar.gz
snapshot of project "lynx", label v2-7-1ac-0_115
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c5
-rw-r--r--src/HTFWriter.c7
-rw-r--r--src/HTML.c119
-rw-r--r--src/LYCharSets.c40
-rw-r--r--src/LYCharSets.h1
-rw-r--r--src/LYCharUtils.c273
-rw-r--r--src/LYCharUtils.h3
-rw-r--r--src/LYCurses.h4
-rw-r--r--src/LYLocal.c4
-rw-r--r--src/LYMap.c156
-rw-r--r--src/LYPrint.c25
-rw-r--r--src/LYShowInfo.c6
-rw-r--r--src/LYStrings.c1
-rw-r--r--src/LYUtils.c4
-rw-r--r--src/chrtrans/README.tables3
-rw-r--r--src/chrtrans/mnem2_suni.tbl42
-rw-r--r--src/chrtrans/mnem_suni.tbl42
-rw-r--r--src/chrtrans/rfc_suni.tbl30
-rw-r--r--src/makefile.dos2
19 files changed, 227 insertions, 540 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 7df08b26..102f5a43 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -3066,8 +3066,8 @@ PUBLIC void HText_endAnchor ARGS2(
 	    a->extent = 0;
 	    if (text->hiddenlinkflag != HIDDENLINKS_MERGE) {
 		a->number = 0;
-		HText_AddHiddenLink(text, a);
 	        text->last_anchor_number--;
+		HText_AddHiddenLink(text, a);
 	    }
 	} else {
 	    /*
@@ -6757,6 +6757,9 @@ PUBLIC int HText_beginInput ARGS3(
  *  The parsed input string will be mutilated on exit(!).
  *  Note that results are not normalised to 1.0, but results from
  *  different calls of this function can be compared. - kw
+ *
+ *  Obsolete, it was planned to use here a quality parametr UCTQ_t,
+ *  which is boolean now.
  */
 PRIVATE double get_trans_q ARGS2(
     int,		cs_from,
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 19d13a1f..a2c78dbe 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -890,7 +890,7 @@ Prepend_BASE:
 		anchor->address, (temp ? temp : anchor->address));
 	FREE(temp);
     }
-        if (LYPrependCharsetToSource &&
+    if (LYPrependCharsetToSource &&
 	!strncasecomp(pres->rep->name, "text/html", 9) &&
 	!anchor->content_encoding) {
 	/*
@@ -902,11 +902,6 @@ Prepend_BASE:
 	 *  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) {
diff --git a/src/HTML.c b/src/HTML.c
index 9ea85b1f..33fe2440 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -278,7 +278,7 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 	me->inPRE = TRUE;
 	break;
 
-    case HTML_LISTING:				/* Litteral text */
+    case HTML_LISTING:				/* Literal text */
     case HTML_XMP:
     case HTML_PLAINTEXT:
 	/*
@@ -393,7 +393,7 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
 	break;
 
     case HTML_PRE:				/* Formatted text */
-    case HTML_LISTING:				/* Litteral text */
+    case HTML_LISTING:				/* Literal text */
     case HTML_XMP:
     case HTML_PLAINTEXT:
 	/*
@@ -567,12 +567,12 @@ PUBLIC void HTML_write ARGS3(HTStructured *, me, CONST char*, s, int, l)
    just an abbreviation. - kw */
 #define INTERN_LT (HTLinkType *)(intern_flag ? LINK_INTERNAL : NULL)
 
-#else  /* TRACK_INTERNAL_LINKS */
+#else  /* !DONT_TRACK_INTERNAL_LINKS */
 
 #define CHECK_FOR_INTERN(s)  /* do nothing */ ;
 #define INTERN_LT (HTLinkType *)NULL
 
-#endif /* TRACK_INTERNAL_LINKS */
+#endif /* DONT_TRACK_INTERNAL_LINKS */
 
 #ifdef USE_COLOR_STYLE
 char class_string[TEMPSTRINGSIZE];
@@ -609,9 +609,9 @@ PRIVATE void HTML_start_element ARGS6(
     BOOL UseBASE = TRUE;		     /* Resoved vs. BASE if present? */
     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;
+    BOOL intern_flag = FALSE;
 
     if (LYMapsOnly) {
 	if (!(ElementNumber == HTML_MAP || ElementNumber == HTML_AREA ||
@@ -810,7 +810,9 @@ PRIVATE void HTML_start_element ARGS6(
 	break;
 
     case HTML_LINK:
+#ifndef DONT_TRACK_INTERNAL_LINKS
 	intern_flag = FALSE;
+#endif
 	if (present && present[HTML_LINK_HREF]) {
 	    CHECK_FOR_INTERN(value[HTML_LINK_HREF]);
 	    /*
@@ -1207,7 +1209,7 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_STYLE:
 	/*
-	 *  We're getting it as Litteral text, which, for now,
+	 *  We're getting it as Literal text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
 	HTChunkClear(&me->style_block);
@@ -1215,7 +1217,7 @@ PRIVATE void HTML_start_element ARGS6(
 
     case HTML_SCRIPT:
 	/*
-	 *  We're getting it as Litteral text, which, for now,
+	 *  We're getting it as Literal text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
 	HTChunkClear(&me->script);
@@ -2470,6 +2472,7 @@ PRIVATE void HTML_start_element ARGS6(
 		me->inBoldA = TRUE;
 	    }
 	}
+#ifndef DONT_TRACK_INTERNAL_LINKS
 	if (present && present[HTML_A_TYPE] && value[HTML_A_TYPE]) {
 	    StrAllocCopy(temp, value[HTML_A_TYPE]);
 	    if (!intern_flag && href &&
@@ -2487,6 +2490,7 @@ PRIVATE void HTML_start_element ARGS6(
 		FREE(temp);
 	    }
 	}
+#endif /* DONT_TRACK_INTERNAL_LINKS */
 
 	me->CurrentA = HTAnchor_findChildAndLink(
 			me->node_anchor,			/* Parent */
@@ -2599,7 +2603,9 @@ PRIVATE void HTML_start_element ARGS6(
 	    }
 	}
 
+#ifndef DONT_TRACK_INTERNAL_LINKS
 	intern_flag = FALSE;	/* unless set below - kw */
+#endif
 	/*
 	 *  If there's a USEMAP, resolve it. - FM
 	 */
@@ -5507,7 +5513,7 @@ PRIVATE void HTML_end_element ARGS3(
 
     case HTML_STYLE:
 	/*
-	 *  We're getting it as Litteral text, which, for now,
+	 *  We're getting it as Literal text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
 	HTChunkTerminate(&me->style_block);
@@ -5520,7 +5526,7 @@ PRIVATE void HTML_end_element ARGS3(
 
     case HTML_SCRIPT:
 	/*
-	 *  We're getting it as Litteral text, which, for now,
+	 *  We're getting it as Literal text, which, for now,
 	 *  we'll just ignore. - FM
 	 */
 	HTChunkTerminate(&me->script);
@@ -5625,75 +5631,10 @@ PRIVATE void HTML_end_element ARGS3(
 	break;
 
     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
-	     */
-	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.
-	     */
-	    if (me->inP) {
-		if (me->inFIG || me->inAPPLET ||
-		    me->inCAPTION || me->inCREDIT ||
-		    me->sp->style->spaceAfter > 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. - kw
-	     */
-	    if (HText_LastLineSize(me->text, FALSE)) {
-		HText_setLastChar(me->text, ' ');  /* absorb white space */
-		HText_appendCharacter(me->text, '\r');
-	    }
-	} else {
-	    if (me->sp->style->spaceAfter > 0) {
-		LYEnsureDoubleSpace(me);
-	    } else {
-		LYEnsureSingleSpace(me);
-	    }
-	    me->inLABEL = FALSE;
-	}
-	me->in_word = NO;
-
-	/*
-	 *  If the P ending here had an ALIGN attribute, we have to
-	 *  revert to whatever is in effect for outer elements or
-	 *  the default. - kw
-	 */
-	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;
-	}
-
-	/*
-	 *  Mark that we have to start a new paragraph
-	 *  and don't have any of its text yet. - kw
-	 *
-	 */
-	me->inP = FALSE;
-
+	LYHandleP(me,
+	    	 (CONST BOOL*)0, (CONST char **)0,
+		 (char **)&include,
+		 FALSE);
 	break;
 
     case HTML_FONT:
@@ -5792,7 +5733,7 @@ PRIVATE void HTML_end_element ARGS3(
 	 *  Set to know that we are no longer in a PRE block.
 	 */
 	me->inPRE = FALSE;
-    case HTML_LISTING:				/* Litteral text */
+    case HTML_LISTING:				/* Literal text */
     case HTML_XMP:
     case HTML_PLAINTEXT:
 	if (me->comment_start)
@@ -6672,7 +6613,7 @@ End_Object:
 
     case HTML_MATH:
 	/*
-	 *  We're getting it as Litteral text, which, until we can process
+	 *  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
 	 */
 	HTChunkPutc(&me->math, ' ');
@@ -6760,22 +6701,6 @@ PUBLIC int HTML_put_entity ARGS2(HTStructured *, me, int, entity_number)
     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;
-    }
-    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;
-	}
     }
     return HT_CANNOT_TRANSLATE;
 }
@@ -7167,7 +7092,7 @@ PUBLIC CONST HTStructuredClass HTMLPresentation = /* As opposed to print etc */
 /*		New Structured Text object
 **		--------------------------
 **
-**	The strutcured stream can generate either presentation,
+**	The structured stream can generate either presentation,
 **	or plain text, or HTML.
 */
 PUBLIC HTStructured* HTML_new ARGS3(
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index 7d5d0635..4798e8e3 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -889,46 +889,6 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
 }
 
 /*
- *  Function to return the values of the ISO_Latin1 Character Set.
- *  It assumes the strings have only one character, and restores
- *  nbsp to 160 and shy to 173, but keeps our substitutions for
- *  characters that are not part of the ISO-8859-1 charset. - FM
- *
- *  Return '\0' to signal that there isn't a one-character
- *  equivalent.  Caller must check! and do whatever additional
- *  processing it wants to do instead.	- KW
- */
-PUBLIC char HTMLGetLatinOneValue ARGS1(int,i)
-{
-    char ch = ISO_Latin1[i][0];
-
-    switch ((unsigned char)ch) {
-	case HT_NON_BREAK_SPACE:
-	    ch = 160;
-	    break;
-
-	case HT_EM_SPACE:
-	    ch = 32;
-	    break;
-
-	case LY_SOFT_HYPHEN:
-	    ch = 173;
-	    break;
-
-	default:
-	    if (ch && ISO_Latin1[i][1]) {
-		/*
-		 *  Got a string longer than 1 char.
-		 */
-		return '\0';
-	    }
-	    break;
-     }
-
-     return ch;
-}
-
-/*
  *  Function to select a character set and then set the
  *  character handling and LYHaveCJKCharacterSet flag. - FM
  */
diff --git a/src/LYCharSets.h b/src/LYCharSets.h
index dc3812c6..08c9f482 100644
--- a/src/LYCharSets.h
+++ b/src/LYCharSets.h
@@ -33,7 +33,6 @@ extern void HTMLSetHaveCJKCharacterSet PARAMS((int i));
 extern CONST char * LYEntityNames[];
 extern CONST char * HTMLGetEntityName PARAMS((UCode_t code));
 extern UCode_t HTMLGetEntityUCValue PARAMS((CONST char *name));
-extern char HTMLGetLatinOneValue PARAMS((int i));
 extern void HTMLUseCharacterSet PARAMS((int i));
 
 #endif /* LYCHARSETS_H */
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index e830d9ea..acc8e0aa 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -849,7 +849,7 @@ PUBLIC void LYGetChartransInfo ARGS1(
 **  keep memory allocations at a minimum. - FM
 */
 PUBLIC void LYExpandString ARGS2(
-	HTStructured *,		me,
+	HTStructured *, 	me,
 	char **,		str)
 {
     char *p = *str;
@@ -868,22 +868,22 @@ PUBLIC void LYExpandString ARGS2(
     int i, j, high, low, diff = 0;
 
     /*
-    **  Don't do anything if we have no structure
-    **  or string, or are in CJK mode. - FM
+    **	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;
+	HTCJK != NOCJK)
+	return;
 
     /*
-    **  Set "convenience copies" of me structure
-    **  elements. - FM
+    **	Set "convenience copies" of me structure
+    **	elements. - FM
     */
     plain_space = me->UsePlainSpace;
     hidden = me->HiddenValue;
 
     /*
-    **  Check for special input charsets - FM
+    **	Check for special input charsets - FM
     */
     if (!strcmp(me->inUCI->MIMEname, "x-transparent")) {
 	/*
@@ -914,21 +914,21 @@ PUBLIC void LYExpandString ARGS2(
     }
 
     /*
-    **  Zero the UTF-8 multibytes buffer. - FM
+    **	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
+    **	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
+    **	Check each character in the original string,
+    **	and add the characters or substitutions to
+    **	our clean copy. - FM
     */
     for (i = 0; p[i]; i++) {
 	/*
@@ -945,8 +945,8 @@ PUBLIC void LYExpandString ARGS2(
 	*/
 	if (me->T.decode_utf8) {
 	    /*
-	    **  Our input charset is UTF-8, so check
-	    **  for non-ASCII characters. - FM
+	    **	Our input charset is UTF-8, so check
+	    **	for non-ASCII characters. - FM
 	    */
 	    if (c_unsign > 127) {
 		/*
@@ -954,9 +954,9 @@ PUBLIC void LYExpandString ARGS2(
 		*/
 		if (utf_count > 0 && (c & 0xc0) == 0x80) {
 		    /*
-		    **  Adjust the UCode_t value, add the octet
-		    **  to the buffer, and decrement the byte
-		    **  count. - FM
+		    **	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--;
@@ -987,7 +987,7 @@ PUBLIC void LYExpandString ARGS2(
 		    }
 		} else {
 		    /*
-		    **  Start handling a new multibyte character. - FM
+		    **	Start handling a new multibyte character. - FM
 		    */
 		    utf_buf[0] = c;
 		    utf_buf_p = &utf_buf[1];
@@ -1018,7 +1018,7 @@ PUBLIC void LYExpandString ARGS2(
 			utf_buf_p = utf_buf;
 		    }
 		    /*
-		    **  Get the next byte. - FM
+		    **	Get the next byte. - FM
 		    */
 		    continue;
 		}
@@ -1070,7 +1070,7 @@ PUBLIC void LYExpandString ARGS2(
 		       me->T.trans_C0_to_uni) {
 		/*
 		**  Quote from SGML.c:
-		**  	"This else if may be too ugly to keep. - KW"
+		**	"This else if may be too ugly to keep. - KW"
 		*/
 		if (me->T.trans_from_uni &&
 		    (((code = UCTransToUni(c, me->inUCLYhndl)) >= 32) ||
@@ -1147,7 +1147,7 @@ PUBLIC void LYExpandString ARGS2(
 	**  (or a space if plain_space or hidden is set) if
 	**  HTPassHighCtrlRaw is not set. - FM
 	*/
-        if (code == 160) {
+	if (code == 160) {
 	    if (!me->T.pass_160_173_raw) {
 		if (plain_space || hidden) {
 		    HTChunkPutc(s, ' ');
@@ -1170,7 +1170,7 @@ PUBLIC void LYExpandString ARGS2(
 	**  (or skip it if plain_space or hidden is set) if
 	**  HTPassHighCtrlRaw is not set. - FM
 	*/
-        if (code == 173) {
+	if (code == 173) {
 	    if (!me->T.pass_160_173_raw) {
 		if (!(plain_space || hidden)) {
 		    HTChunkPutc(s, LY_SOFT_HYPHEN);
@@ -1204,17 +1204,6 @@ PUBLIC void LYExpandString ARGS2(
 	    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) {
@@ -1229,37 +1218,6 @@ PUBLIC void LYExpandString ARGS2(
 	    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 &&
@@ -1272,13 +1230,13 @@ PUBLIC void LYExpandString ARGS2(
 		   (uck = UCTransUniCharStr(replace_buf,
 					    60, code,
 					    me->outUCLYhndl,
-					    0) >= 0)) { 
+					    0) >= 0)) {
 	    /*
-	    **  Got a replacement string.
+	    **	Got a replacement string.
 	    */
 	    HTChunkPuts(s, replace_buf);
 	    continue;
-    	}
+	}
 	/*
 	**  If we want raw UTF-8, output that now. - FM
 	*/
@@ -1294,22 +1252,17 @@ PUBLIC void LYExpandString ARGS2(
 	    continue;
 	}
 	/*
-	**  If it's 8482 (trade), or is any other (> 160) 8-bit
-	**  chararcter and we have not set HTPassEightBitRaw
+	**  If it's any other (> 160) 8-bit character
+	**  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 &&
+	if (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);
-	    }
+		(me->T.do_8bitraw && !me->T.trans_from_uni)))) {
+	    value = (code - 160);
+	    name = HTMLGetEntityName(value);
 	    for (low = 0, high = HTML_dtd.number_of_entities;
 		 high > low;
 		 diff < 0 ? (low = j+1) : (high = j)) {
@@ -1355,8 +1308,8 @@ PUBLIC void LYExpandString ARGS2(
 	    (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
+	    **	KOI8 special: strip high bit, gives (somewhat) readable
+	    **	ASCII or KOI7 - it was constructed that way! - KW
 	    */
 	    HTChunkPutc(s, (saved_char_in & 0x7f));
 	    continue;
@@ -1387,10 +1340,10 @@ PUBLIC void LYExpandString ARGS2(
 	     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 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"))) &&
@@ -1432,9 +1385,9 @@ PUBLIC void LYExpandString ARGS2(
     }
 
     /*
-    **  Terminate the expanded string,
-    **  replace the original, and free
-    **  the chunk. - FM
+    **	Terminate the expanded string,
+    **	replace the original, and free
+    **	the chunk. - FM
     */
     HTChunkTerminate(s);
     StrAllocCopy(*str, s->data);
@@ -1641,7 +1594,6 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
     size_t len;
     int high, low, diff = 0, i;
     CONST char ** entities = HTML_dtd.entity_names;
-    CONST UC_entity_info * extra_entities = HTML_dtd.extra_entity_info;
     CONST char * name = NULL;
     BOOLEAN no_bytetrans;
     UCTransParams T;
@@ -2104,35 +2056,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 					  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) {
-			    ;
-			} else if (plain_space) {
-			    code = ' ';
-			} else {
-			    code = HT_NON_BREAK_SPACE;
-			}
-		    } else if (uck == 173 && cs_to == 0) {
-			/*
-			    **	Would only happen if some other unicode
-			    **	is mapped to Latin-1 173.
-			    */
-			if (hidden) {
-			    ;
-			} else if (plain_space) {
-			    replace_buf[0] = '\0';
-			    state = S_got_outstring;
-			    break;
-			} else {
-			    code = LY_SOFT_HYPHEN;
-			}
-		    } else {
-			code = uck;
-		    }
+		    code = uck;
 		    state = S_got_outchar;
 		    break;
 		} else if ((uck == -4 ||
@@ -2154,20 +2078,12 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 		    break;
 		}
 		/*
-		**  For 8482 (trade) use the character reference if it's
-		**  a hidden INPUT, otherwise use whatever the tables have
-		**  for &trade;. - FM & KW
-		*/
-		if (code == 8482 && hidden) {
-		    state = S_recover;
-		    break;
-		/*
 		**  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 (code == 8194 || code == 8195 || code == 8201) {
 		    if (hidden) {
 			state = S_recover;
 		    } else if (plain_space) {
@@ -2179,19 +2095,6 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 		    }
 		    break;
 		    /*
-		    **	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) {
-			state = S_recover;
-		    } else {
-			code = '-';
-			state = S_got_outchar;
-		    }
-		    break;
-		    /*
 		    **	Ignore 8204 (zwnj), 8205 (zwj)
 		    **	8206 (lrm), and 8207 (rlm),
 		    **	for now, if we got this far without
@@ -2210,10 +2113,10 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 		    **	Show the numeric entity if the value:
 		    **	(1) Is greater than 255 and unhandled Unicode.
 		    */
-		} else if (code > 255 && code != 8482) {
+		} else if (code > 255) {
 		    /*
 			**  Illegal or not yet handled value.
-			**  Recover the "&#" and continue
+			**  Return "&#" verbatim and continue
 			**  from there. - FM
 			*/
 		    state = S_recover;
@@ -2238,14 +2141,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 		    **	the character as a named entity. - FM
 		    */
 		} else {
-		    if (code == 8482) {
-			/*
-			**  Trade mark sign falls through to here. - KW
-			*/
-			name = "trade";
-		    } else {
-			name = HTMLGetEntityName(code - 160);
-		    }
+		    name = HTMLGetEntityName(code - 160);
 		    state = S_check_name;
 		    break;
 		}
@@ -2254,7 +2150,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	    if (what == P_decimal || what == P_hex) {
 		    /*
 		    **	Illegal or not yet handled value.
-		    **	Recover the "&#" and continue
+		    **	Return "&#" verbatim and continue
 		    **	from there. - FM
 		    */
 		    *q++ = '&';
@@ -2310,7 +2206,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	    }
 	    /*
 	    **	Didn't find the entity.
-	    **	Check the traditional tables.
+	    **	Return to screen verbatim.
 	    */
 	    state = S_recover;
 	    break;
@@ -2775,18 +2671,6 @@ PUBLIC void LYHandleMETA ARGS4(
 		StrAllocCopy(me->node_anchor->charset, "iso-8859-1");
 		HTCJK = NOCJK;
 
-	    } else if (!strncmp(cp1, "iso-8859-2", 10) &&
-		       !strncmp(LYchar_set_names[current_char_set],
-				"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)) {
 		/*
 		 *  Hope it's a match, for now. - FM
 		 */
@@ -2799,12 +2683,6 @@ PUBLIC void LYHandleMETA ARGS4(
 		HTPassEightBitRaw = TRUE;
 		HTAlert(me->node_anchor->charset);
 
-	    } else if (!strncmp(cp1, "koi8-r", 6) &&
-		       !strncmp(LYchar_set_names[current_char_set],
-				"KOI8-R Cyrillic", 15)) {
-		StrAllocCopy(me->node_anchor->charset, "koi8-r");
-		HTPassEightBitRaw = TRUE;
-
 	    } else if (!strncmp(cp1, "euc-jp", 6) && HTCJK == JAPANESE) {
 		StrAllocCopy(me->node_anchor->charset, "euc-jp");
 
@@ -3087,11 +2965,13 @@ PUBLIC void LYHandleP ARGS5(
 	 *  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 (start) {
+	    if (me->inFIG)
+		me->inFIGwithP = TRUE;
 
-	if (me->inAPPLET)
-	    me->inAPPLETwithP = TRUE;
+	    if (me->inAPPLET)
+		me->inAPPLETwithP = TRUE;
+	}
 
 	UPDATE_STYLE;
 	if (me->List_Nesting_Level >= 0) {
@@ -3105,7 +2985,7 @@ PUBLIC void LYHandleP ARGS5(
 		if (me->inFIG || me->inAPPLET ||
 		    me->inCAPTION || me->inCREDIT ||
 		    me->sp->style->spaceAfter > 0 ||
-		    me->sp->style->spaceBefore > 0) {
+		    (start && me->sp->style->spaceBefore > 0)) {
 		    LYEnsureDoubleSpace(me);
 		} else {
 		    LYEnsureSingleSpace(me);
@@ -3121,8 +3001,16 @@ PUBLIC void LYHandleP ARGS5(
 		HText_setLastChar(me->text, ' ');  /* absorb white space */
 		HText_appendCharacter(me->text, '\r');
 	    }
-	} else if (!(me->inLABEL && !me->inP)) {
-	    HText_appendParagraph(me->text);
+	} else {
+	    if (start) {
+		if (!(me->inLABEL && !me->inP)) {
+		    HText_appendParagraph(me->text);
+		}
+	    } else if (me->sp->style->spaceAfter > 0) {
+		LYEnsureDoubleSpace(me);
+	    } else {
+		LYEnsureSingleSpace(me);
+	    }
 	    me->inLABEL = FALSE;
 	}
 	me->in_word = NO;
@@ -3137,19 +3025,22 @@ PUBLIC void LYHandleP ARGS5(
 	} 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);
+	if (start) {
+	    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
diff --git a/src/LYCharUtils.h b/src/LYCharUtils.h
index 0f510b0a..5c8f87ba 100644
--- a/src/LYCharUtils.h
+++ b/src/LYCharUtils.h
@@ -58,9 +58,6 @@ extern char *LYLowercaseI_OL_String PARAMS((
 	int			seqnum));
 extern void LYGetChartransInfo PARAMS((
 	HTStructured *		me));
-extern void add_META_charset_to_fd PARAMS((
-	FILE *			fp,
-	int			disp_chndl));
 extern void LYHandleMETA PARAMS((
 	HTStructured *		me,
 	CONST BOOL*		present,
diff --git a/src/LYCurses.h b/src/LYCurses.h
index c25eb0db..259f2926 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -48,6 +48,10 @@
 #define REDEFINE_CR
 #endif /* CR */
 
+#ifdef HZ
+#undef HZ  /* to prevent parse error :( */
+#endif /* HZ */
+
 #ifdef HAVE_CONFIG_H
 # ifdef HAVE_NCURSES_H
 #  include <ncurses.h>
diff --git a/src/LYLocal.c b/src/LYLocal.c
index 8f2a7035..c17c9a9a 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -999,12 +999,14 @@ PRIVATE BOOLEAN remove_single ARGS1(
 	} else {
 	    sprintf(tmpbuf, "Remove file (y or n): ");
 	}
+#ifdef S_IFLNK
     } else if ((dir_info.st_mode & S_IFMT) == S_IFLNK) {
 	if (strlen(cp) < 50) {
 	    sprintf(tmpbuf, "Remove symbolic link '%s' (y or n): ", cp);
 	} else {
 	    sprintf(tmpbuf, "Remove symbolic link (y or n): ");
 	}
+#endif
     } else {
 	sprintf(tmpbuf, "Unable to determine status of '%s'.", testpath);
 	_statusline(tmpbuf);
@@ -1849,9 +1851,11 @@ PUBLIC int dired_options ARGS2(
 	if (mp->cond == DE_FILE &&
 	    (!*path || (dir_info.st_mode & S_IFMT) != S_IFREG))
 	    continue;
+#ifdef S_IFLNK
 	if (mp->cond == DE_SYMLINK &&
 	    (!*path || (dir_info.st_mode & S_IFMT) != S_IFLNK))
 	    continue;
+#endif
 	if (*mp->sfx &&
 	    (strlen(path) < strlen(mp->sfx) ||
 	     strcmp(mp->sfx, &path[(strlen(path) - strlen(mp->sfx))]) != 0))
diff --git a/src/LYMap.c b/src/LYMap.c
index db491280..618bf368 100644
--- a/src/LYMap.c
+++ b/src/LYMap.c
@@ -1,7 +1,7 @@
 /*			Lynx Client-side Image MAP Support	       LYMap.c
 **			==================================
 **
-**	Author:	FM	Foteos Macrides (macrides@sci.wfbr.edu)
+**	Author: FM	Foteos Macrides (macrides@sci.wfbr.edu)
 **
 */
 
@@ -28,13 +28,15 @@
 
 #include "LYexit.h"
 #include "LYLeaks.h"
- 
+
 #define FREE(x) if (x) {free(x); x=NULL;}
 
 typedef struct _LYMapElement {
    char * address;
    char * title;
+#ifndef DONT_TRACK_INTERNAL_LINKS
    BOOL   intern_flag;
+#endif
 } LYMapElement;
 
 typedef struct _LYImageMap {
@@ -43,7 +45,7 @@ typedef struct _LYImageMap {
    HTList * elements;
 } LYImageMap;
 
-struct _HTStream 
+struct _HTStream
 {
   HTStreamClass * isa;
 };
@@ -52,7 +54,7 @@ PRIVATE HTList * LynxMaps = NULL;
 
 PUBLIC BOOL LYMapsOnly = FALSE;
 
-/* 
+/*
  *  Utility for freeing a list of MAPs.
  */
 PUBLIC void ImageMapList_free ARGS1(
@@ -64,16 +66,16 @@ PUBLIC void ImageMapList_free ARGS1(
     HTList *current;
 
     if (!cur)
-        return;
+	return;
 
     while (NULL != (map = (LYImageMap *)HTList_nextObject(cur))) {
-        FREE(map->address);
+	FREE(map->address);
 	FREE(map->title);
 	if (map->elements) {
 	    current = map->elements;
 	    while (NULL !=
-	    	   (element = (LYMapElement *)HTList_nextObject(current))) {
-	        FREE(element->address);
+		   (element = (LYMapElement *)HTList_nextObject(current))) {
+		FREE(element->address);
 		FREE(element->title);
 		FREE(element);
 	    }
@@ -86,7 +88,7 @@ PUBLIC void ImageMapList_free ARGS1(
     return;
 }
 
-/* 
+/*
  *  Utility for freeing the global list of MAPs. - kw
  */
 PRIVATE void LYLynxMaps_free NOARGS
@@ -115,7 +117,7 @@ PRIVATE void LYLynxMaps_free NOARGS
  *
  */
 
-/* 
+/*
  *  Utility for creating an LYImageMap list, if it doesn't
  *  exist already, adding LYImageMap entry structures if needed, and
  *  removing any LYMapElements in a pre-existing LYImageMap entry so that
@@ -123,8 +125,8 @@ PRIVATE void LYLynxMaps_free NOARGS
  *  MAP element content. - FM
  */
 PUBLIC BOOL LYAddImageMap ARGS3(
-	char *,		address,
-	char *,		title,
+	char *, 	address,
+	char *, 	title,
 	HTParentAnchor *, node_anchor)
 {
     LYImageMap *new = NULL;
@@ -135,14 +137,14 @@ PUBLIC BOOL LYAddImageMap ARGS3(
     LYMapElement *ele = NULL;
 
     if (!(address && *address))
-        return FALSE;
+	return FALSE;
     if (!(node_anchor && node_anchor->address))
 	return FALSE;
 
     /*
-     *  Set theList to either the global LynxMaps list or, if we
-     *  are associated with post data, the specific list.  The
-     *  list is created if it doesn't already exist. - kw
+     *	Set theList to either the global LynxMaps list or, if we
+     *	are associated with post data, the specific list.  The
+     *	list is created if it doesn't already exist. - kw
      */
 #ifndef DONT_TRACK_INTERNAL_LINKS
     if (node_anchor->post_data) {
@@ -167,7 +169,7 @@ PUBLIC BOOL LYAddImageMap ARGS3(
     }
 
     if (theList) {
-        cur = theList;
+	cur = theList;
 	while (NULL != (old = (LYImageMap *)HTList_nextObject(cur))) {
 	    if (!strcmp(old->address, address)) {
 		FREE(old->address);
@@ -175,8 +177,8 @@ PUBLIC BOOL LYAddImageMap ARGS3(
 		if (old->elements) {
 		    curele = old->elements;
 		    while (NULL !=
-		    	   (ele = (LYMapElement *)HTList_nextObject(curele))) {
-		        FREE(ele->address);
+			   (ele = (LYMapElement *)HTList_nextObject(curele))) {
+			FREE(ele->address);
 			FREE(ele->title);
 			FREE(ele);
 		    }
@@ -196,20 +198,20 @@ PUBLIC BOOL LYAddImageMap ARGS3(
     }
     StrAllocCopy(new->address, address);
     if (title && *title)
-        StrAllocCopy(new->title, title);
+	StrAllocCopy(new->title, title);
     if (new != old)
-        HTList_addObject(theList, new);
+	HTList_addObject(theList, new);
     return TRUE;
 }
 
-/* 
+/*
  * Utility for adding LYMapElements to LYImageMaps
  * in the appropriate list. - FM
  */
 PUBLIC BOOL LYAddMapElement ARGS5(
-	char *,		map,
-	char *,		address,
-	char *,		title,
+	char *, 	map,
+	char *, 	address,
+	char *, 	title,
 	HTParentAnchor *, node_anchor,
 	BOOL,		intern_flag)
 {
@@ -219,17 +221,17 @@ PUBLIC BOOL LYAddMapElement ARGS5(
     HTList *cur = NULL;
 
     if (!(map && *map && address && *address))
-        return FALSE;
+	return FALSE;
     if (!(node_anchor && node_anchor->address))
 	return FALSE;
 
     /*
-     *  Set theList to either the global LynxMaps list or, if we
-     *  are associated with post data, the specific list.  The
-     *  list should already exist, since this function is only called
-     *  if the AREA tag we are handling was within a MAP element
-     *  in node_anchor's stream of data, so that LYAddImageMap has
-     *  been called. - kw
+     *	Set theList to either the global LynxMaps list or, if we
+     *	are associated with post data, the specific list.  The
+     *	list should already exist, since this function is only called
+     *	if the AREA tag we are handling was within a MAP element
+     *	in node_anchor's stream of data, so that LYAddImageMap has
+     *	been called. - kw
      */
 #ifndef DONT_TRACK_INTERNAL_LINKS
     if (node_anchor->post_data) {
@@ -252,17 +254,17 @@ PUBLIC BOOL LYAddMapElement ARGS5(
 
     cur = theList;
     while (NULL != (theMap = (LYImageMap *)HTList_nextObject(cur))) {
-        if (!strcmp(theMap->address, map)) {
+	if (!strcmp(theMap->address, map)) {
 	    break;
 	}
     }
     if (!theMap)
-        return FALSE;
+	return FALSE;
     if (!theMap->elements)
-        theMap->elements = HTList_new();
+	theMap->elements = HTList_new();
     cur = theMap->elements;
     while (NULL != (new = (LYMapElement *)HTList_nextObject(cur))) {
-        if (!strcmp(new->address, address)) {
+	if (!strcmp(new->address, address)) {
 	    FREE(new->address);
 	    FREE(new->title);
 	    HTList_removeObject(theMap->elements, new);
@@ -278,10 +280,12 @@ PUBLIC BOOL LYAddMapElement ARGS5(
     }
     StrAllocCopy(new->address, address);
     if (title && *title)
-        StrAllocCopy(new->title, title);
+	StrAllocCopy(new->title, title);
     else
-        StrAllocCopy(new->title, address);
+	StrAllocCopy(new->title, address);
+#ifndef DONT_TRACK_INTERNAL_LINKS
     new->intern_flag = intern_flag;
+#endif
     HTList_appendObject(theMap->elements, new);
     return TRUE;
 }
@@ -292,13 +296,13 @@ PUBLIC BOOL LYAddMapElement ARGS5(
  *  structure. - FM
  */
 PUBLIC BOOL LYHaveImageMap ARGS1(
-	char *,		address)
+	char *, 	address)
 {
     LYImageMap *Map;
     HTList *cur = LynxMaps;
 
     if (!(cur && address && *address != '\0'))
-        return FALSE;
+	return FALSE;
 
     while (NULL != (Map = (LYImageMap *)HTList_nextObject(cur))) {
 	if (!strcmp(Map->address, address)) {
@@ -310,15 +314,15 @@ PUBLIC BOOL LYHaveImageMap ARGS1(
 }
 
 /*
- *  Fills in a Doccaddress structure for getting the HTParentAnchor of
+ *  Fills in a DocAddress structure for getting the HTParentAnchor of
  *  the underlying resource.  ALso returns a pointer to that anchor in
  *  *punderlying if we are dealing with POST data. - kw
  *
  *  address  is the address of the underlying resource, i.e. the one
- *           containing the MAP element, the MAP's name appended as
+ *	     containing the MAP element, the MAP's name appended as
  *	     fragment is ignored.
  *  anAnchor is the LYNXIMGMAP: anchor; if it is associated with POST
- *           data, we want the specific list, otherwise the global list.
+ *	     data, we want the specific list, otherwise the global list.
  */
 PRIVATE void fill_DocAddress ARGS4(
     DocAddress *,	wwwdoc,
@@ -329,9 +333,9 @@ PRIVATE void fill_DocAddress ARGS4(
     HTParentAnchor * underlying;
     if (anAnchor && anAnchor->post_data) {
 	wwwdoc->address = address;
-        wwwdoc->post_data = anAnchor->post_data;
-        wwwdoc->post_content_type = anAnchor->post_content_type;
-        wwwdoc->bookmark = NULL;
+	wwwdoc->post_data = anAnchor->post_data;
+	wwwdoc->post_content_type = anAnchor->post_content_type;
+	wwwdoc->bookmark = NULL;
 	wwwdoc->isHEAD = FALSE;
 	wwwdoc->safe = FALSE;
 	underlying = HTAnchor_parent(HTAnchor_findAddress(wwwdoc));
@@ -341,9 +345,9 @@ PRIVATE void fill_DocAddress ARGS4(
 	    *punderlying = underlying;
     } else {
 	wwwdoc->address = address;
-        wwwdoc->post_data = NULL;
-        wwwdoc->post_content_type = NULL;
-        wwwdoc->bookmark = NULL;
+	wwwdoc->post_data = NULL;
+	wwwdoc->post_content_type = NULL;
+	wwwdoc->bookmark = NULL;
 	wwwdoc->isHEAD = FALSE;
 	wwwdoc->safe = FALSE;
 	if (punderlying)
@@ -358,10 +362,10 @@ PRIVATE void fill_DocAddress ARGS4(
  *  fill in the DocAddress structure etc. by calling fill_DocAddress().
  *
  *  address is the address of the underlying resource, i.e. the one
- *          containing the MAP element, the MAP's name appended as
+ *	    containing the MAP element, the MAP's name appended as
  *	    fragment is ignored.
  *  anchor  is the LYNXIMGMAP: anchor for which LYLoadIMGmap() is
- *          requested; if it is associated with POST data, we want the
+ *	    requested; if it is associated with POST data, we want the
  *	    specific list for this combination of address+post_data.
  *
  * if DONT_TRACK_INTERNAL_LINKS is defined, the Anchor passed to
@@ -385,14 +389,14 @@ PRIVATE HTList * get_the_list ARGS4(
     }
 }
 
-/* 	LYLoadIMGmap - F.Macrides (macrides@sci.wfeb.edu)
+/*	LYLoadIMGmap - F.Macrides (macrides@sci.wfeb.edu)
 **	------------
-**  	Create a text/html stream with a list of links
+**	Create a text/html stream with a list of links
 **	for HyperText References in AREAs of a MAP.
 */
 
 PRIVATE int LYLoadIMGmap ARGS4 (
-	CONST char *, 		arg,
+	CONST char *,		arg,
 	HTParentAnchor *,	anAnchor,
 	HTFormat,		format_out,
 	HTStream*,		sink)
@@ -415,10 +419,10 @@ PRIVATE int LYLoadIMGmap ARGS4 (
     HTFormat old_format_out = HTOutputFormat;
 
     if (!strncasecomp(arg, "LYNXIMGMAP:", 11)) {
-        address = (char * )(arg + 11);
+	address = (char * )(arg + 11);
     }
     if (!(address && strchr(address, ':'))) {
-        HTAlert(MISDIRECTED_MAP_REQUEST);
+	HTAlert(MISDIRECTED_MAP_REQUEST);
 	return(HT_NOT_LOADED);
     }
 
@@ -437,11 +441,11 @@ PRIVATE int LYLoadIMGmap ARGS4 (
 	    HTAlert("Image map from POST response not available!");
 	    return(HT_NOT_LOADED);
 	}
-        LYforce_no_cache = TRUE;
+	LYforce_no_cache = TRUE;
 	reloading = TRUE;
 	HTOutputFormat = WWW_PRESENT;
 	LYMapsOnly = TRUE;
- 	if (!HTLoadAbsolute(&WWWDoc)) {
+	if (!HTLoadAbsolute(&WWWDoc)) {
 	    LYforce_no_cache = old_cache_setting;
 	    reloading = old_reloading;
 	    HTOutputFormat = old_format_out;
@@ -449,7 +453,7 @@ PRIVATE int LYLoadIMGmap ARGS4 (
 	    HTAlert(MAP_NOT_ACCESSIBLE);
 	    return(HT_NOT_LOADED);
 	}
-        LYforce_no_cache = old_cache_setting;
+	LYforce_no_cache = old_cache_setting;
 	reloading = old_reloading;
 	HTOutputFormat = old_format_out;
 	LYMapsOnly = FALSE;
@@ -463,7 +467,7 @@ PRIVATE int LYLoadIMGmap ARGS4 (
 
     cur = theList;
     while (NULL != (theMap = (LYImageMap *)HTList_nextObject(cur))) {
-        if (!strcmp(theMap->address, address)) {
+	if (!strcmp(theMap->address, address)) {
 	    break;
 	}
     }
@@ -478,11 +482,11 @@ PRIVATE int LYLoadIMGmap ARGS4 (
 	    HTAlert("Image map from POST response not available!");
 	    return(HT_NOT_LOADED);
 	}
-        LYforce_no_cache = TRUE;
+	LYforce_no_cache = TRUE;
 	reloading = TRUE;
 	HTOutputFormat = WWW_PRESENT;
 	LYMapsOnly = TRUE;
- 	if (!HTLoadAbsolute(&WWWDoc)) {
+	if (!HTLoadAbsolute(&WWWDoc)) {
 	    LYforce_no_cache = old_cache_setting;
 	    reloading = old_reloading;
 	    HTOutputFormat = old_format_out;
@@ -510,7 +514,7 @@ PRIVATE int LYLoadIMGmap ARGS4 (
     anAnchor->no_cache = TRUE;
 #endif
 
-    target = HTStreamStack(format_in, 
+    target = HTStreamStack(format_in,
 			   format_out,
 			   sink, anAnchor);
 
@@ -522,21 +526,21 @@ PRIVATE int LYLoadIMGmap ARGS4 (
     }
 
     if (theMap->title && *theMap->title) {
-        StrAllocCopy(MapTitle, theMap->title);
+	StrAllocCopy(MapTitle, theMap->title);
     } else if (anAnchor->title && *anAnchor->title) {
-        StrAllocCopy(MapTitle, anAnchor->title);
+	StrAllocCopy(MapTitle, anAnchor->title);
     } else if (LYRequestTitle && *LYRequestTitle &&
-    	       strcasecomp(LYRequestTitle, "[USEMAP]")) {
-        StrAllocCopy(MapTitle, LYRequestTitle);
+	       strcasecomp(LYRequestTitle, "[USEMAP]")) {
+	StrAllocCopy(MapTitle, LYRequestTitle);
     } else if ((cp=strrchr(address, '#')) != NULL) {
-        StrAllocCopy(MapTitle, (cp+1));
+	StrAllocCopy(MapTitle, (cp+1));
     }
     if (!(MapTitle && *MapTitle)) {
-        StrAllocCopy(MapTitle, "[USEMAP]");
+	StrAllocCopy(MapTitle, "[USEMAP]");
     } else {
-        LYEntify(&MapTitle, TRUE);
+	LYEntify(&MapTitle, TRUE);
     }
-    
+
     sprintf(buf,"<head>\n<title>%s</title>\n</head>\n<body>\n", MapTitle);
     (*target->isa->put_block)(target, buf, strlen(buf));
 
@@ -549,25 +553,27 @@ PRIVATE int LYLoadIMGmap ARGS4 (
     (*target->isa->put_block)(target, buf, strlen(buf));
 
     sprintf(buf, "<%s compact>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
-    				    "ol" : "ul"));
+				    "ol" : "ul"));
     (*target->isa->put_block)(target, buf, strlen(buf));
     cur = theMap->elements;
     while (NULL != (new=(LYMapElement *)HTList_nextObject(cur))) {
-        StrAllocCopy(MapAddress, new->address);
+	StrAllocCopy(MapAddress, new->address);
 	LYEntify(&MapAddress, FALSE);
 	(*target->isa->put_block)(target, "<li><a href=\"", 13);
 	(*target->isa->put_block)(target, MapAddress, strlen(MapAddress));
+#ifndef DONT_TRACK_INTERNAL_LINKS
 	if (new->intern_flag)
 	    (*target->isa->put_block)(target, "\" TYPE=\"internal link\"\n>",24);
 	else
+#endif
 	    (*target->isa->put_block)(target, "\"\n>", 3);
-        StrAllocCopy(MapTitle, new->title);
+	StrAllocCopy(MapTitle, new->title);
 	LYEntify(&MapTitle, TRUE);
 	(*target->isa->put_block)(target, MapTitle, strlen(MapTitle));
 	(*target->isa->put_block)(target, "</a>\n", 5);
     }
     sprintf(buf,"</%s>\n</body>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
-    				     "ol" : "ul"));
+				     "ol" : "ul"));
     (*target->isa->put_block)(target, buf, strlen(buf));
 
     (*target->isa->_free)(target);
diff --git a/src/LYPrint.c b/src/LYPrint.c
index c1799a16..f8d1c5ac 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -475,21 +475,20 @@ PUBLIC int printfile ARGS1(
 		     *  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.
+		     *	Currently, if several META CHARSETs are found Lynx uses
+		     *	the first only, and it is opposite to BASE where the
+		     *	original BASE in the <HEAD> overrides ones from the
+		     *	top.
 		     *
+		     *	As in print-to-email we write charset only if the
+		     *	document has 8-bit characters, and we have no CJK or an
+		     *	unofficial "x-" charset.
 		     */
-			use_cte = HTLoadedDocumentEightbit();
-			disp_charset = LYCharSet_UC[current_char_set].MIMEname;
-			if (!use_cte || LYHaveCJKCharacterSet ||
-			    strncasecomp(disp_charset, "x-", 2) == 0) {
-			} else {
+		     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",
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c
index 6e058b76..4ede9630 100644
--- a/src/LYShowInfo.c
+++ b/src/LYShowInfo.c
@@ -128,14 +128,17 @@ PUBLIC int showinfo ARGS4(
 	    } else if (((dir_info.st_mode) & S_IFMT) == S_IFREG) {
 		fprintf(fp0, 
 		      "\nFile that you have currently selected\n\n");
+#ifdef S_IFLNK
 	    } else if (((dir_info.st_mode) & S_IFMT) == S_IFLNK) {
 		fprintf(fp0,
 	     "\nSymbolic link that you have currently selected\n\n");
+#endif
 	    } else {
 		fprintf(fp0,
 		      "\nItem that you have currently selected\n\n");
 	    }
 	    fprintf(fp0,"       <em>Full name:</em>  %s\n", temp);
+#ifdef S_IFLNK
 	    if (((dir_info.st_mode) & S_IFMT) == S_IFLNK) {
 		char buf[1025];
 		int buf_size;
@@ -147,6 +150,7 @@ PUBLIC int showinfo ARGS4(
 		}
 		fprintf(fp0, "  <em>Points to file:</em>  %s\n", buf);
 	    }
+#endif
 	    pw = getpwuid(dir_info.st_uid);
 	    if (pw)
 	        fprintf(fp0, "   <em>Name of owner:</em>  %s\n", pw->pw_name);
@@ -222,8 +226,10 @@ PUBLIC int showinfo ARGS4(
 		    strcat(modes, ", search");
 	        else {
 		    strcat(modes, ", execute");
+#ifdef S_ISVTX
 		    if ((dir_info.st_mode & S_ISVTX))
 		        strcat(modes, ", sticky");
+#endif
 	        }
 	    }
 	    fprintf(fp0, "%s\n", (char *)&modes[2]);  /* Skip leading ', ' */
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 99f54b2d..8a3903af 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -363,6 +363,7 @@ re_read:
 		case 459: c = 13;	break;	/* keypad enter*/
 		case 463: c = '*';	break;	/* keypad * */
 		case 440: c = 'Q';	break;	/* alt x */
+		case 265: c = 'H';	break;	/* F1 */
 		default: break;
 	    }
 	}
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 64301f99..dd9538ba 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -23,7 +23,7 @@
 #include "HTVMSUtils.h"
 #endif /* VMS */
 
-#ifdef UNIX
+#if HAVE_UTMP
 #include <pwd.h>
 #ifdef UTMPX_FOR_UTMP
 #include <utmpx.h>
@@ -35,7 +35,7 @@
 #else
 #include <utmp.h>
 #endif /* UTMPX_FOR_UTMP */
-#endif /* UNIX */
+#endif /* HAVE_UTMP */
 
 #if NEED_PTEM_H
 /* they neglected to define struct winsize in termios.h -- it's only in
diff --git a/src/chrtrans/README.tables b/src/chrtrans/README.tables
index e6df45ef..e2815707 100644
--- a/src/chrtrans/README.tables
+++ b/src/chrtrans/README.tables
@@ -3,8 +3,7 @@ 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.).
+update would be needed for serious use.
 
 More translation files can be easily provided (and new character entities
 added to HTMLDTD.c), this set is just to test whether the system works 
diff --git a/src/chrtrans/mnem2_suni.tbl b/src/chrtrans/mnem2_suni.tbl
index 283ce2bd..cdcd7628 100644
--- a/src/chrtrans/mnem2_suni.tbl
+++ b/src/chrtrans/mnem2_suni.tbl
@@ -1861,43 +1861,5 @@ U+009c:&ST
 U+009d:&OC
 U+009e:&PM
 U+009f:&AC
-U+e001:&/c
-U+e002:&UA
-U+e003:&UB
-U+e004:&"3
-U+e005:&"1
-U+e006:&"!
-U+e007:&"'
-U+e008:&">
-U+e009:&"?
-U+e00a:&"-
-U+e00b:&"(
-U+e00c:&".
-U+e00d:&":
-U+e00e:&"0
-U+e00f:&""
-U+e010:&"<
-U+e011:&",
-U+e012:&";
-U+e013:&"_
-U+e014:&"=
-U+e015:&"/
-U+e016:&"i
-U+e017:&"d
-U+e018:&"p
-U+e019:&;;
-U+e01a:&,,
-U+e01b:&b3
-U+e01c:&Ci
-U+e01d:&f(
-U+e01e:&ed
-U+e01f:&am
-U+e020:&pm
-U+e021:&_Tel_
-U+e022:&_a+:_
-U+e023:&Fl
-U+e024:&GF
-U+e025:&>V
-U+e026:&!*
-U+e027:&?*
-U+e028:&J<
+# Characters in Private Use Area (e000-f8ff) do not have ussigned numbers
+# according Unicode 2.0
diff --git a/src/chrtrans/mnem_suni.tbl b/src/chrtrans/mnem_suni.tbl
index 43c4f707..ddf8600d 100644
--- a/src/chrtrans/mnem_suni.tbl
+++ b/src/chrtrans/mnem_suni.tbl
@@ -1857,43 +1857,5 @@ U+009c: ST
 U+009d: OC
 U+009e: PM
 U+009f: AC
-U+e001: /c
-U+e002: UA
-U+e003: UB
-U+e004: "3
-U+e005: "1
-U+e006: "!
-U+e007: "'
-U+e008: ">
-U+e009: "?
-U+e00a: "-
-U+e00b: "(
-U+e00c: ".
-U+e00d: ":
-U+e00e: "0
-U+e00f: ""
-U+e010: "<
-U+e011: ",
-U+e012: ";
-U+e013: "_
-U+e014: "=
-U+e015: "/
-U+e016: "i
-U+e017: "d
-U+e018: "p
-U+e019: ;;
-U+e01a: ,,
-U+e01b: b3
-U+e01c: Ci
-U+e01d: f(
-U+e01e: ed
-U+e01f: am
-U+e020: pm
-U+e021: _Tel_
-U+e022: _a+:_
-U+e023: Fl
-U+e024: GF
-U+e025: >V
-U+e026: !*
-U+e027: ?*
-U+e028: J<
+# Characters in Private Use Area (e000-f8ff) do not have ussigned numbers
+# according Unicode 2.0
diff --git a/src/chrtrans/rfc_suni.tbl b/src/chrtrans/rfc_suni.tbl
index 3d097e08..8ad8d54d 100644
--- a/src/chrtrans/rfc_suni.tbl
+++ b/src/chrtrans/rfc_suni.tbl
@@ -1954,31 +1954,5 @@ U+009c:ST
 U+009d:OC
 U+009e:PM
 U+009f:AC
-U+e000:"3
-U+e001:"1
-U+e002:"!
-U+e003:"'
-U+e004:">
-U+e005:"?
-U+e006:"-
-U+e007:"(
-U+e008:".
-U+e009:":
-U+e00a:"0
-U+e00b:",
-U+e00c:"_
-U+e00d:""
-U+e00e:";
-U+e00f:"<
-U+e010:"=
-U+e011:"/
-U+e012:"p
-U+e013:"d
-U+e014:"i
-U+e015:+_
-U+e016:a+:
-U+e017:Tel
-U+e018:UA
-U+e019:UB
-U+e01e:Mc
-U+e01f:Fl
+# Characters in Private Use Area (e000-f8ff) do not have ussigned numbers
+# according Unicode 2.0
diff --git a/src/makefile.dos b/src/makefile.dos
index ce485b18..df12b6cb 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 -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

+MCFLAGS = -O3 -DRAWDOSKEYHACK -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