about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-02-27 19:00:00 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1998-02-27 19:00:00 -0500
commit86b4d41a7463bd35cf662fc748aa338caef609c9 (patch)
treedb4ba2deed8edca7df91182c0253ee93248c7382
parent899516a7c8880df05e30bbbed72ca1d3cb7a4f00 (diff)
downloadlynx-snapshots-86b4d41a7463bd35cf662fc748aa338caef609c9.tar.gz
snapshot of project "lynx", label v2-7-1ac-0_117
-rw-r--r--CHANGES.new67
-rw-r--r--INSTALLATION35
-rw-r--r--README12
-rw-r--r--README.configure219
-rw-r--r--README.win-38628
-rw-r--r--RELEASE_STATEMENT30
-rw-r--r--WWW/Library/Implementation/HTAAServ.c84
-rw-r--r--WWW/Library/Implementation/HTAAUtil.c106
-rw-r--r--WWW/Library/Implementation/HTAccess.c1
-rw-r--r--WWW/Library/Implementation/HTAuth.c30
-rw-r--r--WWW/Library/Implementation/HTFTP.c18
-rw-r--r--WWW/Library/Implementation/HTFile.c22
-rw-r--r--WWW/Library/Implementation/HTFile.h2
-rw-r--r--WWW/Library/Implementation/HTFormat.c4
-rw-r--r--WWW/Library/Implementation/HTGopher.c10
-rw-r--r--WWW/Library/Implementation/HTML.h257
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c24
-rw-r--r--WWW/Library/Implementation/HTMLGen.c14
-rw-r--r--WWW/Library/Implementation/HTPlain.c40
-rw-r--r--WWW/Library/Implementation/HTString.c57
-rw-r--r--WWW/Library/Implementation/HTString.h9
-rw-r--r--WWW/Library/Implementation/HTStyle.h29
-rw-r--r--WWW/Library/Implementation/HTTCP.c476
-rw-r--r--WWW/Library/Implementation/HTTelnet.c4
-rw-r--r--WWW/Library/Implementation/HTUtils.h8
-rw-r--r--WWW/Library/Implementation/HTWSRC.c5
-rw-r--r--WWW/Library/Implementation/HTWriter.c34
-rw-r--r--WWW/Library/Implementation/SGML.c43
-rw-r--r--WWW/Library/Implementation/SGML.h10
-rw-r--r--WWW/Library/Implementation/entities.h27
-rw-r--r--WWW/Library/unix/makefile.in2
-rw-r--r--aclocal.m4104
-rw-r--r--config.hin9
-rwxr-xr-xconfigure960
-rw-r--r--configure.in40
-rw-r--r--docs/README.chartrans2
-rw-r--r--lynx.hlp2
-rw-r--r--lynx.man22
-rw-r--r--lynx_help/Lynx_users_guide.html7
-rw-r--r--makefile.in25
-rw-r--r--src/DefaultStyle.c39
-rw-r--r--src/GridText.c44
-rw-r--r--src/HTFWriter.c11
-rw-r--r--src/HTML.c39
-rw-r--r--src/HTML.h5
-rw-r--r--src/LYCharSets.c65
-rw-r--r--src/LYCharSets.h15
-rw-r--r--src/LYCharUtils.c28
-rw-r--r--src/LYCurses.c56
-rw-r--r--src/LYCurses.h38
-rw-r--r--src/LYDownload.c222
-rw-r--r--src/LYKeymap.c6
-rw-r--r--src/LYLocal.c4
-rw-r--r--src/LYMail.c2
-rw-r--r--src/LYMain.c671
-rw-r--r--src/LYMainLoop.c32
-rw-r--r--src/LYNews.c2
-rw-r--r--src/LYOptions.c2
-rw-r--r--src/LYPrint.c19
-rw-r--r--src/LYReadCFG.c6
-rw-r--r--src/LYReadCFG.h26
-rw-r--r--src/LYShowInfo.c7
-rw-r--r--src/LYStrings.c135
-rw-r--r--src/LYStrings.h13
-rw-r--r--src/LYStyle.c20
-rw-r--r--src/LYUtils.c27
-rw-r--r--src/LYUtils.h4
-rw-r--r--src/UCAuto.c4
-rw-r--r--src/UCdomap.c7
-rw-r--r--src/chrtrans/README.tables2
-rw-r--r--src/chrtrans/UCkd.h1
-rw-r--r--src/chrtrans/cp1252_uni.tbl80
-rw-r--r--src/chrtrans/def7_uni.tbl7
-rw-r--r--src/chrtrans/makefile.in81
-rw-r--r--src/chrtrans/makeuctb.c2
-rw-r--r--src/makefile.dos2
-rw-r--r--src/makefile.in14
77 files changed, 2414 insertions, 2202 deletions
diff --git a/CHANGES.new b/CHANGES.new
index bdd0b86e..836e1afe 100644
--- a/CHANGES.new
+++ b/CHANGES.new
@@ -7,20 +7,71 @@ 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-27
+* add RELEASE_STATEMENT file. - TD
+* modify slang configuration to add fake 'scrollok()' - JED
+* modify LYmktime() so that 2-digit years must be greater/equal to 70 to be in
+  1900's (patch by Bela Lubkin).  Also adjust parse_windows_nt_dir_entry() and
+  parse_cms_dir_entry() as noted by Bela - TD
+* comment-out entries in cp1252_uni.tbl which correspond to nonprinting
+  control-characters - LP
+* add logic in SGML.c to correspond with 2.7.2 logic for codes used by
+  MicroSoft FrontPage. - LP
+* remove unneeded code for nbsp, ensp, emsp, thinsp and shy from handle_entity()
+  in SGML.c - LP
+* ifdef UPPER8 function with EXP_8BIT_TOUPPER, make this the default for DJGPP,
+  add configure option --enable-8bit-toupper to allow testing.  - TD
+* case-insensitive search and 8bit letters: 
+  It was realized that information about upper/lower mapping got from TOUPPER
+  which depends on locale in its 8bit and usually fails on non-UNIX systems. 
+  We introduce UPPER8 and strcasecomp8 to implement 8-bit aware
+  case-independent search using one simple assumption:  8bit upper/lower case
+  letters have their "7bit approximation" images (in def7_uni.tbl) matched
+  matched case-insensitively (7bit).  The cost of this assumption is that
+  several differently accented letters may be interpreted as equal but this is
+  negligible if the search string is more than one character long. 
+  (LYStrings.c, also HTString.c and LYMainLoop.c).  - LP & TD
+* add SunOS 4.x-specific ifdef to quiet redefinition warnings for sys/ioctl.h
+  vs sys/termios.h - TD
+* convert usage/options messages into arrays to simplify maintenance. - TD
+* add "-useragent" command-line option to set "User-Agent" (request by Merlin
+  Mathesius <merlin_mathesius@swissbank.com>).  - LP
+* tweak HTML in LYDownload.c, LYPrint.c to restore some double-spacing effects
+  altered in 'collapsible spaces' change 1998-01-25 (reported by James Elkinton
+  <zio@blueneptune.com>).  - LP
+* use strncasecomp/strcasecomp consistently throughout to avoid library
+  dependency on strncasecmp/strcasecmp. - TD
+* correct lengths in several strncasecmp calls for command-line options
+  (though -w is still an abbreviation for -width). - TD
+* test-build with BSD curses on OS/2 EMX (does not display properly), and
+  with ncurses.
+* add configure check CF_FUNC_LSTAT.
+* modify CF_CHECK_ERRNO so that configure script on OS/2 EMX finds sys_errlist.
+* reset styles[] and styleSheet list in DefaultStyle.c, HTML.c so that when
+  a user reloads a page with ^R, we undo changes to those data structures
+  (reported by Larry Virden). - TD
+* remove extra copy of HTML.h from Implementation directory. - TD
+* add CF_GCC_ATTRIBUTES to configure script, to use in flushing out unused
+  parameter warnings (and later, to support prototypes for logging). - TD
+* rename 'extra_entities' to 'unicode_entities' (recommended by LP) - TD
+* add configure option --use-default-colors, to allow background color to use
+  default value (request by SUNAGAWA Keiki <Keiki_Sunagawa@yokogawa.co.jp>) -
+  TD
+* change default for --disable-internal-links so it is normally-off - TD
 1998-02-19
-+ add configure test CF_FIONBIO, some ifdef's (e.g., S_IFLNK) to support
+* add configure test CF_FIONBIO, some ifdef's (e.g., S_IFLNK) to support
   build on OS/2 EMX. - TD
-+ add configure option --disable-extended-dtd, for testing - TD
+* add configure option --disable-extended-dtd, for testing - TD
 * split-out entities.h from HTMLDTD.c - TD
 * remove obsolete mapping in "private" e000 area of mnem_suni.tbl,
   mnem2_suni.tbl, rfc_suni.tbl - LP
 * remove unused function HTMLGetLatinOneValue() - LP
 * remove logic that would attempt lookup of Unicode entities by index into the
-  extra_entities.put_entity method (e.g., of HTML_dtd), in HTML.c
+  unicode_entities.put_entity method (e.g., of HTML_dtd), in HTML.c
   (HTML_put_entity) and HTMLGen.c (HTMLGen_put_entity) - LP
-* tweaks to HTPlain.c, LYCharUtils.c and SGML.c, remove some special-case logic
-  for Unicodes 173, 8211, 8212, 8482, as well as "iso-8859-2", "koi8-r", since
-  they are done in the chartrans tables - LP
+* tweaks to HTPlain.c, LYCharUtils.c and SGML.c, remove extra checks for
+  Unicode mdash, ndash, trade, as well as "iso-8859-2", "koi8-r", since they
+  are done in the chartrans tables - LP
 * add an alias 'H' for F1 when using RAWDOSKEYHACK - DK
 * restore -DRAWDOSKEYHACK to src/makefile.dos, reported by DK - TD
 * correct a typo in CF_CURSES_LIBS configure macro, which caused the configure
@@ -73,7 +124,9 @@ changes are included here. - KW]
   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
+  comparison with 2.7.2 version.  (I have preserved some chunks of difference,
+  ifdef'd NOTUSED_FOTEMODS or NOTDEFINED for ease of comparison -- these may be
+  removed at a later time, when we are done absorbing changes from 2.7.2) - TD
 * Update SGML entity to Unicode table in HTMLDTD.c from ftp.unicode.org -
   lots of new entities, iso-latin-1 now included there.
   See also new files in test/ directory:  sgml.html and unicode.html.
diff --git a/INSTALLATION b/INSTALLATION
index c87fe17d..3665556f 100644
--- a/INSTALLATION
+++ b/INSTALLATION
@@ -44,10 +44,8 @@ Step 3. (You may skip this step if you only use English and are not
     character set) and ASSUME_LOCAL_CHARSET to work correctly for them before
     creating bookmark files et cetera.  Please read "lynx.cfg" for detailed
     instructions.  Additional character sets and their properties may be
-    defined with tables in the src/chrtrans directory.  It is not necessary to
-    change src/LYCharSets.c to make new character sets known to Lynx, but new
-    ones have to be listed in src/UCdomap.c and, currently, the makefiles in
-    src/ and src/chrtrans to be used.  See the README.* files in src/chrtrans/.
+    defined with tables in the src/chrtrans directory, see the README.* files
+    therein.
 
 Step 4. (optional -- news for UNIX and VMS)
     Set NNTPSERVER in "lynx.cfg" to your site's NNTP server, or set the
@@ -110,12 +108,14 @@ II. Compile instructions -- UNIX
     It has been tested on the following platforms.
 
 	AIX 3.2.5 (cc w/ curses)	CLIX (cc w/ curses & ncurses)
-	DGUX				Digital Unix 3.2C (gcc & cc w/ slang)
+	DGUX
+	Digital Unix 3.2C and 4.0 (gcc & cc w/ curses, ncurses & slang)
 	FreeBSD 2.1.5 (gcc 2.6.3 w/ curses & ncurses)
 	HP-UX (K&R and ANSI cc, gcc w/ curses, ncurses & slang)
 	IRIX 5.2 and 6.2 (cc & gcc w/ curses, ncurses & slang)
 	Linux 2.0.0 (gcc 2.7.2 w/ curses, ncurses & slang)
-	MkLinux 2.1.5 (gcc 2.7.2.1)	NetBSD		SCO (cc w/ curses)
+	MkLinux 2.1.5 (gcc 2.7.2.1)	NetBSD
+	OS/2 EMX 0.9b			SCO (cc w/ curses)
 	Solaris 2.5 & 2.6 (cc & gcc w/ curses, ncurses & slang)
 	SunOS 4.1 (cc w/ curses, gcc w/ ncurses & slang)
 
@@ -185,21 +185,24 @@ II. Compile instructions -- UNIX
   	Use this option to suppress the "compiling" commands during a build.
 	Doing this makes it easier to find and read warning messages.
 
+  --disable-extended-dtd		(define NO_EXTENDED_HTMLDTD)
+	disable extended HTML DTD logic.  This should revert to old-style
+	(2.7.1/2.7.2) behavior, but is not well-tested.
+
   --disable-full-paths
   	Use this option to control whether full utility pathnames are used.
 	By default, configure substitutes full pathnames.
 
-  --disable-internal-links		(define DONT_TRACK_INTERNAL_LINKS)
-	Defined by default, this option prevents tracking of internal links,
-	a useful feature which could, however, compromise a secure transaction
-	by forcing inappropriate resubmission of form content.
-
   --disable-long-list			(prevent defining LONG_LIST)
   	Use this option to disable long "ls -l" directory listings.
 
   --disable-parent-dir-refs		(define NO_PARENT_DIR_REFERENCE)
   	Use this option to disable "Up-to" parent-links in directory listings.
 
+  --enable-8bit-toupper			(define EXP_8BIT_TOUPPER)
+	use experimental 8-bit case-conversion, e.g., for case-insensitive
+	searches in non-ASCII character set.
+
   --enable-color-style			(define USE_COLOR_STYLE)
   	Use this option to enable optional and *experimental* color style.
 	(Also defines USE_HASH, LINKEDSTYLES)
@@ -207,6 +210,11 @@ II. Compile instructions -- UNIX
   --enable-debug			(The symbol DEBUG is always defined.)
   	Use this option to compile-in support for debugging.
 
+  --enable-default-colors		(define USE_DEFAULT_COLORS)
+  	enable use of default-color background (ncurses/slang).  Either
+	configuration supports the use of 'default' for colors even without
+	this option.
+
   --enable-externs			(define USE_EXTERNALS)
 	Use this option to enable external application support. (See lynx.cfg.)
 
@@ -218,6 +226,11 @@ II. Compile instructions -- UNIX
 	fonts) according to the current Display Character Set.  (Linux console
         only.  *Use with discretion.*  See docs/README.chartrans.)
 
+  --enable-internal-links		(define DONT_TRACK_INTERNAL_LINKS)
+	Disabled by default, this option allows tracking of internal links,
+	a useful feature which could, however, compromise a secure transaction
+	by forcing inappropriate resubmission of form content.
+
   --enable-nsl-fork			(define NSL_FORK)
 	Use this option to allow NSL requests to be aborted at will.
 
diff --git a/README b/README
index 2db87b71..e947c239 100644
--- a/README
+++ b/README
@@ -12,7 +12,7 @@ WHAT IS LYNX?
    well as files on remote systems running http, gopher, ftp, wais, nntp,
    finger, or cso/ph/qi servers, and services accessible via logins to
    telnet, tn3270 or rlogin accounts.  Current versions of Lynx run on
-   Unix, VMS, Windows95/NT and 386DOS.
+   Unix, VMS, Windows95/NT, 386DOS and OS/2 EMX.
    
    Lynx can be used to access information on the WWW, or to establish
    information systems intended primarily for local access. Lynx has been
@@ -50,7 +50,7 @@ DOCUMENTATION
    system. From the help menu you may access several useful documents
    pertaining to Lynx and the World Wide Web. The most important of
    these is the Lynx Users Guide. By default, Lynx will use the Lynx
-   Enhanced Pages, which includes http links for help and FAQs conerning
+   Enhanced Pages, which includes http links for help and FAQs concerning
    Lynx. It is recommended that you install your own help menu system at
    your site in order to lessen the load on http servers. This also will
    allow you to customize the help menu system for your site and greatly
@@ -83,6 +83,14 @@ PROBLEMS
    problem to the "lynx-dev" mailing list, which is frequented by experienced
    Lynx users.
 
+YEAR 2000 COMPLIANCE
+
+   We believe Lynx works properly for the Year 2000 issues, since it does
+   not store dates in 2-digit form.  Since it must communicate with a wide
+   range of web servers, it interprets dates in a variety of formats.  In
+   particular, if Lynx receives a date with a 2-digit year, it assumes that
+   values less than 70 are in the range 2000-2069.
+
 LYNX-DEV MAILING LIST
 
    To subscribe to lynx-dev, send email to majordomo@sig.net with only the
diff --git a/README.configure b/README.configure
deleted file mode 100644
index fd4eca89..00000000
--- a/README.configure
+++ /dev/null
@@ -1,219 +0,0 @@
--- 1997/10/21 - T.Dickey <dickey@clark.net>
-
---------------------------------------------------------------------------------
-
-Overview
---------
-
-This is an auto-configure script which I and Jim Spath have been working
-on.  It uses autoconf 2.12 to generate a Bourne shell script
-(configure), which can be run on a UNIX platform to generate:
-
-	lynx_cfg.h
-	makefile
-
-to replace the top-level Makefile of Lynx.
-
-To use the configure script, simply type
-
-	./configure
-or	./configure --with-screen=ncurses
-or	./configure --with-screen=slang
-
-and
-	make
-
---------------------------------------------------------------------------------
-
-Platforms
----------
-
-We've tested this on several platforms.  It should work properly on any
-Unix-style system.
-
-	Linux 2.0.0 (gcc 2.7.2 with curses, several versions of ncurses
-		and slang)
-	FreeBSD 2.1.5 (gcc 2.6.3 with curses and ncurses)
-	NetBSD
-	DGUX
-	SunOS 4.1 (cc curses, gcc ncurses and slang)
-	Solaris 2.5 (cc and gcc with curses, ncurses and slang)
-	IRIX 5.2 and 6.2 (cc and gcc with curses, ncurses and slang)
-	CLIX (cc with curses and ncurses)
-	AIX 3.2.5 (cc with curses)
-	SCO (cc with curses)
-	HP-UX (K&R and ANSI cc, gcc with curses, ncurses and slang)
-
-Note:  SunOS and HP-UX come with a bundled K&R compiler, which is only
-useful for compiling with the bundled curses.  Both ncurses and slang
-require a compiler that recognizes prototypes.
-
---------------------------------------------------------------------------------
-
-Options
--------
-
-To get a list of the configure script's options, type
-
-	./configure --help
-
-The form of the options is determined by the autoconf package.  We can
-use either boolean (enable/disable) or value (with) options.
-
-Here's an alphabetical listing of the Lynx-specific options.  The actual
-order shown by the -help option is different due to the requirements of
-the script:
-
-  --disable-dired			(defines DIRED_SUPPORT)
-	Use this option to enable or disable the optional
-	directory-editor.
-
-	Lynx supports directory editing (DirEd) for local directories. 
-	This allows users to do things like view, copy and remove files
-	using a tabular display of the directory and single-keystroke
-	commands instead of using the command line.  From inside Lynx,
-	the keystroke sequence "g.<enter>" switches Lynx to DirEd mode
-	on the current directory.  If you're building a Lynx that is to
-	be used as a kind of restricted shell for users who do not have
-	access to the command line and should not have access to
-	equivalent capabilities, you must disable DirEd with this
-	option.  You can also disable some DirEd functions while
-	allowing others.
-
-	All DirEd functions that were enabled on compilation can be
-	disabled or modified at run time via DIRED_MENU symbols in
-	lynx.cfg.
-
-	If you have disabled DirEd completely, you can ignore all the
-	other DirEd options.
-
-  --disable-dired-archive		(define ARCHIVE_ONLY)
-	Use this option to prevent DirEd from extracting files from an
-	archive file,
-
-  --disable-dired-gzip			(prevent defining OK_GZIP)
-	Use this option to prevent DirEd from using gzip and gunzip.
-
-  --disable-dired-override		(prevent defining OK_OVERRIDE)
-	Lynx users can customize their keymaps by creating private
-	versions of lynx.cfg and modifying them, overriding the default
-	keymap.  Use this option to prevent DirEd keymap overriding.
-
-  --disable-dired-permit		(prevent defining OK_PERMIT)
-	Use this option to prevent DirEd from changing the permissions
-	on directories or files (i.e., from doing what the Unix chmod
-	command or the DOS attrib command does).
-
-  --disable-dired-tar			(prevent defining OK_TAR)
-	Use this option to prevent DirEd from using the tar program.
-
-  --disable-dired-uudecode		(prevent defining OK_UUDECODE)
-	Use this option to prevent DirEd from using uudecode.
-
-  --disable-dired-xpermit		(define NO_CHANGE_EXECUTE_PERMS)
-	Use this option if you do not disable out the dired-permit
-	option, but want to restrict changes of the eXecute permission
-	to directories (i.e., not allow it to be changed for files).  If
-	you don't do this, you can still block changes of the eXecute
-	permission for files but not directories via the
-	"change_exec_perms" command line restriction.
-
-  --disable-dired-zip			(prevent defining OK_ZIP)
-	Use this option to prevent DirEd from using zip and unzip.
-
-  --disable-echo
-  	Use this option to suppress the "compiling" commands during a build.
-	Doing this makes it easier to find and read warning messages.
-
-  --disable-full-paths
-  	Use this option to control whether full utility pathnames are used.
-	By default, configure substitutes full pathnames.
-
-  --disable-internal-links		(define DONT_TRACK_INTERNAL_LINKS)
-	handle following links to same document differently.
-
-  --disable-long-list			(prevent defining LONG_LIST)
-  	Use this option to disable long "ls -l" directory listings.
-
-  --disable-parent-dir-refs		(define NO_PARENT_DIR_REFERENCE)
-  	Use this option to disable "Up-to" parent-links in directory listings.
-
-  --enable-color-style			(define USE_COLOR_STYLE)
-  	Use this option to enable optional/experimental color style.
-	(Also defines USE_HASH, LINKEDSTYLES)
-
-  --enable-debug
-  	Use this option to compile-in support for debugging.
-	(The symbol DEBUG is always defined).
-
-  --enable-externs			(define USE_EXTERNALS)
-  	Use this option to compile-in support for passing URLs to external
-	programs.
-
-  --enable-find-leaks			(defines LY_FIND_LEAKS)
-  	Use this option to compile-in logic for testing memory leaks.
-
-  --enable-font-switch			(defines EXP_CHARTRANS_AUTOSWITCH)
-	Use this option to compile-in support for Linux setfont program,
-	to switch between fonts automatically.
-
-  --enable-nsl-fork			(defines NSL_FORK)
-  	Use this option to compile-in code that forks off gethostbyname
-	lookups so the 'z' key can be used to abort a lookup that hangs
-	or takes forever.
-
-  --enable-underlines			(defines UNDERLINE_LINKS)
-  	Use this option to compile-in logic that makes links underlined
-	rather than boldface.
-
-  --enable-warnings
-  	Use this option to turn on GCC compiler warnings.
-
-  --with-screen=XXX
-	Use this option to select the screen type.  The option value,
-	XXX must be one of curses (the default), ncurses or slang.
-	Specifying a screen type causes the configure script to look in
-	standard locations for the associated header and library files,
-	unless you have preset the $CFLAGS and $LIBS variables.
-
-	--with-screen=ncurses		(defines NCURSES)
-	--with-screen=slang		(defines USE_SLANG)
-
-   --with-zlib				(defines USE_ZLIB)
-	Use zlib for decompression of some gzip files.
-
---------------------------------------------------------------------------------
-
-Environment
------------
-
-This is all documented in great detail in the autoconf package.
-
-The configure script looks for programs and libraries in known/standard
-locations.  You can override the behavior of the script by presetting
-environment variables; if they are set, the script will try to use these
-values rather than computing new ones.  Useful variables include:
-
-	CC - the C compiler.  If you do not override this, configure
-		will try to use gcc.
-
-	CFLAGS - the C compiler options.  These also include C
-		preprocessor options (such as -I), since the $CFLAGS and
-		$CPPFLAGS variables are maintained separately.
-
-	CPPFLAGS - the C preprocessor options.  For some configuration
-		tests, you may need to set both $CFLAGS and $CPPFLAGS if
-		you are compiling against header files in nonstandard
-		locations.
-
-	LDFLAGS - linker/loader options.
-
-	LIBS - the libraries to be linked, e.g,.  with -L and -l
-		options.  If you are linking against libraries in
-		nonstandard locations (e.g., unrelated to the install
-		prefix that you can specify in the configure script),
-		you may have to specify these via the $LIBS variable.
-
-You should not have to edit the generated makefiles to modify the values
-that the configure script generates.  If you do, you have either found a
-bug in the script, or you do not understand how to use it properly.
diff --git a/README.win-386 b/README.win-386
deleted file mode 100644
index 2f36fb23..00000000
--- a/README.win-386
+++ /dev/null
@@ -1,28 +0,0 @@
-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/RELEASE_STATEMENT b/RELEASE_STATEMENT
new file mode 100644
index 00000000..c1c0a1d4
--- /dev/null
+++ b/RELEASE_STATEMENT
@@ -0,0 +1,30 @@
+
+Lynx Ver. 2.8 is now available.
+
+	Lynx is a hypertext browser with full World Wide Web capabilities.
+It is distributed under the GNU General Public License without restrictions
+on usage or redistribution, and is supported by the Lynx user community.
+The Lynx copyright statement and GNU GPL are included in the about_lynx
+subdirectory of the distribution.
+
+	Links to the current sources and support materials for Lynx
+are maintained in the:
+			 "Lynx links"
+	<URL:http://www.crl.com/~subir/lynx.html>
+
+	Version 2.8 is an official release of the Lynx development code set
+through February 28, 1998.
+
+	See the CHANGES file in the Lynx distribution for a complete list of
+changes and bug fixes in this release.
+
+	A majordomo list exists for the distribution of Lynx related
+information, updates, and development discussion.
+o	lynx-dev@sig.net
+
+	Send a subscribe request (subscribe lynx-dev) to majordomo@sig.net
+to be added to the list.  All new releases will be announced on this list.
+To unsubscribe, you should send an unsubscribe request (unsubscribe lynx-dev)
+addressed to the majordomo (majordomo@sig.net).  Please DO NOT send your
+subscribe or unsubscribe requests to the lynx-dev list directly!!!!.
+
diff --git a/WWW/Library/Implementation/HTAAServ.c b/WWW/Library/Implementation/HTAAServ.c
index fb6f696a..cb8623d7 100644
--- a/WWW/Library/Implementation/HTAAServ.c
+++ b/WWW/Library/Implementation/HTAAServ.c
@@ -49,8 +49,8 @@
 #include "HTString.h"
 #include "HTAccess.h"		/* HTSecure			*/
 #include "HTFile.h"		/* HTLocalName			*/
-#include "HTRules.h"		/* 				*/
-#include "HTParse.h"		/* URL parsing function		*/
+#include "HTRules.h"		/*				*/
+#include "HTParse.h"		/* URL parsing function 	*/
 #include "HTList.h"		/* HTList object		*/
 
 #include "HTAAUtil.h"		/* AA common parts		*/
@@ -71,7 +71,7 @@ PUBLIC time_t theTime;
 /*
 ** Module-wide global variables
 */
-PRIVATE FILE *  htaa_logfile	    = NULL; 		/* Log file	      */
+PRIVATE FILE *	htaa_logfile	    = NULL;		/* Log file	      */
 PRIVATE HTAAUser *htaa_user = NULL;			/* Authenticated user */
 PRIVATE HTAAFailReasonType HTAAFailReason = HTAA_OK;	/* AA fail reason     */
 
@@ -82,7 +82,7 @@ PRIVATE HTAAFailReasonType HTAAFailReason = HTAA_OK;	/* AA fail reason     */
 **		(Can be used in server reply status line
 **		 with 401/403 replies.)
 ** ON EXIT:
-**	returns	a string containing the error message
+**	returns a string containing the error message
 **		corresponding to internal HTAAFailReason.
 */
 PUBLIC char *HTAA_statusMessage NOARGS
@@ -125,7 +125,7 @@ PUBLIC char *HTAA_statusMessage NOARGS
 
     /* Success */
       case HTAA_OK:
-	return "AA: Access should be ok but something went wrong"; 
+	return "AA: Access should be ok but something went wrong";
 	break;
 
       case HTAA_OK_GATEWAY:
@@ -142,7 +142,7 @@ PUBLIC char *HTAA_statusMessage NOARGS
 
 PRIVATE char *status_name ARGS1(HTAAFailReasonType, reason)
 {
-    switch (HTAAFailReason) {
+    switch (reason) {
 
     /* 401 cases */
       case HTAA_NO_AUTH:
@@ -207,11 +207,11 @@ PRIVATE char *status_name ARGS1(HTAAFailReasonType, reason)
 **			Kerberos-ticket).
 **
 ** ON EXIT:
-**	returns		HTAA_OK on success.
+**	returns 	HTAA_OK on success.
 **			Otherwise the reason for failing.
 ** NOTE:
 **	This function does not check whether the file
-**	exists or not -- so the status  404 Not found
+**	exists or not -- so the status	404 Not found
 **	must be returned from somewhere else (this is
 **	to avoid unnecessary overhead of opening the
 **	file twice).
@@ -234,9 +234,9 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 	return HTAA_BY_RULE;
     }
     if (TRACE)
-        fprintf(stderr, "%s `%s' %s %s\n",
-		        "HTAA_checkAuthorization: translated path:",
-		        pathname, "method:", HTAAMethod_name(method));
+	fprintf(stderr, "%s `%s' %s %s\n",
+			"HTAA_checkAuthorization: translated path:",
+			pathname, "method:", HTAAMethod_name(method));
 
     /*
     ** Get protection setting (set up by callbacks from rule system)
@@ -259,14 +259,14 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 		/*
 		** Authenticate if authentication info given
 		*/
-		if (scheme != HTAA_UNKNOWN  &&  scheme != HTAA_NONE) {
+		if (scheme != HTAA_UNKNOWN  &&	scheme != HTAA_NONE) {
 		    htaa_user = HTAA_authenticate(scheme,
 						  scheme_specifics,
 						  prot);
 		    if (TRACE)
-		        fprintf(stderr, "Authentication returned: %s\n",
-				        (htaa_user ? htaa_user->username
-					           : "NOT-AUTHENTICATED"));
+			fprintf(stderr, "Authentication returned: %s\n",
+					(htaa_user ? htaa_user->username
+						   : "NOT-AUTHENTICATED"));
 		}
 		HTAA_resolveGroupReferences(prot->mask_group, group_def_list);
 		reason = HTAA_userAndInetInGroup(prot->mask_group,
@@ -281,9 +281,9 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 				"by mask (no ACL, only Protect rule)",
 				"host", HTClientHost);
 		    else
-		        fprintf(stderr, "%s %s %s %s\n",
+			fprintf(stderr, "%s %s %s %s\n",
 				"HTAA_checkAuthorization: request from",
-				HTClientHost, 
+				HTClientHost,
 				"accepted by only mask match (no ACL, only",
 				"Protect rule, and only mask enabled)");
 		}
@@ -299,8 +299,8 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 	}
 	else { /* No protect rule and no ACL => OK 200 */
 	    if (TRACE)
-	        fprintf(stderr, "HTAA_checkAuthorization: %s\n",
-			        "no protect rule nor ACL -- ok\n");
+		fprintf(stderr, "HTAA_checkAuthorization: %s\n",
+				"no protect rule nor ACL -- ok\n");
 	    return HTAA_OK;
 	}
     }
@@ -315,9 +315,9 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 
 	if (!prot) {		/* @@ Default protection not set ?? */
 	    if (TRACE)
-	        fprintf(stderr, "%s %s\n",
-			        "HTAA_checkAuthorization: default protection",
-			        "not set (internal server error)!!");
+		fprintf(stderr, "%s %s\n",
+				"HTAA_checkAuthorization: default protection",
+				"not set (internal server error)!!");
 	    return HTAA_SETUP_ERROR;
 	}
     }
@@ -333,16 +333,16 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 	/*
 	** Authenticate now that we know protection mode
 	*/
-	if (scheme != HTAA_UNKNOWN  &&  scheme != HTAA_NONE) {
+	if (scheme != HTAA_UNKNOWN  &&	scheme != HTAA_NONE) {
 	    htaa_user = HTAA_authenticate(scheme,
 					  scheme_specifics,
 					  prot);
 	    if (TRACE)
-	        fprintf(stderr, "Authentication returned: %s\n",
-			        (htaa_user
+		fprintf(stderr, "Authentication returned: %s\n",
+				(htaa_user
 				 ? htaa_user->username : "NOT-AUTHENTICATED"));
 	}
-	/* 
+	/*
 	** Check mask group
 	*/
 	if (prot->mask_group) {
@@ -362,7 +362,7 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 		if (TRACE)
 		    fprintf(stderr, "%s %s %s %s %s\n",
 				    "HTAA_checkAuthorization: request from",
-				    HTClientHost, 
+				    HTClientHost,
 				    "accepted by just mask group match",
 				    "(no ACL, only Protect rule, and only",
 				    "mask enabled)");
@@ -370,15 +370,15 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 	    }
 	}
 	/*
-        ** Get ACL entries; get first one first, the loop others
+	** Get ACL entries; get first one first, the loop others
 	** Remember, allowed_groups is automatically freed by
 	** HTAA_getAclEntry().
 	*/
 	allowed_groups = HTAA_getAclEntry(acl_file, pathname, method);
 	if (!allowed_groups) {
 	    if (TRACE)
-	        fprintf(stderr, "%s `%s' %s\n",
-			        "No entry for file", pathname, "in ACL");
+		fprintf(stderr, "%s `%s' %s\n",
+				"No entry for file", pathname, "in ACL");
 	    HTAA_closeAcl(acl_file);
 	    return HTAA_NO_ENTRY;  /* Forbidden -- no entry in the ACL */
 	}
@@ -414,16 +414,16 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 **			Kerberos-ticket).
 **
 ** ON EXIT:
-**	returns	status codes uniform with those of HTTP:
+**	returns status codes uniform with those of HTTP:
 **	  200 OK	   if file access is ok.
 **	  401 Unauthorized if user is not authorized to
 **			   access the file.
-**	  403 Forbidden	   if there is no entry for the
+**	  403 Forbidden    if there is no entry for the
 **			   requested file in the ACL.
 **
 ** NOTE:
 **	This function does not check whether the file
-**	exists or not -- so the status  404 Not found
+**	exists or not -- so the status	404 Not found
 **	must be returned from somewhere else (this is
 **	to avoid unnecessary overhead of opening the
 **	file twice).
@@ -432,7 +432,7 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(CONST char *,  pathname,
 PUBLIC int HTAA_checkAuthorization ARGS4(CONST char *,	url,
 					 CONST char *,	method_name,
 					 CONST char *,	scheme_name,
-                                         char *,	scheme_specifics)
+					 char *,	scheme_specifics)
 {
     static char *pathname = NULL;
     char *local_copy = NULL;
@@ -465,8 +465,8 @@ PUBLIC int HTAA_checkAuthorization ARGS4(CONST char *,	url,
     }
     else {
 	pathname = HTTranslate(local_copy); /* Translate rules even if */
-	                                    /* a /htbin call to set up */
-	                                    /* protections.	       */
+					    /* a /htbin call to set up */
+					    /* protections.	       */
 	if (0 == strncmp(local_copy, "/htbin/", 7)) {
 	    if (!HTBinDir)
 		HTAAFailReason = HTAA_HTBIN;
@@ -483,7 +483,7 @@ PUBLIC int HTAA_checkAuthorization ARGS4(CONST char *,	url,
 
 	if (!pathname) {		/* Forbidden by rule */
 	    if (TRACE)
-	        fprintf(stderr, "HTAA_checkAuthorization: Forbidden by rule\n");
+		fprintf(stderr, "HTAA_checkAuthorization: Forbidden by rule\n");
 	    HTAAFailReason = HTAA_BY_RULE;
 	}
 	else if (HTAAFailReason != HTAA_HTBIN) {
@@ -574,7 +574,7 @@ PUBLIC int HTAA_checkAuthorization ARGS4(CONST char *,	url,
 **	prot		protection setup structure.
 **
 ** ON EXIT:
-**	returns		scheme specific parameters in an
+**	returns 	scheme specific parameters in an
 **			auto-freed string.
 */
 PRIVATE char *compose_scheme_specifics ARGS2(HTAAScheme,	scheme,
@@ -621,7 +621,7 @@ PRIVATE char *compose_scheme_specifics ARGS2(HTAAScheme,	scheme,
 **	authentication scheme was used.
 **
 ** ON EXIT:
-**	returns	a buffer containing all the WWW-Authenticate:
+**	returns a buffer containing all the WWW-Authenticate:
 **		fields including CRLFs (this buffer is auto-freed).
 **		NULL, if authentication won't help in accessing
 **		the requested document.
@@ -643,7 +643,7 @@ PUBLIC char *HTAA_composeAuthHeaders NOARGS
 	return NULL;
     }
     else if (TRACE)
-        fprintf(stderr, "HTAA_composeAuthHeaders: for file `%s'\n",
+	fprintf(stderr, "HTAA_composeAuthHeaders: for file `%s'\n",
 			prot->filename);
 
     FREE(result);	/* From previous call */
@@ -664,11 +664,11 @@ PUBLIC char *HTAA_composeAuthHeaders NOARGS
 		strcat(result, "\r\n");
 	    } /* scheme name found */
 	    else if (TRACE)
-	        fprintf(stderr, "HTAA_composeAuthHeaders: %s %d\n",
+		fprintf(stderr, "HTAA_composeAuthHeaders: %s %d\n",
 				"No name found for scheme number", scheme);
 	} /* scheme valid for requested document */
     } /* for every scheme */
-    
+
     return result;
 }
 
diff --git a/WWW/Library/Implementation/HTAAUtil.c b/WWW/Library/Implementation/HTAAUtil.c
index 837f09c7..a7cad59b 100644
--- a/WWW/Library/Implementation/HTAAUtil.c
+++ b/WWW/Library/Implementation/HTAAUtil.c
@@ -33,7 +33,7 @@
 **
 ** AUTHORS:
 **	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**	MD 	Mark Donszelmann    duns@vxdeop.cern.ch
+**	MD	Mark Donszelmann    duns@vxdeop.cern.ch
 **
 ** HISTORY:
 **	 8 Nov 93  MD	(VMS only) Added case insensitive comparison in HTAA_templateCaseMatch
@@ -62,7 +62,7 @@
 **	name		is a string representing the scheme name.
 **
 ** ON EXIT:
-**	returns		the enumerated constant for that scheme.
+**	returns 	the enumerated constant for that scheme.
 */
 PUBLIC HTAAScheme HTAAScheme_enum ARGS1(CONST char*, name)
 {
@@ -70,7 +70,7 @@ PUBLIC HTAAScheme HTAAScheme_enum ARGS1(CONST char*, name)
     char *cur;
 
     if (!name)
-        return HTAA_UNKNOWN;
+	return HTAA_UNKNOWN;
 
     StrAllocCopy(upcased, name);
     cur = upcased;
@@ -78,24 +78,24 @@ PUBLIC HTAAScheme HTAAScheme_enum ARGS1(CONST char*, name)
 	*cur = TOUPPER(*cur);
 	cur++;
     }
-    
+
     if (!strncmp(upcased, "NONE", 4)) {
-        FREE(upcased);
+	FREE(upcased);
 	return HTAA_NONE;
     } else if (!strncmp(upcased, "BASIC", 5)) {
-        FREE(upcased);
+	FREE(upcased);
 	return HTAA_BASIC;
     } else if (!strncmp(upcased, "PUBKEY", 6)) {
-        FREE(upcased);
+	FREE(upcased);
 	return HTAA_PUBKEY;
     } else if (!strncmp(upcased, "KERBEROSV4", 10)) {
-        FREE(upcased);
+	FREE(upcased);
 	return HTAA_KERBEROS_V4;
     } else if (!strncmp(upcased, "KERBEROSV5", 10)) {
-        FREE(upcased);
+	FREE(upcased);
 	return HTAA_KERBEROS_V5;
     } else {
-        FREE(upcased);
+	FREE(upcased);
 	return HTAA_UNKNOWN;
     }
 }
@@ -108,13 +108,13 @@ PUBLIC HTAAScheme HTAAScheme_enum ARGS1(CONST char*, name)
 **			HTAA_NONE, HTAA_BASIC, HTAA_PUBKEY, ...
 **
 ** ON EXIT:
-**	returns		the name of the scheme, i.e.
+**	returns 	the name of the scheme, i.e.
 **			"None", "Basic", "Pubkey", ...
 */
 PUBLIC char *HTAAScheme_name ARGS1(HTAAScheme, scheme)
 {
     switch (scheme) {
-        case HTAA_NONE:
+	case HTAA_NONE:
 	    return "None";
 	    break;
 	case HTAA_BASIC:
@@ -144,7 +144,7 @@ PUBLIC char *HTAAScheme_name ARGS1(HTAAScheme, scheme)
 **	name		is the method name to translate.
 **
 ** ON EXIT:
-**	returns		HTAAMethod enumerated value corresponding
+**	returns 	HTAAMethod enumerated value corresponding
 **			to the given name.
 */
 PUBLIC HTAAMethod HTAAMethod_enum ARGS1(CONST char *, name)
@@ -154,7 +154,7 @@ PUBLIC HTAAMethod HTAAMethod_enum ARGS1(CONST char *, name)
     char *dest = tmp;
 
     if (!name)
-        return METHOD_UNKNOWN;
+	return METHOD_UNKNOWN;
 
     while (*src) {
 	*dest = TOUPPER(*src);
@@ -179,23 +179,23 @@ PUBLIC HTAAMethod HTAAMethod_enum ARGS1(CONST char *, name)
 **			METHOD_GET, METHOD_PUT, ...
 **
 ** ON EXIT:
-**	returns		the name of the scheme, i.e.
+**	returns 	the name of the scheme, i.e.
 **			"GET", "PUT", ...
 */
 PUBLIC char *HTAAMethod_name ARGS1(HTAAMethod, method)
 {
     switch (method) {
       case METHOD_GET:
-          return "GET";
+	  return "GET";
 	  break;
       case METHOD_PUT:
-          return "PUT";
+	  return "PUT";
 	  break;
       case METHOD_UNKNOWN:
-          return "UNKNOWN";
+	  return "UNKNOWN";
 	  break;
       default:
-          return "THIS-IS-A-BUG";
+	  return "THIS-IS-A-BUG";
     }
 }
 
@@ -207,10 +207,10 @@ PUBLIC char *HTAAMethod_name ARGS1(HTAAMethod, method)
 **	list		is a list of method names.
 **
 ** ON EXIT:
-**	returns		YES, if method was found.
+**	returns 	YES, if method was found.
 **			NO, if not found.
 */
-PUBLIC BOOL HTAAMethod_inList ARGS2(HTAAMethod,	method,
+PUBLIC BOOL HTAAMethod_inList ARGS2(HTAAMethod, method,
 				    HTList *,	list)
 {
     HTList *cur = list;
@@ -246,10 +246,10 @@ PUBLIC BOOL HTAAMethod_inList ARGS2(HTAAMethod,	method,
 **			agaist the template.
 **
 ** ON EXIT:
-**	returns		YES, if filename matches the template.
+**	returns 	YES, if filename matches the template.
 **			NO, otherwise.
 */
-PUBLIC BOOL HTAA_templateMatch ARGS2(CONST char *, template, 
+PUBLIC BOOL HTAA_templateMatch ARGS2(CONST char *, template,
 				     CONST char *, filename)
 {
     CONST char *p = template;
@@ -260,7 +260,7 @@ PUBLIC BOOL HTAA_templateMatch ARGS2(CONST char *, template,
 	; /* do nothing else */
 
     if (!*p && !*q)
-        return YES;			/* Equally long equal strings */
+	return YES;			/* Equally long equal strings */
     else if ('*' == *p) {		/* Wildcard */
 	p++;				/* Skip wildcard character */
 	m = strlen(q) - strlen(p);	/* Amount to match to wildcard */
@@ -268,14 +268,14 @@ PUBLIC BOOL HTAA_templateMatch ARGS2(CONST char *, template,
 	    return NO;			/* No match, filename too short */
 	else {			/* Skip the matched characters and compare */
 	    if (strcmp(p, q+m))
-	        return NO;	/* Tail mismatch */
+		return NO;	/* Tail mismatch */
 	    else
-	        return YES;	/* Tail match */
+		return YES;	/* Tail match */
 	}
     }	/* if wildcard */
     else
-        return NO;		/* Length or character mismatch */
-}    
+	return NO;		/* Length or character mismatch */
+}
 
 
 /* PUBLIC						HTAA_templateCaseMatch()
@@ -284,7 +284,7 @@ PUBLIC BOOL HTAA_templateMatch ARGS2(CONST char *, template,
 ** NOTE:
 **	This is essentially the same code as in HTAA_templateMatch, but
 **	it compares case insensitive (for VMS). Reason for this routine
-**	is that HTAA_templateMatch gets called from several places, also 
+**	is that HTAA_templateMatch gets called from several places, also
 **	there where a case sensitive match is needed, so one cannot just
 **	change the HTAA_templateMatch routine for VMS.
 **
@@ -297,11 +297,11 @@ PUBLIC BOOL HTAA_templateMatch ARGS2(CONST char *, template,
 **			agaist the template.
 **
 ** ON EXIT:
-**	returns		YES, if filename matches the template.
+**	returns 	YES, if filename matches the template.
 **			NO, otherwise.
 */
-PUBLIC BOOL HTAA_templateCaseMatch ARGS2(CONST char *, template, 
-			        	 CONST char *, filename)
+PUBLIC BOOL HTAA_templateCaseMatch ARGS2(CONST char *, template,
+					 CONST char *, filename)
 {
     CONST char *p = template;
     CONST char *q = filename;
@@ -312,7 +312,7 @@ PUBLIC BOOL HTAA_templateCaseMatch ARGS2(CONST char *, template,
 	; /* do nothing else */
 
     if (!*p && !*q)
-        return YES;			/* Equally long equal strings */
+	return YES;			/* Equally long equal strings */
     else if ('*' == *p) {		/* Wildcard */
 	p++;				/* Skip wildcard character */
 	m = strlen(q) - strlen(p);	/* Amount to match to wildcard */
@@ -320,14 +320,14 @@ PUBLIC BOOL HTAA_templateCaseMatch ARGS2(CONST char *, template,
 	    return NO;			/* No match, filename too short */
 	else {			/* Skip the matched characters and compare */
 	    if (strcasecomp(p, q+m))
-	        return NO;	/* Tail mismatch */
+		return NO;	/* Tail mismatch */
 	    else
-	        return YES;	/* Tail match */
+		return YES;	/* Tail match */
 	}
     }	/* if wildcard */
     else
-        return NO;		/* Length or character mismatch */
-}    
+	return NO;		/* Length or character mismatch */
+}
 
 
 /* PUBLIC					HTAA_makeProtectionTemplate()
@@ -337,10 +337,10 @@ PUBLIC BOOL HTAA_templateCaseMatch ARGS2(CONST char *, template,
 **		it to tell the client, and by browser if server
 **		didn't send WWW-ProtectionTemplate: field)
 ** ON ENTRY:
-**	docname	is the document pathname (from URL).
+**	docname is the document pathname (from URL).
 **
 ** ON EXIT:
-**	returns	a template matching docname, and other files
+**	returns a template matching docname, and other files
 **		files in that directory.
 **
 **		E.g.  /foo/bar/x.html  =>  /foo/bar/ *
@@ -365,11 +365,11 @@ PUBLIC char *HTAA_makeProtectionTemplate ARGS1(CONST char *, docname)
 	StrAllocCat(template, "*");
     }
     else
-        StrAllocCopy(template, "*");
+	StrAllocCopy(template, "*");
 
     if (TRACE)
-        fprintf(stderr, "make_template: made template `%s' for file `%s'\n",
-		        template, docname);
+	fprintf(stderr, "make_template: made template `%s' for file `%s'\n",
+			template, docname);
 
     return template;
 }
@@ -407,7 +407,7 @@ PUBLIC char *HTAA_makeProtectionTemplate ARGS1(CONST char *, docname)
 **			   name = "value" ,  foo = "bar"
 **
 ** ON EXIT:
-**	returns	a list of name-value pairs (actually HTAssocList*).
+**	returns a list of name-value pairs (actually HTAssocList*).
 **		For items with no name, just value, the name is
 **		the number of order number of that item. E.g.
 **		"1" for the first, etc.
@@ -420,7 +420,7 @@ PUBLIC HTAssocList *HTAA_parseArgList ARGS1(char *, str)
     int n = 0;
 
     if (!str)
-        return assoc_list;
+	return assoc_list;
 
     while (*str) {
 	SKIPWS(str);				/* Skip leading whitespace */
@@ -458,7 +458,7 @@ PUBLIC HTAssocList *HTAA_parseArgList ARGS1(char *, str)
 	    }
 	}
 	else {	/* No name, just a value */
-	    if (*cur == ',') 
+	    if (*cur == ',')
 		*(cur++) = '\0';		/* Terminate value */
 	    /* else last value on line (already terminated by NULL) */
 	    StrAllocCopy(name, "nnn");	/* Room for item order number */
@@ -496,15 +496,15 @@ PRIVATE int in_soc = -1;
 **	soc		is the socket to use when start_of_headers
 **			buffer is used up.
 ** ON EXIT:
-**	returns		nothing.
+**	returns 	nothing.
 **			Subsequent calls to HTAA_getUnfoldedLine()
 **			will use this buffer first and then
 **			proceed to read from socket.
 */
 PUBLIC void HTAA_setupReader ARGS4(char *,	start_of_headers,
-				   int,		length,
+				   int, 	length,
 				   void *,	handle,
-				   int,		soc)
+				   int, 	soc)
 {
     start_pointer = buffer;
     if (start_of_headers) {
@@ -527,8 +527,8 @@ PUBLIC void HTAA_setupReader ARGS4(char *,	start_of_headers,
 **	this function to set up internal buffer.
 **
 ** ON EXIT:
-**	returns	a newly-allocated character string representing
-**		the read line.  The line is unfolded, i.e.
+**	returns a newly-allocated character string representing
+**		the read line.	The line is unfolded, i.e.
 **		lines that begin with whitespace are appended
 **		to current line.  E.g.
 **
@@ -549,7 +549,7 @@ PUBLIC char *HTAA_getUnfoldedLine NOARGS
     BOOL peek_for_folding = NO;
 
     if (in_soc < 0) {
-        if (TRACE)
+	if (TRACE)
 	    fprintf(stderr, "%s %s\n",
 			    "HTAA_getUnfoldedLine: buffer not initialized",
 			    "with function HTAA_setupReader()");
@@ -581,7 +581,7 @@ PUBLIC char *HTAA_getUnfoldedLine NOARGS
 
 
 	/* Unfolding */
-	
+
 	if (peek_for_folding) {
 	    if (*cur != ' '  &&  *cur != '\t')
 		return line;	/* Ok, no continuation line */
@@ -595,7 +595,7 @@ PUBLIC char *HTAA_getUnfoldedLine NOARGS
 	while (cur < end_pointer && *cur != '\n') /* Find the end-of-line */
 	    cur++;				  /* (or end-of-buffer).  */
 
-	
+
 	/* Terminating line */
 
 	if (cur < end_pointer) {	/* So *cur==LF, terminate line */
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index 90b56d3b..f147d8c5 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -58,6 +58,7 @@
 #include "HTAlert.h"
 #include "HTCJK.h"
 #include "UCMap.h"
+#include "GridText.h"
 
 #include "LYexit.h"
 #include "LYLeaks.h"
diff --git a/WWW/Library/Implementation/HTAuth.c b/WWW/Library/Implementation/HTAuth.c
index 8d2ec4ca..c3364db9 100644
--- a/WWW/Library/Implementation/HTAuth.c
+++ b/WWW/Library/Implementation/HTAuth.c
@@ -30,7 +30,7 @@
 **			from browser.
 **
 ** ON EXIT:
-**	returns		a node representing the user information
+**	returns 	a node representing the user information
 **			(as always, this is automatically freed
 **			by AA package).
 */
@@ -45,23 +45,23 @@ PRIVATE HTAAUser *decompose_auth_string ARGS2(char *,		authstring,
     char *timestamp = NULL;
     char *browsers_key = NULL;
 
-    if (!user && !(user = (HTAAUser*)malloc(sizeof(HTAAUser))))	/* Allocated */
+    if (!user && !(user = (HTAAUser*)malloc(sizeof(HTAAUser)))) /* Allocated */
 	outofmem(__FILE__, "decompose_auth_string");		/* only once */
 
     user->scheme = scheme;
     user->username = NULL;	/* Not freed, because freeing */
     user->password = NULL;	/* cleartext also frees these */
-    user->inet_addr = NULL;	/* See below: ||              */
-    user->timestamp = NULL;	/*            ||              */
-    user->secret_key = NULL;	/*            ||              */
-                                /*            \/              */
+    user->inet_addr = NULL;	/* See below: ||	      */
+    user->timestamp = NULL;	/*	      ||	      */
+    user->secret_key = NULL;	/*	      ||	      */
+				/*	      \/	      */
     FREE(cleartext);	/* From previous call.				*/
-                        /* NOTE: parts of this memory are pointed to by	*/
-                        /* pointers in HTAAUser structure. Therefore,	*/
-                        /* this also frees all the strings pointed to	*/
+			/* NOTE: parts of this memory are pointed to by */
+			/* pointers in HTAAUser structure. Therefore,	*/
+			/* this also frees all the strings pointed to	*/
 			/* by the static 'user'.			*/
 
-    if (!authstring || !*authstring || 
+    if (!authstring || !*authstring ||
 	scheme != HTAA_BASIC || scheme == HTAA_PUBKEY)
 	return NULL;
 
@@ -85,7 +85,7 @@ PRIVATE HTAAUser *decompose_auth_string ARGS2(char *,		authstring,
     else {   /* Just uudecode */
 	int bytes_decoded;
 	int len = strlen(authstring) + 1;
-	
+
 	if (!(cleartext = (char*)malloc(len)))
 	    outofmem(__FILE__, "decompose_auth_string");
 	bytes_decoded = HTUU_decode(authstring,
@@ -111,7 +111,7 @@ PRIVATE HTAAUser *decompose_auth_string ARGS2(char *,		authstring,
 ** Extract rest of the fields
 */
     if (scheme == HTAA_PUBKEY) {
-	if (                          !(i_net_adr   =strchr(password, ':')) || 
+	if (			      !(i_net_adr   =strchr(password, ':')) ||
 	    (*(i_net_adr++)   ='\0'), !(timestamp   =strchr(i_net_adr,':')) ||
 	    (*(timestamp++)   ='\0'), !(browsers_key=strchr(timestamp,':')) ||
 	    (*(browsers_key++)='\0')) {
@@ -142,7 +142,7 @@ PRIVATE HTAAUser *decompose_auth_string ARGS2(char *,		authstring,
 		    "Pubkey scheme authentication string:",
 		    username, password, i_net_adr, timestamp, browsers_key);
     }
-    
+
     return user;
 }
 
@@ -171,7 +171,7 @@ PRIVATE BOOL HTAA_checkInetAddress ARGS1(CONST char *, i_net_adr)
 **			for the file.
 **
 ** ON EXIT:
-**	returns		NULL, if authentication failed.
+**	returns 	NULL, if authentication failed.
 **			Otherwise a pointer to a structure
 **			representing authenticated user,
 **			which should not be freed.
@@ -189,7 +189,7 @@ PUBLIC HTAAUser *HTAA_authenticate ARGS3(HTAAScheme,	scheme,
       case HTAA_PUBKEY:
 	{
 	    HTAAUser *user = decompose_auth_string(scheme_specifics, scheme);
-	                                   /* Remember, user is auto-freed */
+					   /* Remember, user is auto-freed */
 	    if (user &&
 		HTAA_checkPassword(user->username,
 				   user->password,
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 245e515a..8c014f76 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -1746,7 +1746,7 @@ PRIVATE void parse_windows_nt_dir_entry ARGS2(
     }
     if (strlen(cp) == 8 &&
 	isdigit(*cp) && isdigit(*(cp+1)) && *(cp+2) == '-' &&
-	isdigit(*(cp+3)) && isdigit(*(cp+1)) && *(cp+5) == '-') {
+	isdigit(*(cp+3)) && isdigit(*(cp+4)) && *(cp+5) == '-') {
 	*(cp+2)  = '\0';	/* Month */
 	i = atoi(cp) - 1;
 	*(cp+5) = '\0';		/* Day */
@@ -1756,12 +1756,10 @@ PRIVATE void parse_windows_nt_dir_entry ARGS2(
 	cp += 6;			/* Year */
 	if (strcmp((ThisYear+2), cp)) {
 	    /* Not this year, so show the year */
-	    if (atoi(cp) < atoi((char *)&ThisYear[2])) {
-		sprintf((char *)&date[6], "  %c%c%s",
-				          ThisYear[0], ThisYear[1], cp);
+	    if (atoi(cp) < 70) {
+		sprintf((char *)&date[6], "  20%s", cp);
 	    } else {
-		sprintf((char *)&date[6], "  %c%c%s",
-					  LastYear[0], LastYear[1], cp);
+		sprintf((char *)&date[6], "  19%s", cp);
 	    }
 	} else {
 	    /* Is this year, so show the time */
@@ -1936,12 +1934,10 @@ PRIVATE void parse_cms_dir_entry ARGS2(
 	    cpd += 6;		/* Year */
 	    if (strcmp((ThisYear+2), cpd)) {
 	        /* Not this year, so show the year. */
-		if (atoi(cpd) < atoi((char *)&ThisYear[2])) {
-		    sprintf((char *)&date[6], "  %c%c%s",
-					      ThisYear[0], ThisYear[1], cpd);
+		if (atoi(cpd) < 70) {
+		    sprintf((char *)&date[6], "  20%s", cpd);
 		} else {
-		    sprintf((char *)&date[6], "  %c%c%s",
-					      LastYear[0], LastYear[1], cpd);
+		    sprintf((char *)&date[6], "  19%s", cpd);
 		}
 	    } else {
 	        /* Is this year, so show the time. */
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 94815710..e2bcd56f 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -30,7 +30,7 @@
 #include <dirent.h>
 #define USE_DIRENT
 #include "HTDOS.h"
-#endif
+#endif /* DOSPATH */
 
 #include "HTUtils.h"
 #include "tcp.h"
@@ -996,7 +996,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3(
     FREE(cp);
 
     /*
-    **  Set up defaults, if needed. - FM
+    **	Set up defaults, if needed. - FM
     */
     if (!chartrans_ok && !anchor->charset && default_LYhndl >= 0) {
 	HTAnchor_setUCInfoStage(anchor, default_LYhndl,
@@ -1206,7 +1206,7 @@ PUBLIC void HTDirEntry ARGS3(
 **
 **  On exit:
 **	Returns TRUE if an "Up to <parent>" link was not created
-**	for a readable local directiory because LONG_LIST is defined
+**	for a readable local directory because LONG_LIST is defined
 **	and NO_PARENT_DIR_REFERENCE is not defined, such that the
 **	calling function use LYListFmtParse() to create a link to
 **	the parent directory.  Otherwise, it returns FALSE. - FM
@@ -1439,7 +1439,7 @@ PUBLIC BOOL HTDirTitles ARGS3(
 **			This is the physical address of the file
 **
 **  On exit:
-**	returns 	<0		Error has occured.
+**	returns 	<0		Error has occurred.
 **			HTLOADED	OK
 **
 */
@@ -1504,7 +1504,7 @@ PUBLIC int HTLoadFile ARGS4(
 	/*
 	 *  If content_type and content_encoding are BOTH already set
 	 *  in the anchor object, we believe it and don't try to
-	 *  derive format and ancoding from the filename. - kw
+	 *  derive format and encoding from the filename. - kw
 	 */
 	format = HTAtom_for(anchor->content_type);
 	myEncoding = HTAtom_for(anchor->content_encoding);
@@ -1573,7 +1573,7 @@ PUBLIC int HTLoadFile ARGS4(
 	fp = fopen(vmsname, "r", "shr=put", "shr=upd");
 
 	/*
-	**  If the file wasn't VMS syntax, then perhaps it is ultrix.
+	**  If the file wasn't VMS syntax, then perhaps it is Ultrix.
 	*/
 	if (!fp) {
 	    char ultrixname[INFINITY];
@@ -1726,7 +1726,7 @@ PUBLIC int HTLoadFile ARGS4(
 		fclose(fp);
 	    }
 	    return status;
-	}  /* If successfull open */
+	}  /* If successful open */
 	FREE(filename);
     }
 
@@ -1884,7 +1884,7 @@ PUBLIC int HTLoadFile ARGS4(
 	**  is create a new hypertext object containing a list of files and
 	**  subdirectories contained in the directory.	All of these are
 	**  links to the directories or files listed.
-	**  NB This assumes the existance of a type 'STRUCT_DIRENT', which
+	**  NB This assumes the existence of a type 'STRUCT_DIRENT', which
 	**  will hold the directory entry, and a type 'DIR' which is used
 	**  to point to the current directory being read.
 	*/
@@ -1974,7 +1974,7 @@ PUBLIC int HTLoadFile ARGS4(
 		    */
 		    StrAllocCopy (tail, "/foo/..");
 		} else {
-		    char *p = strrchr(pathname, '/');  /* find lastslash */
+		    char *p = strrchr(pathname, '/');  /* find last slash */
 
 		    if (!p) {
 			/*
@@ -2367,7 +2367,7 @@ PUBLIC int HTLoadFile ARGS4(
 		    fclose(fp);
 		}
 		return status;
-	    }  /* If succesfull open */
+	    }  /* If successful open */
 	    FREE(localname);
 	}  /* scope of fp */
     }  /* local unix file system */
@@ -2380,7 +2380,7 @@ PUBLIC int HTLoadFile ARGS4(
     */
     {
 	/*
-	**  Deal with case-sensitivity differences on VMS verus Unix.
+	**  Deal with case-sensitivity differences on VMS versus Unix.
 	*/
 #ifdef VMS
 	if (strcasecomp(nodename, HTHostName()) != 0)
diff --git a/WWW/Library/Implementation/HTFile.h b/WWW/Library/Implementation/HTFile.h
index ba94597a..b65c17e7 100644
--- a/WWW/Library/Implementation/HTFile.h
+++ b/WWW/Library/Implementation/HTFile.h
@@ -12,7 +12,9 @@
 
 #include "HTFormat.h"
 #include "HTAccess.h"
+#ifndef HTML_H
 #include "HTML.h"               /* SCW */
+#endif /* HTML_H */
 
 /*
 **  Controlling globals
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index cf36c304..c05af1fa 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -512,7 +512,7 @@ PUBLIC float HTStackValue ARGS4(
 PUBLIC int HTCopy ARGS4(
 	HTParentAnchor *,	anchor,
 	int,			file_number,
-	void*,			handle,
+	void*,			handle GCC_UNUSED,
 	HTStream*,		sink)
 {
     HTStreamClass targetClass;
@@ -806,7 +806,7 @@ PRIVATE int HTGzFileCopy ARGS2(
 **
 */
 PUBLIC void HTCopyNoCR ARGS3(
-	HTParentAnchor *,	anchor,
+	HTParentAnchor *,	anchor GCC_UNUSED,
 	int,			file_number,
 	HTStream*,		sink)
 {
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 53e4149b..23e8f9d0 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -211,7 +211,7 @@ PRIVATE void write_anchor ARGS2(CONST char *,text, CONST char *,addr)
 **	============================
 */
 PRIVATE void parse_menu ARGS2(
-	CONST char *,		arg,
+	CONST char *,		arg GCC_UNUSED,
 	HTParentAnchor *,	anAnchor)
 {
     char gtype;
@@ -865,7 +865,7 @@ PRIVATE int interpret_cso_key ARGS5(
 	/*
 	**  No match, dump key to buffer so client sees it for debugging.
 	*/
-	int out = 0;
+	size_t out = 0;
 	while (*key && (*key != ')')) {
 	    buf[out++] = (*key++);
 	    if (out > sizeof(buf)-2) {
@@ -936,7 +936,8 @@ PRIVATE int parse_cso_fields ARGS2(
 {
     char ch;
     char *p = buf;
-    int i, code = 0, prev_code, alen;
+    int i, code = 0, prev_code;
+    size_t alen;
     char *indx, *name;
     CSOfield_info *last, *new;
 
@@ -1103,7 +1104,8 @@ PRIVATE int generate_cso_form ARGS4(
 	char *, 	buf,
 	HTStream *,	Target)
 {
-    int i, j, length, out;
+    int i, j, length;
+    size_t out;
     int full_flag = 1;
     char *key, *line;
     CSOformgen_context ctx;
diff --git a/WWW/Library/Implementation/HTML.h b/WWW/Library/Implementation/HTML.h
deleted file mode 100644
index be492b28..00000000
--- a/WWW/Library/Implementation/HTML.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*					HTML to rich text converter for libwww
-**
-**			THE HTML TO RTF OBJECT CONVERTER
-**
-**  This interprets the HTML semantics.
-*/
-#ifndef HTML_H
-#define HTML_H
-
-#ifndef HTUTILS_H
-#include "HTUtils.h"
-#endif /* HTUTILS_H */
-#include "UCDefs.h"
-#include "UCAux.h"
-#include "HTAnchor.h"
-#include "HTMLDTD.h"
-
-#ifdef SHORT_NAMES
-#define HTMLPresentation	HTMLPren
-#define HTMLPresent		HTMLPres
-#endif /* SHORT_NAMES */
-
-extern CONST HTStructuredClass HTMLPresentation;
-
-#ifdef Lynx_HTML_Handler
-/*
-**	This section is semi-private to HTML.c and it's helper modules. - FM
-**	--------------------------------------------------------------------
-*/
-
-typedef struct _stack_element {
-	HTStyle *	style;
-	int		tag_number;
-} stack_element;
-
-/*		HTML Object
-**		-----------
-*/
-#define MAX_NESTING 800 	/* Should be checked by parser */
-
-struct _HTStructured {
-    CONST HTStructuredClass *	isa;
-    HTParentAnchor *		node_anchor;
-    HText *			text;
-
-    HTStream*			target; 		/* Output stream */
-    HTStreamClass		targetClass;		/* Output routines */
-
-    HTChildAnchor *		CurrentA;	/* current HTML_A anchor */
-    int 			CurrentANum;	/* current HTML_A number */
-    char *			base_href;	/* current HTML_BASE href */
-    char *			map_address;	/* current HTML_MAP address */
-
-    HTChunk			title;		/* Grow by 128 */
-    HTChunk			object; 	/* Grow by 128 */
-    BOOL			object_started;
-    BOOL			object_declare;
-    BOOL			object_shapes;
-    BOOL			object_ismap;
-    char *			object_usemap;
-    char *			object_id;
-    char *			object_title;
-    char *			object_data;
-    char *			object_type;
-    char *			object_classid;
-    char *			object_codebase;
-    char *			object_codetype;
-    char *			object_name;
-    HTChunk			option; 	/* Grow by 128 */
-    BOOL			first_option;	/* First OPTION in SELECT? */
-    char *			LastOptionValue;
-    BOOL			LastOptionChecked;
-    BOOL			select_disabled;
-    HTChunk			textarea;	/* Grow by 128 */
-    char *			textarea_name;
-    int 			textarea_name_cs;
-    char *			textarea_accept_cs;
-    char *			textarea_cols;
-    int 			textarea_rows;
-    int 			textarea_disabled;
-    char *			textarea_id;
-    HTChunk			math;		/* Grow by 128 */
-    HTChunk			style_block;	/* Grow by 128 */
-    HTChunk			script; 	/* Grow by 128 */
-
-    /*
-     *	Used for nested lists. - FM
-     */
-    int 	List_Nesting_Level;	/* counter for list nesting level */
-    int 	OL_Counter[12]; 	/* counter for ordered lists */
-    char	OL_Type[12];		/* types for ordered lists */
-    int 	Last_OL_Count;		/* last count in ordered lists */
-    char	Last_OL_Type;		/* last type in ordered lists */
-
-    int 			Division_Level;
-    short			DivisionAlignments[MAX_NESTING];
-    int 			Underline_Level;
-    int 			Quote_Level;
-
-    BOOL			UsePlainSpace;
-    BOOL			HiddenValue;
-    int 			lastraw;
-
-    char *			comment_start;	/* for literate programming */
-    char *			comment_end;
-
-    HTTag *			current_tag;
-    BOOL			style_change;
-    HTStyle *			new_style;
-    HTStyle *			old_style;
-    int 			current_default_alignment;
-    BOOL			in_word;  /* Have just had a non-white char */
-    stack_element	stack[MAX_NESTING];
-    stack_element	*sp;		/* Style stack pointer */
-    BOOL		stack_overrun;	/* Was MAX_NESTING exceeded? */
-    int 		skip_stack; /* flag to skip next style stack operation */
-
-    /*
-    **	Track if we are in an anchor, paragraph, address, base, etc.
-    */
-    BOOL		inA;
-    BOOL		inAPPLET;
-    BOOL		inAPPLETwithP;
-    BOOL		inBadBASE;
-    BOOL		inBadHREF;
-    BOOL		inBadHTML;
-    BOOL		inBASE;
-    BOOL		inBoldA;
-    BOOL		inBoldH;
-    BOOL		inCAPTION;
-    BOOL		inCREDIT;
-    BOOL		inFIG;
-    BOOL		inFIGwithP;
-    BOOL		inFONT;
-    BOOL		inFORM;
-    BOOL		inLABEL;
-    BOOL		inP;
-    BOOL		inPRE;
-    BOOL		inSELECT;
-    BOOL		inTABLE;
-    BOOL		inTEXTAREA;
-    BOOL		inUnderline;
-
-    BOOL		needBoldH;
-
-    /*
-    **	UCI and UCLYhndl give the UCInfo and charset registered for
-    **	the HTML parser in the node_anchor's UCStages structure.  It
-    **	indicates what is fed to the HTML parser as the stream of character
-    **	data (not necessarily tags and attributes).  It should currently
-    **	always be set to be the same as UCI and UCLhndl for the HTEXT stage
-    **	in the node_anchor's UCStages structure, since the HTML parser sends
-    **	its input character data to the output without further charset
-    **	translation.
-    */
-    LYUCcharset *	UCI;
-    int 		UCLYhndl;
-    /*
-    **	inUCI and inUCLYhndl indicate the UCInfo and charset which the
-    **	HTML parser treats at the input charset.  It is normally set
-    **	to the UCI and UCLhndl for the SGML parser in the node_anchor's
-    **	UCStages structure (which may be a dummy, based on the MIME
-    **	parser's UCI and UCLhndl in that structure, when we are handling
-    **	a local file or non-http(s) gateway).  It could be changed
-    **	temporarily by the HTML parser, for conversions of attribute
-    **	strings, but should be reset once done. - FM
-    */
-    LYUCcharset *	inUCI;
-    int 		inUCLYhndl;
-    /*
-    **	outUCI and outUCLYhndl indicate the UCInfo and charset which
-    **	the HTML parser treats as the output charset.  It is normally
-    **	set to its own UCI and UCLhndl.  It could be changed for
-    **	conversions of attribute strings, but should be reset once
-    **	done. - FM
-    */
-    LYUCcharset *	outUCI;
-    int 		outUCLYhndl;
-    /*
-    **	T holds the transformation rules for conversions of strings
-    **	between the input and output charsets by the HTML parser. - FM
-    */
-    UCTransParams	T;
-
-    int 		tag_charset; /* charset for attribute values etc. */
-};
-
-struct _HTStream {
-    CONST HTStreamClass *	isa;
-    /* .... */
-};
-
-/*
- *	Semi-Private functions. - FM
- */
-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));
-#endif /* Lynx_HTML_Handler */
-
-/*				P U B L I C
-*/
-
-/*
-**  HTConverter to present HTML
-*/
-extern HTStream* HTMLToPlain PARAMS((
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink));
-
-extern HTStream* HTMLToC PARAMS((
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink));
-
-extern HTStream* HTMLPresent PARAMS((
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink));
-
-extern HTStructured* HTML_new PARAMS((
-	HTParentAnchor * anchor,
-	HTFormat	format_out,
-	HTStream *	target));
-
-/*
-**  Names for selected internal representations.
-*/
-typedef enum _HTMLCharacterSet {
-	HTML_ISO_LATIN1,
-	HTML_NEXT_CHARS,
-	HTML_PC_CP950
-} HTMLCharacterSet;
-
-/*
-**  Record error message as a hypertext object.
-**
-**  The error message should be marked as an error so that it can be
-**  reloaded later.  This implementation just throws up an error message
-**  and leaves the document unloaded.
-**
-**  On entry,
-**	sink	is a stream to the output device if any
-**	number	is the HTTP error number
-**	message is the human readable message.
-**  On exit,
-**	a retrun code like HT_LOADED if object exists else 60; 0
-*/
-extern int HTLoadError PARAMS((
-	HTStream *	sink,
-	int		number,
-	CONST char *	message));
-
-#endif /* HTML_H */
-
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 441f081f..0d616bf1 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -13,6 +13,8 @@
 **	------------
 **
 **	This table must be matched exactly with ALL the translation tables
+**		(this is an obsolete translation mechanism,
+**		currently replaced with unicode chartrans in most cases...)
 */
 static CONST char* entities[] = {
   "AElig",	/* capital AE diphthong (ligature) */
@@ -63,7 +65,7 @@ static CONST char* entities[] = {
   "copy",	/* copyright sign */
   "curren",	/* currency sign */
   "deg",	/* degree sign */
-  "die",	/* spacing diaresis */
+  "die",	/* spacing dieresis */
   "divide",	/* division sign */
   "eacute",	/* small e, acute accent */
   "ecirc",	/* small e, circumflex accent */
@@ -106,7 +108,7 @@ static CONST char* entities[] = {
   "para",	/* paragraph sign */
   "plusmn",	/* plus-or-minus sign */
   "pound",	/* pound sign */
-  "quot",	/* quot '"' */
+  "quot",	/* quote '"' */
   "raquo",	/* angle quotation mark, right */
   "reg",	/* circled R registered sign */
   "sect",	/* section sign */
@@ -122,7 +124,7 @@ static CONST char* entities[] = {
   "uacute",	/* small u, acute accent */
   "ucirc",	/* small u, circumflex accent */
   "ugrave",	/* small u, grave accent */
-  "uml",	/* spacing diaresis */
+  "uml",	/* spacing dieresis */
   "uuml",	/* small u, dieresis or umlaut mark */
   "yacute",	/* small y, acute accent */
   "yen",	/* yen sign */
@@ -136,7 +138,7 @@ static CONST char* entities[] = {
 /*		Attribute Lists
 **		---------------
 **
-**	Lists must be in alphatbetical order by attribute name
+**	Lists must be in alphabetical order by attribute name
 **	The tag elements contain the number of attributes
 */
 static attr a_attr[] = {			/* Anchor attributes */
@@ -351,7 +353,7 @@ static attr credit_attr[] = {			/* CREDIT attributes */
 	{ 0 }	/* Terminate list */
 };
 
-static attr div_attr[] = {			/* DIV attribures */
+static attr div_attr[] = {			/* DIV attributes */
 	{ "ALIGN" },
 	{ "CLASS" },
 	{ "CLEAR" },
@@ -614,7 +616,7 @@ static attr input_attr[] = {			/* INPUT attributes */
 static attr isindex_attr[] = {			/* ISINDEX attributes */
 	{ "ACTION" },	/* Not in spec.  Lynx treats it as HREF. - FM */
 	{ "DIR" },
-	{ "HREF" },	/* HTML 3.0 attritute for search action. - FM */
+	{ "HREF" },	/* HTML 3.0 attribute for search action. - FM */
 	{ "ID" },
 	{ "LANG" },
 	{ "PROMPT" },	/* HTML 3.0 attribute for prompt string. - FM */
@@ -724,7 +726,7 @@ static attr meta_attr[] = {			/* META attributes */
 	{ 0 }	/* Terminate list */
 };
 
-static attr nextid_attr[] = {			/* NEXTID attribures */
+static attr nextid_attr[] = {			/* NEXTID attributes */
 	{ "N" }
 };
 
@@ -832,7 +834,7 @@ static attr p_attr[] = {			/* P attributes */
 	{ 0 }	/* Terminate list */
 };
 
-static attr param_attr[] = {			/* PARAM attribures */
+static attr param_attr[] = {			/* PARAM attributes */
 	{ "ACCEPT" },
 	{ "ACCEPT-CHARSET" },
 	{ "ACCEPT-ENCODING" },
@@ -854,7 +856,7 @@ static attr param_attr[] = {			/* PARAM attribures */
 	{ 0 }	/* Terminate list */
 };
 
-static attr script_attr[] = {			/* SCRIPT attribures */
+static attr script_attr[] = {			/* SCRIPT attributes */
 	{ "CLASS" },
 	{ "CLEAR" },
 	{ "DIR" },
@@ -1580,8 +1582,8 @@ PUBLIC CONST SGML_dtd HTML_dtd = {
 	HTML_ELEMENTS,
 	entities,
 	sizeof(entities)/sizeof(entities[0]),
-	extra_entities,
-	sizeof(extra_entities)/sizeof(extra_entities[0])
+	unicode_entities,
+	sizeof(unicode_entities)/sizeof(unicode_entities[0])
 };
 
 /* This function fills the "tags" part of the HTML_dtd structure with
diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c
index a918f96c..1839f3c4 100644
--- a/WWW/Library/Implementation/HTMLGen.c
+++ b/WWW/Library/Implementation/HTMLGen.c
@@ -263,8 +263,8 @@ PRIVATE void HTMLGen_start_element ARGS6(
 	int,			element_number,
 	CONST BOOL*,		present,
 	CONST char **,		value,
-	int,			charset,
-	char **,		insert)
+	int,			charset GCC_UNUSED,
+	char **,		insert GCC_UNUSED)
 {
     int i;
     BOOL was_preformatted = me->preformatted;
@@ -344,7 +344,7 @@ PRIVATE void HTMLGen_start_element ARGS6(
 PRIVATE void HTMLGen_end_element ARGS3(
 	HTStructured *, 	me,
 	int,			element_number,
-	char **,		insert)
+	char **,		insert GCC_UNUSED)
 {
     if (!me->preformatted &&
 	HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
@@ -404,14 +404,14 @@ PRIVATE void PlainToHTML_free ARGS1(
 
 PRIVATE void HTMLGen_abort ARGS2(
 	HTStructured *, 	me,
-	HTError,		e)
+	HTError,		e GCC_UNUSED)
 {
     HTMLGen_free(me);
 }
 
 PRIVATE void PlainToHTML_abort ARGS2(
 	HTStructured *, 	me,
-	HTError,		e)
+	HTError,		e GCC_UNUSED)
 {
     PlainToHTML_free(me);
 }
@@ -513,8 +513,8 @@ PRIVATE CONST HTStructuredClass PlainToHTMLConversion =
 **	------------------------------------------
 */
 PUBLIC HTStream* HTPlainToHTML ARGS3(
-	HTPresentation *,	pres,
-	HTParentAnchor *,	anchor,
+	HTPresentation *,	pres GCC_UNUSED,
+	HTParentAnchor *,	anchor GCC_UNUSED,
 	HTStream *,		sink)
 {
     HTStructured *me = (HTStructured *)malloc(sizeof(*me));
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index 91a2585b..dda98d5f 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -12,6 +12,12 @@
 
 #include "HTPlain.h"
 
+#include "HTChunk.h"
+#include "HText.h"
+#include "HTStyle.h"
+#define Lynx_HTML_Handler
+#include "HTML.h"		/* styles[] */
+
 #define BUFFER_SIZE 4096;	/* Tradeoff */
 
 #include "HText.h"
@@ -27,8 +33,6 @@
 
 #define FREE(x) if (x) {free(x); x = NULL;}
 
-extern HTStyleSheet * styleSheet;
-
 extern BOOLEAN LYRawMode;
 extern BOOL HTPassEightBitRaw;
 extern BOOL HTPassHighCtrlRaw;
@@ -43,23 +47,23 @@ struct _HTStream {
     CONST HTStreamClass *	isa;
     HText *			text;
     /*
-    **  The node_anchor UCInfo and handle for the input (PARSER) stage. - FM
+    **	The node_anchor UCInfo and handle for the input (PARSER) stage. - FM
     */
-    LYUCcharset		*	inUCI;
-    int				inUCLYhndl;
+    LYUCcharset 	*	inUCI;
+    int 			inUCLYhndl;
     /*
-    **  The node_anchor UCInfo and handle for the output (HTEXT) stage. - FM
+    **	The node_anchor UCInfo and handle for the output (HTEXT) stage. - FM
     */
     int outUCLYhndl;
     /*
-    **  Counter, value, buffer and pointer for UTF-8 handling. - FM
+    **	Counter, value, buffer and pointer for UTF-8 handling. - FM
     */
     char			utf_count;
     UCode_t			utf_char;
     char			utf_buf[8];
     char *			utf_buf_p;
     /*
-    **  The charset transformation structure. - FM
+    **	The charset transformation structure. - FM
     */
     UCTransParams		T;
 };
@@ -256,7 +260,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 	    /*
 	    **	Combine UTF-8 into Unicode.
 	    **	Incomplete characters silently ignored.
-	    **  from Linux kernel's console.c - KW
+	    **	from Linux kernel's console.c - KW
 	    */
 	    if (c_unsign > 127) {
 		/*
@@ -264,9 +268,9 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 		*/
 		if (me->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
 		    */
 		    me->utf_char = (me->utf_char << 6) | (c & 0x3f);
 		    me->utf_count--;
@@ -289,7 +293,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 		    }
 		} else {
 		    /*
-		    **  Start handling a new multibyte character. - FM
+		    **	Start handling a new multibyte character. - FM
 		    */
 		    me->utf_buf_p = me->utf_buf;
 		    me->utf_buf_p[0] = c;
@@ -318,7 +322,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 			me->utf_buf_p[0] = '\0';
 		    }
 		    /*
-		    **  Get the next byte. - FM
+		    **	Get the next byte. - FM
 		    */
 		    continue;
 		}
@@ -609,7 +613,7 @@ PRIVATE void HTPlain_free ARGS1(
 */
 PRIVATE void HTPlain_abort ARGS2(
 	HTStream *,	me,
-	HTError,	e)
+	HTError,	e GCC_UNUSED)
 {
     HTPlain_free(me);
 }
@@ -629,9 +633,9 @@ PUBLIC CONST HTStreamClass HTPlain =
 **		----------
 */
 PUBLIC HTStream* HTPlainPresent ARGS3(
-	HTPresentation *,	pres,
+	HTPresentation *,	pres GCC_UNUSED,
 	HTParentAnchor *,	anchor,
-	HTStream *,		sink)
+	HTStream *,		sink GCC_UNUSED)
 {
 
     HTStream* me = (HTStream*)malloc(sizeof(*me));
@@ -654,7 +658,7 @@ PUBLIC HTStream* HTPlainPresent ARGS3(
 		     HTAnchor_getUCInfoStage(anchor,UCT_STAGE_HTEXT));
 
     me->text = HText_new(anchor);
-    HText_setStyle(me->text, HTStyleNamed(styleSheet, "Example"));
+    HText_setStyle(me->text, styles[HTML_XMP] );
     HText_beginAppend(me->text);
 
     return (HTStream*) me;
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index bc3c3334..5f358b97 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -11,6 +11,7 @@
 #include "tcp.h"
 
 #include "LYLeaks.h"
+#include "LYStrings.h"
 
 #define FREE(x) if (x) {free(x); x = NULL;}
 
@@ -22,6 +23,58 @@ PUBLIC int WWW_TraceFlag = 0;	/* Global trace flag for ALL W3 code */
 
 PUBLIC CONST char * HTLibraryVersion = VC; /* String for help screen etc */
 
+/*
+**     strcasecomp8 is a variant of strcasecomp (below)
+**     ------------		    -----------
+**     but uses 8bit upper/lower case information
+**     from the current display charset.
+**     It returns 0 if exact match.
+*/
+PUBLIC int strcasecomp8 ARGS2(
+       CONST char*,    a,
+       CONST char *,   b)
+{
+    CONST char *p = a;
+    CONST char *q = b;
+
+    for ( ; *p && *q; p++, q++) {
+	int diff = UPPER8(*p, *q);
+	if (diff) return diff;
+    }
+    if (*p)
+	return 1;	/* p was longer than q */
+    if (*q)
+	return -1;	/* p was shorter than q */
+    return 0;		/* Exact match */
+}
+
+/*
+**     strncasecomp8 is a variant of strncasecomp (below)
+**     -------------		     ------------
+**     but uses 8bit upper/lower case information
+**     from the current display charset.
+**     It returns 0 if exact match.
+*/
+PUBLIC int strncasecomp8 ARGS3(
+	CONST char*,	a,
+	CONST char *,	b,
+	int,		n)
+{
+    CONST char *p = a;
+    CONST char *q = b;
+
+    for ( ; ; p++, q++) {
+	int diff;
+	if (p == (a+n))
+	    return 0;	/*   Match up to n characters */
+	if (!(*p && *q))
+	    return (*p - *q);
+	diff = UPPER8(*p, *q);
+	if (diff)
+	    return diff;
+    }
+    /*NOTREACHED*/
+}
 #ifndef VM		/* VM has these already it seems */
 
 /*	Strings of any length
@@ -34,7 +87,7 @@ PUBLIC int strcasecomp ARGS2(
     CONST char *p = a;
     CONST char *q = b;
 
-    for (p = a, q = b; *p && *q; p++, q++) {
+    for ( ; *p && *q; p++, q++) {
 	int diff = TOLOWER(*p) - TOLOWER(*q);
 	if (diff) return diff;
     }
@@ -57,7 +110,7 @@ PUBLIC int strncasecomp ARGS3(
     CONST char *p = a;
     CONST char *q = b;
 
-    for (p = a, q = b; ; p++, q++) {
+    for ( ; ; p++, q++) {
 	int diff;
 	if (p == (a+n))
 	    return 0;	/*   Match up to n characters */
diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h
index fb2d3397..0b2c23dc 100644
--- a/WWW/Library/Implementation/HTString.h
+++ b/WWW/Library/Implementation/HTString.h
@@ -25,6 +25,15 @@ Case-insensitive string comparison
 extern int strcasecomp  PARAMS((CONST char *a, CONST char *b));
 extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
 
+extern int strcasecomp8  PARAMS((CONST char *a, CONST char *b));
+extern int strncasecomp8 PARAMS((CONST char *a, CONST char *b, int n));
+       /*
+       **  strcasecomp8 and strncasecomp8 are variants of strcasecomp
+       **  and strncasecomp, but use 8bit upper/lower case information
+       **  from the current display charset
+       */
+
+
 /*
 
 Malloced string manipulation
diff --git a/WWW/Library/Implementation/HTStyle.h b/WWW/Library/Implementation/HTStyle.h
index 99f57e54..bbab0ea6 100644
--- a/WWW/Library/Implementation/HTStyle.h
+++ b/WWW/Library/Implementation/HTStyle.h
@@ -1,33 +1,33 @@
 /*                                                       HTStyle: Style management for libwww
                               STYLE DEFINITION FOR HYPERTEXT
-                                             
+
    Styles allow the translation between a logical property of a piece of text and its
    physical representation.
-   
+
    A StyleSheet is a collection of styles, defining the translation necessary to represent
    a document. It is a linked list of styles.
-   
+
 Overriding this module
 
    Why is the style structure declared in the HTStyle.h module, instead of having the user
    browser define the structure, and the HTStyle routines just use sizeof() for copying?
-   
+
    It's not obvious whether HTStyle.c should be common code.  It's useful to have common
    code for loading style sheets, especially if the movement toward standard style sheets
    gets going.
-   
+
    If it IS common code, then both the hypertext object and HTStyle.c must know the
    structure of a style, so HTStyle.h is a suitable place to put that.  HTStyle.c has to
    be compiled with a knowledge of the
-   
+
    It we take it out of the library, then of course HTStyle could be declared as an
    undefined structure. The only references to it are in the structure-flattening code
    HTML.c and HTPlain.c, which only use HTStypeNamed().
-   
+
    You can in any case override this function in your own code, which will prevent the
    HTStyle from being loaded.  You will be able to redefine your style structure in this
    case without problems, as no other moule needs to know it.
-   
+
  */
 #ifndef HTStyle_H
 #define HTStyle_H
@@ -80,7 +80,7 @@ typedef int HTColor;            /* Sorry about the US spelling! */
 
 
 #define STYLE_NAME_LENGTH       80      /* @@@@@@@@@@@ */
-        
+
 typedef struct {
     short               kind;           /* only NX_LEFTTAB implemented*/
     HTCoord             position;       /* x coordinate for stop */
@@ -118,7 +118,7 @@ typedef struct _HTStyle {
     short               alignment;      /* quad justification */
     HTCoord             lineHt;         /* line height */
     HTCoord             descentLine;    /* descender bottom from baseline */
-    HTTabStop           *tabs;          /* array of tab stops, 0 terminated */
+    CONST HTTabStop     *tabs;          /* array of tab stops, 0 terminated */
 
     BOOL                wordWrap;       /* Yes means wrap at space not char */
     BOOL                freeFormat;     /* Yes means \n is just white space */
@@ -140,7 +140,7 @@ typedef struct _HTStyle {
 /*      Style functions:
 */
 extern HTStyle * HTStyleNew NOPARAMS;
-extern HTStyle* HTStyleNewNamed PARAMS ((CONST char * name));
+extern HTStyle * HTStyleNewNamed PARAMS ((CONST char * name));
 extern HTStyle * HTStyleFree PARAMS((HTStyle * self));
 #ifdef SUPRESS
 extern HTStyle * HTStyleRead PARAMS((HTStyle * self, HTStream * stream));
@@ -175,9 +175,8 @@ extern HTStyleSheet * HTStyleSheetWrite PARAMS((HTStyleSheet * self,
                                                 HTStream * stream));
 #endif
 #define CLEAR_POINTER ((void *)-1)      /* Pointer value means "clear me" */
-#endif /* HTStyle_H */
-
 
-/*
+/* DefaultStyle.c */
+extern HTStyleSheet * DefaultStyle NOPARAMS;
 
-    */
+#endif /* HTStyle_H */
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index 913460bb..dab7ab73 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -4,16 +4,16 @@
 **	This code is in common between client and server sides.
 **
 **	16 Jan 92  TBL	Fix strtol() undefined on CMU Mach.
-**	25 Jun 92  JFG  Added DECNET option through TCP socket emulation.
-**	13 Sep 93  MD   Added correct return of vmserrorno for HTInetStatus.
+**	25 Jun 92  JFG	Added DECNET option through TCP socket emulation.
+**	13 Sep 93  MD	Added correct return of vmserrorno for HTInetStatus.
 **			Added decoding of vms error message for MULTINET.
-**      7-DEC-1993 Bjorn S. Nilsson, ALEPH, CERN, VMS UCX ioctl() changes
+**	7-DEC-1993 Bjorn S. Nilsson, ALEPH, CERN, VMS UCX ioctl() changes
 **			(done of Mosaic)
-**      19 Feb 94  Danny Mayer	Added Bjorn Fixes to Lynx version
-**	 7 Mar 94  Danny Mayer  Added Fix UCX version for full domain name
-**	20 May 94  Andy Harper  Added support for CMU TCP/IP transport
-**	17 Nov 94  Andy Harper  Added support for SOCKETSHR transport
-**      16 Jul 95  S. Bjorndahl added kluge to deal with LIBCMU bug
+**	19 Feb 94  Danny Mayer	Added Bjorn Fixes to Lynx version
+**	 7 Mar 94  Danny Mayer	Added Fix UCX version for full domain name
+**	20 May 94  Andy Harper	Added support for CMU TCP/IP transport
+**	17 Nov 94  Andy Harper	Added support for SOCKETSHR transport
+**	16 Jul 95  S. Bjorndahl added kluge to deal with LIBCMU bug
 */
 
 #include "HTUtils.h"
@@ -27,17 +27,17 @@
 #include <signal.h>
 #include <sys/wait.h>
 #endif /* NSL_FORK */
- 
+
 #define FREE(x) if (x) {free(x); x = NULL;}
 
 extern int HTCheckForInterrupt NOPARAMS;
 
 #ifdef SVR4_BSDSELECT
 PUBLIC int BSDselect PARAMS((
-	int 		 nfds,
-	fd_set * 	 readfds,
+	int		 nfds,
+	fd_set *	 readfds,
 	fd_set *	 writefds,
-	fd_set * 	 exceptfds,
+	fd_set *	 exceptfds,
 	struct timeval * timeout));
 #ifdef select
 #undef select
@@ -55,7 +55,7 @@ PUBLIC int BSDselect PARAMS((
 
 #ifdef SHORT_NAMES
 #define HTInetStatus		HTInStat
-#define HTInetString 		HTInStri
+#define HTInetString		HTInStri
 #define HTParseInet		HTPaInet
 #endif /* SHORT_NAMES */
 
@@ -88,10 +88,10 @@ PUBLIC unsigned long socks_bind_remoteAddr; /* for long Rbind */
 **
 **  On entry,
 **	where		gives a description of what caused the error
-**	global errno	gives the error number in the unix way.
+**	global errno	gives the error number in the Unix way.
 **
 **  On return,
-**	returns		a negative status in the unix way.
+**	returns 	a negative status in the Unix way.
 */
 #ifndef PCNFS
 
@@ -119,7 +119,7 @@ extern int sys_nerr;
 
 #if defined(VMS) && defined(UCX)
 /*
-**  A routine to mimick the ioctl function for UCX.
+**  A routine to mimic the ioctl function for UCX.
 **  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
 */
 #include <iodef.h>
@@ -127,7 +127,7 @@ extern int sys_nerr;
 extern int vaxc$get_sdc(), sys$qiow();
 
 PUBLIC int HTioctl ARGS3(
-	int,		d, 
+	int,		d,
 	int,		request,
 	int *,		argp)
 {
@@ -135,41 +135,41 @@ PUBLIC int HTioctl ARGS3(
     unsigned short fun, iosb[4];
     char *p5, *p6;
     struct comm {
-        int command;
-        char *addr;
+	int command;
+	char *addr;
     } ioctl_comm;
     struct it2 {
-        unsigned short len;
-        unsigned short opt;
-        struct comm *addr;
+	unsigned short len;
+	unsigned short opt;
+	struct comm *addr;
     } ioctl_desc;
 
     if ((sdc = vaxc$get_sdc (d)) == 0) {
-        errno = EBADF;
-        return -1;
+	errno = EBADF;
+	return -1;
     }
     ioctl_desc.opt  = UCX$C_IOCTL;
     ioctl_desc.len  = sizeof(struct comm);
     ioctl_desc.addr = &ioctl_comm;
     if (request & IOC_OUT) {
-        fun = IO$_SENSEMODE;
-        p5 = 0;
-        p6 = (char *)&ioctl_desc;
+	fun = IO$_SENSEMODE;
+	p5 = 0;
+	p6 = (char *)&ioctl_desc;
     } else {
-        fun = IO$_SETMODE;
-        p5 = (char *)&ioctl_desc;
-        p6 = 0;
+	fun = IO$_SETMODE;
+	p5 = (char *)&ioctl_desc;
+	p6 = 0;
     }
     ioctl_comm.command = request;
     ioctl_comm.addr = (char *)argp;
     status = sys$qiow (0, sdc, fun, iosb, 0, 0, 0, 0, 0, 0, p5, p6);
     if (!(status & 01)) {
-        errno = status;
-        return -1;
+	errno = status;
+	return -1;
     }
     if (!(iosb[0] & 01)) {
-        errno = iosb[0];
-        return -1;
+	errno = iosb[0];
+	return -1;
     }
     return 0;
 }
@@ -179,7 +179,7 @@ PUBLIC int HTioctl ARGS3(
 **	---------------------
 */
 PUBLIC int HTInetStatus ARGS1(
-	char *,		where)
+	char *, 	where)
 {
 #ifdef VMS
 #ifdef MULTINET
@@ -188,7 +188,7 @@ PUBLIC int HTInetStatus ARGS1(
 #endif /* VMS */
 
     CTRACE(tfp,
-    	"TCP: Error %d in `SOCKET_ERRNO' after call to %s() failed.\n\t%s\n",
+	"TCP: Error %d in `SOCKET_ERRNO' after call to %s() failed.\n\t%s\n",
 	   SOCKET_ERRNO,  where,
 	   /* third arg is transport/platform specific */
 #ifdef VM
@@ -198,7 +198,7 @@ PUBLIC int HTInetStatus ARGS1(
 
 #ifdef VMS
 #ifdef MULTINET
-           vms_errno_string());
+	   vms_errno_string());
 #else
 	   ((SOCKET_ERRNO > 0 && SOCKET_ERRNO <= 65) ?
 	    strerror(SOCKET_ERRNO) : "(Error number not translated)"));
@@ -219,17 +219,17 @@ PUBLIC int HTInetStatus ARGS1(
 #ifdef VMS
 #ifndef MULTINET
     CTRACE(tfp,
-    	   "         Unix error number (SOCKET_ERRNO) = %ld dec\n",
+	   "         Unix error number (SOCKET_ERRNO) = %ld dec\n",
 	   SOCKET_ERRNO);
     CTRACE(tfp,
-    	   "         VMS error (vaxc$errno)    = %lx hex\n",
+	   "         VMS error (vaxc$errno)    = %lx hex\n",
 	   vaxc$errno);
 #endif /* MULTINET */
 #endif /* VMS */
 
 #ifdef VMS
     /*
-    **  uerrno and errno happen to be zero if vmserrno <> 0
+    **	uerrno and errno happen to be zero if vmserrno <> 0
     */
 #ifdef MULTINET
     return -vmserrno;
@@ -261,32 +261,32 @@ PUBLIC unsigned int HTCardinal ARGS3(
 {
     unsigned int n;
     if ((**pp<'0') || (**pp>'9')) {	    /* Null string is error */
-	*pstatus = -3;  /* No number where one expeceted */
+	*pstatus = -3;	/* No number where one expected */
 	return 0;
     }
 
     n = 0;
     while ((**pp >= '0') && (**pp <= '9'))
-        n = n*10 + *((*pp)++) - '0';
+	n = n*10 + *((*pp)++) - '0';
 
     if (n > max_value) {
-	*pstatus = -4;  /* Cardinal outside range */
+	*pstatus = -4;	/* Cardinal outside range */
 	return 0;
     }
 
     return n;
 }
 
-#ifndef DECNET  /* Function only used below for a trace message */
+#ifndef DECNET	/* Function only used below for a trace message */
 /*	Produce a string for an Internet address
 **	----------------------------------------
 **
 **  On exit,
-**	returns	a pointer to a static string which must be copied if
+**	returns a pointer to a static string which must be copied if
 **		it is to be kept.
 */
 PUBLIC CONST char * HTInetString ARGS1(
-	SockA*,		soc_in)
+	SockA*, 	soc_in)
 {
     static char string[16];
     sprintf(string, "%d.%d.%d.%d",
@@ -307,7 +307,7 @@ PUBLIC CONST char * HTInetString ARGS1(
 **	soc_in	points to the binary internet or decnet address field.
 **
 **  On exit,
-**	*soc_in	is filled in. If no port is specified in str, that
+**	*soc_in is filled in. If no port is specified in str, that
 **		field is left unchanged in *soc_in.
 */
 PUBLIC int HTParseInet ARGS2(
@@ -320,7 +320,7 @@ PUBLIC int HTParseInet ARGS2(
     struct hostent  *phost;	/* Pointer to host - See netdb.h */
 
     if (!str) {
-    	if (TRACE) {
+	if (TRACE) {
 	    fprintf(stderr, "HTParseInet: Can't parse `NULL'.\n");
 	}
 	return -1;
@@ -334,11 +334,11 @@ PUBLIC int HTParseInet ARGS2(
     StrAllocCopy(host, str);	/* Make a copy we can mutilate */
 
     /*
-    **  Parse port number if present.
-    */    
+    **	Parse port number if present.
+    */
     if ((port = strchr(host, ':')) != NULL) {
-    	*port++ = 0;		/* Chop off port */
-        if (port[0] >= '0' && port[0] <= '9') {
+	*port++ = 0;		/* Chop off port */
+	if (port[0] >= '0' && port[0] <= '9') {
 #ifdef unix
 	    soc_in->sin_port = htons(atol(port));
 #else /* VMS: */
@@ -348,7 +348,7 @@ PUBLIC int HTParseInet ARGS2(
 	    soc_in->sin_port = htons((unsigned short)strtol(port,(char**)0,10));
 #endif /* Decnet */
 #endif /* Unix vs. VMS */
-#ifdef SUPPRESS		/* 1. crashes!?!.  2. Not recommended */
+#ifdef SUPPRESS 	/* 1. crashes!?!.  2. Not recommended */
 	} else {
 	    struct servent * serv = getservbyname(port, (char*)0);
 	    if (serv) {
@@ -362,13 +362,13 @@ PUBLIC int HTParseInet ARGS2(
 
 #ifdef DECNET
     /*
-    **  Read Decnet node name. @@ Should know about DECnet addresses, but
-    **  it's probably worth waiting until the Phase transition from IV to V.
+    **	Read Decnet node name. @@ Should know about DECnet addresses, but
+    **	it's probably worth waiting until the Phase transition from IV to V.
     */
     soc_in->sdn_nam.n_len = min(DN_MAXNAML, strlen(host));  /* <=6 in phase 4 */
     strncpy(soc_in->sdn_nam.n_name, host, soc_in->sdn_nam.n_len + 1);
     if (TRACE) {
-        fprintf(stderr,  
+	fprintf(stderr,
 		"DECnet: Parsed address as object number %d on host %.6s...\n",
 		soc_in->sdn_objnum, host);
     }
@@ -390,8 +390,8 @@ PUBLIC int HTParseInet ARGS2(
     }
 
     /*
-    **  Parse host number if present.
-    */  
+    **	Parse host number if present.
+    */
     if (dotcount_ip == 3) {   /* Numeric node address: */
 
 #ifdef DJGPP
@@ -409,7 +409,7 @@ PUBLIC int HTParseInet ARGS2(
 #endif /* DJGPP */
 	FREE(host);
     } else {		    /* Alphanumeric node name: */
-#ifdef MVS	/* Oustanding problem with crash in MVS gethostbyname */
+#ifdef MVS	/* Outstanding problem with crash in MVS gethostbyname */
 	if (TRACE) {
 	    fprintf(stderr,
 		    "HTParseInet: Calling gethostbyname(%s)\n", host);
@@ -421,9 +421,9 @@ PUBLIC int HTParseInet ARGS2(
 	**  Start block for fork-based gethostbyname() with
 	**  checks for interrupts. - Tom Zerucha (tz@execpc.com) & FM
 	*/
-	{ 
+	{
 	    /*
-	    **  Pipe, child pid, and status buffers.
+	    **	Pipe, child pid, and status buffers.
 	    */
 	    pid_t fpid, waitret = (pid_t)0;
 	    int pfd[2], cstat, cst1 = 0;
@@ -431,7 +431,7 @@ PUBLIC int HTParseInet ARGS2(
 	    pipe(pfd);
 
 	    if ((fpid = fork()) == 0 ) {
-		/* 
+		/*
 		**  Child - for the long call.
 		*/
 		phost = gethostbyname(host);
@@ -450,11 +450,11 @@ PUBLIC int HTParseInet ARGS2(
 	    }
 
 	    /*
-	    **  (parent) Wait until lookup finishes, or interrupt.
+	    **	(parent) Wait until lookup finishes, or interrupt.
 	    */
 	    cstat = 0;
 	    while (cstat <= 0) {
-	        /*
+		/*
 		**  Exit when data sent.
 		*/
 		IOCTL(pfd[0], FIONREAD, &cstat);
@@ -512,41 +512,41 @@ PUBLIC int HTParseInet ARGS2(
 		}
 	    }
 	    /*
-	    **  Read as much as we can - should be the address.
+	    **	Read as much as we can - should be the address.
 	    */
 	    IOCTL(pfd[0], FIONREAD, &cstat);
 	    if (cstat < 4) {
 		if (TRACE) {
-		    fprintf(stderr, 
+		    fprintf(stderr,
 		       "HTParseInet: NSL_FORK child returns only %d bytes.\n",
 			    cstat);
 		    fprintf(stderr,
-		       "             Trying again without forking.\n");
+			"             Trying again without forking.\n");
 		}
 		phost = gethostbyname(host);	/* See netdb.h */
 		if (!phost) {
 		    if (TRACE) {
-			fprintf(stderr, 
+			fprintf(stderr,
 			 "HTParseInet: Can't find internet node name `%s'.\n",
 				host);
 		    }
 		    memset((void *)&soc_in->sin_addr, 0, sizeof(soc_in->sin_addr));
 		} else {
 		    memcpy((void *)&soc_in->sin_addr,
-		    	   phost->h_addr, phost->h_length);
+			   phost->h_addr, phost->h_length);
 		}
 #ifdef NOTDEFINED
-	        cstat = read(pfd[0], (void *)&soc_in->sin_addr , 4);
+		cstat = read(pfd[0], (void *)&soc_in->sin_addr , 4);
 #endif /* NOTDEFINED */
 	    } else {
-	        cstat = read(pfd[0], (void *)&soc_in->sin_addr , cstat);
+		cstat = read(pfd[0], (void *)&soc_in->sin_addr , cstat);
 	    }
 	    close(pfd[0]);
 	    close(pfd[1]);
 	}
 	if (soc_in->sin_addr.s_addr == 0) {
 	    if (TRACE) {
-	        fprintf(stderr, 
+		fprintf(stderr,
 			"HTParseInet: Can't find internet node name `%s'.\n",
 			host);
 	    }
@@ -563,7 +563,7 @@ PUBLIC int HTParseInet ARGS2(
 
 #else /* Not NSL_FORK: */
 #ifdef DJGPP
-        soc_in->sin_addr.s_addr = htonl(resolve(host));  
+	soc_in->sin_addr.s_addr = htonl(resolve(host));
 	FREE(host);
 	if (soc_in->sin_addr.s_addr == 0) {
 		 if (TRACE)
@@ -581,12 +581,12 @@ PUBLIC int HTParseInet ARGS2(
 #endif /* MVS */
 	if (!phost) {
 	    if (TRACE) {
-	        fprintf(stderr, 
+		fprintf(stderr,
 			"HTParseInet: Can't find internet node name `%s'.\n",
 			host);
 	    }
 	    FREE(host);
-	    return -1;  /* Fail? */
+	    return -1;	/* Fail? */
 	}
 	FREE(host);
 #if defined(VMS) && defined(CMU_TCP)
@@ -594,9 +594,9 @@ PUBLIC int HTParseInet ARGS2(
 	**  In LIBCMU, phost->h_length contains not the length of one address
 	**  (four bytes) but the number of bytes in *h_addr, i.e. some multiple
 	**  of four. Thus we need to hard code the value here, and remember to
-	**  change it if/when IP addresses change in size. :-(  LIBCMU is no
+	**  change it if/when IP addresses change in size. :-(	LIBCMU is no
 	**  longer supported, and CMU users are encouraged to obtain and use
-	**  SOCKETSHR/NETLIB instead. - S. Bjorndahl 
+	**  SOCKETSHR/NETLIB instead. - S. Bjorndahl
 	*/
 	memcpy((void *)&soc_in->sin_addr, phost->h_addr, 4);
 #else
@@ -607,7 +607,7 @@ PUBLIC int HTParseInet ARGS2(
     }
 
     if (TRACE) {
-        fprintf(stderr,  
+	fprintf(stderr,
 	   "HTParseInet: Parsed address as port %d, IP address %d.%d.%d.%d\n",
 		(int)ntohs(soc_in->sin_port),
 		(int)*((unsigned char *)(&soc_in->sin_addr)+0),
@@ -615,7 +615,7 @@ PUBLIC int HTParseInet ARGS2(
 		(int)*((unsigned char *)(&soc_in->sin_addr)+2),
 		(int)*((unsigned char *)(&soc_in->sin_addr)+3));
     }
-#endif  /* Internet vs. Decnet */
+#endif	/* Internet vs. Decnet */
 
     return 0;	/* OK */
 }
@@ -647,32 +647,32 @@ PRIVATE void get_host_details NOARGS
     struct hostent * phost;		/* Pointer to host -- See netdb.h */
 #endif /* NEED_HOST_ADDRESS */
     int namelength = sizeof(name);
-    
+
     if (hostname)
-    	return;				/* Already done */
+	return; 			/* Already done */
     gethostname(name, namelength);	/* Without domain */
     StrAllocCopy(hostname, name);
     atexit(free_HTTCP_hostname);
 #ifdef UCX
     /*
-    **  UCX doesn't give the complete domain name.
-    **  Get rest from UCX$BIND_DOM logical.
+    **	UCX doesn't give the complete domain name.
+    **	Get rest from UCX$BIND_DOM logical.
     */
-    if (strchr(hostname,'.') == NULL) {           /* Not full address */
-        domain_name = getenv("UCX$BIND_DOMAIN");
-        if (domain_name != NULL) {
-            StrAllocCat(hostname, ".");
-            StrAllocCat(hostname, domain_name);
-        }
+    if (strchr(hostname,'.') == NULL) { 	  /* Not full address */
+	domain_name = getenv("UCX$BIND_DOMAIN");
+	if (domain_name != NULL) {
+	    StrAllocCat(hostname, ".");
+	    StrAllocCat(hostname, domain_name);
+	}
      }
 #endif /* UCX */
     CTRACE(tfp, "TCP: Local host name is %s\n", hostname);
 
-#ifndef DECNET  /* Decnet ain't got no damn name server 8#OO */
+#ifndef DECNET	/* Decnet ain't got no damn name server 8#OO */
 #ifdef NEED_HOST_ADDRESS		/* no -- needs name server! */
     phost = gethostbyname(name);	/* See netdb.h */
     if (!phost) {
-	if (TRACE) fprintf(stderr, 
+	if (TRACE) fprintf(stderr,
 		"TCP: Can't find my own internet node address for `%s'!!\n",
 		name);
 	return;  /* Fail! */
@@ -696,11 +696,11 @@ PUBLIC CONST char * HTHostName NOARGS
 **  Interruptable connect as implemented for Mosaic by Marc Andreesen
 **  and hacked in for Lynx years ago by Lou Montulli, and further
 **  modified over the years by numerous Lynx lovers. - FM
-*/ 
+*/
 PUBLIC int HTDoConnect ARGS4(
 	CONST char *,	url,
-	char *,		protocol,
-	int,		default_port, 
+	char *, 	protocol,
+	int,		default_port,
 	int *,		s)
 {
     struct sockaddr_in soc_address;
@@ -712,13 +712,13 @@ PUBLIC int HTDoConnect ARGS4(
     char *host = NULL;
 
     /*
-    **  Set up defaults.
+    **	Set up defaults.
     */
     soc_in->sin_family = AF_INET;
     soc_in->sin_port = htons(default_port);
 
     /*
-    **  Get node name and optional port number.
+    **	Get node name and optional port number.
     */
     p1 = HTParse(url, "", PARSE_HOST);
     if ((at_sign = strchr(p1, '@')) != NULL) {
@@ -745,7 +745,7 @@ PUBLIC int HTDoConnect ARGS4(
 	}
 	FREE(host);
 	FREE(line);
-        return status;
+	return status;
     }
 
     sprintf (line, "Making %s connection to %s.", protocol, host);
@@ -753,7 +753,7 @@ PUBLIC int HTDoConnect ARGS4(
     FREE(host);
 
     /*
-    **  Now, let's get a socket set up from the server for the data.
+    **	Now, let's get a socket set up from the server for the data.
     */
     *s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
     if (*s == -1) {
@@ -761,155 +761,155 @@ PUBLIC int HTDoConnect ARGS4(
 	FREE(line);
 	return HT_NO_DATA;
     }
-   
+
 #ifndef DOSPATH
 #if !defined(NO_IOCTL) || defined(USE_FCNTL)
     /*
-    **  Make the socket non-blocking, so the connect can be canceled.
-    **  This means that when we issue the connect we should NOT
-    **  have to wait for the accept on the other end.
+    **	Make the socket non-blocking, so the connect can be canceled.
+    **	This means that when we issue the connect we should NOT
+    **	have to wait for the accept on the other end.
     */
     {
 #ifdef USE_FCNTL
-        int ret = fcntl(*s, F_SETFL, O_NONBLOCK);
+	int ret = fcntl(*s, F_SETFL, O_NONBLOCK);
 #else
-        int val = 1;
-        int ret = IOCTL(*s, FIONBIO, &val);
+	int val = 1;
+	int ret = IOCTL(*s, FIONBIO, &val);
 #endif /* USE_FCNTL */
-        if (ret == -1)
-            _HTProgress("Could not make connection non-blocking.");
+	if (ret == -1)
+	    _HTProgress("Could not make connection non-blocking.");
     }
 #endif /* !NO_IOCTL || USE_FCNTL */
-#endif /* DOSPATH */
+#endif /* !DOSPATH */
 
     /*
-    **  Issue the connect.  Since the server can't do an instantaneous
-    **  accept and we are non-blocking, this will almost certainly return
-    **  a negative status.
+    **	Issue the connect.  Since the server can't do an instantaneous
+    **	accept and we are non-blocking, this will almost certainly return
+    **	a negative status.
     */
 #ifdef SOCKS
     if (socks_flag) {
-        status = Rconnect(*s, (struct sockaddr*)&soc_address,
-      			  sizeof(soc_address));
+	status = Rconnect(*s, (struct sockaddr*)&soc_address,
+			  sizeof(soc_address));
 	/*
 	**  For long Rbind.
 	*/
-        socks_bind_remoteAddr = soc_address.sin_addr.s_addr;
+	socks_bind_remoteAddr = soc_address.sin_addr.s_addr;
     } else
 #endif /* SOCKS */
     status = connect(*s, (struct sockaddr*)&soc_address, sizeof(soc_address));
 #ifndef DJGPP
     /*
-    **  According to the Sun man page for connect:
-    **     EINPROGRESS         The socket is non-blocking and the  con-
-    **                         nection cannot be completed immediately.
-    **                         It is possible to select(2) for  comple-
-    **                         tion  by  selecting the socket for writ-
-    **                         ing.
-    **  According to the Motorola SVR4 man page for connect:
-    **     EAGAIN              The socket is non-blocking and the  con-
-    **                         nection cannot be completed immediately.
-    **                         It is possible to select for  completion
-    **                         by  selecting  the  socket  for writing.
-    **                         However, this is only  possible  if  the
-    **                         socket  STREAMS  module  is  the topmost
-    **                         module on  the  protocol  stack  with  a
-    **                         write  service  procedure.  This will be
-    **                         the normal case.
+    **	According to the Sun man page for connect:
+    **	   EINPROGRESS	       The socket is non-blocking and the  con-
+    **			       nection cannot be completed immediately.
+    **			       It is possible to select(2) for	comple-
+    **			       tion  by  selecting the socket for writ-
+    **			       ing.
+    **	According to the Motorola SVR4 man page for connect:
+    **	   EAGAIN	       The socket is non-blocking and the  con-
+    **			       nection cannot be completed immediately.
+    **			       It is possible to select for  completion
+    **			       by  selecting  the  socket  for writing.
+    **			       However, this is only  possible	if  the
+    **			       socket  STREAMS	module	is  the topmost
+    **			       module on  the  protocol  stack	with  a
+    **			       write  service  procedure.  This will be
+    **			       the normal case.
     */
     if ((status < 0) &&
-        (SOCKET_ERRNO == EINPROGRESS || SOCKET_ERRNO == EAGAIN)) {
-        struct timeval timeout;
-        int ret;
-        int tries=0;
+	(SOCKET_ERRNO == EINPROGRESS || SOCKET_ERRNO == EAGAIN)) {
+	struct timeval timeout;
+	int ret;
+	int tries=0;
 
-        ret = 0;
-        while (ret <= 0) {
-            fd_set writefds;
+	ret = 0;
+	while (ret <= 0) {
+	    fd_set writefds;
 
 	    /*
-	    **  Protect against an infinite loop.
+	    **	Protect against an infinite loop.
 	    */
 	    if (tries++ >= 180000) {
-	        HTAlert("Connection failed for 180,000 tries.");
-	        FREE(line);
- 	        return HT_NO_DATA;
+		HTAlert("Connection failed for 180,000 tries.");
+		FREE(line);
+		return HT_NO_DATA;
 	    }
 
 	    timeout.tv_sec = 0;
 	    timeout.tv_usec = 100000;
-            FD_ZERO(&writefds);
-            FD_SET(*s, &writefds);
+	    FD_ZERO(&writefds);
+	    FD_SET(*s, &writefds);
 #ifdef SOCKS
 	    if (socks_flag)
-                ret = Rselect(FD_SETSIZE, NULL,
-	      		      (void *)&writefds, NULL, &timeout);
+		ret = Rselect(FD_SETSIZE, NULL,
+			      (void *)&writefds, NULL, &timeout);
 	    else
 #endif /* SOCKS */
-            ret = select(FD_SETSIZE, NULL, (void *)&writefds, NULL, &timeout);
+	    ret = select(FD_SETSIZE, NULL, (void *)&writefds, NULL, &timeout);
 
 	   /*
-	   **  If we suspend, then it is possible that select will be 
+	   **  If we suspend, then it is possible that select will be
 	   **  interrupted.  Allow for this possibility. - JED
 	   */
 	   if ((ret == -1) && (errno == EINTR))
 	     continue;
 
-            /*
-            **  Again according to the Sun and Motorola man pagse for connect:
-            **     EALREADY            The socket is non-blocking and a  previ-
-            **                         ous  connection attempt has not yet been
-            **                         completed.
-            **  Thus if the SOCKET_ERRNO is NOT EALREADY we have a real error,
-            **  and should break out here and return that error.
-            **  Otherwise if it is EALREADY keep on trying to complete the
-            **  connection.
-            */
-            if ((ret < 0) && (SOCKET_ERRNO != EALREADY)) {
-                status = ret;
-                break;
-            } else if (ret > 0) {
-                /*
-                **  Extra check here for connection success, if we try to
-                **  connect again, and get EISCONN, it means we have a
-                **  successful connection.  But don't check with SOCKS.
-                */
+	    /*
+	    **	Again according to the Sun and Motorola man pages for connect:
+	    **	   EALREADY	       The socket is non-blocking and a  previ-
+	    **			       ous  connection attempt has not yet been
+	    **			       completed.
+	    **	Thus if the SOCKET_ERRNO is NOT EALREADY we have a real error,
+	    **	and should break out here and return that error.
+	    **	Otherwise if it is EALREADY keep on trying to complete the
+	    **	connection.
+	    */
+	    if ((ret < 0) && (SOCKET_ERRNO != EALREADY)) {
+		status = ret;
+		break;
+	    } else if (ret > 0) {
+		/*
+		**  Extra check here for connection success, if we try to
+		**  connect again, and get EISCONN, it means we have a
+		**  successful connection.  But don't check with SOCKS.
+		*/
 #ifdef SOCKS
-	        if (socks_flag) {
-	            status = 0;
-	        } else {
+		if (socks_flag) {
+		    status = 0;
+		} else {
 #endif /* SOCKS */
-                status = connect(*s, (struct sockaddr*)&soc_address,
-                                 sizeof(soc_address));
+		status = connect(*s, (struct sockaddr*)&soc_address,
+				 sizeof(soc_address));
 #ifdef UCX
-	        /*
-	        **  A UCX feature: Instead of returning EISCONN
-	        **		 UCX returns EADDRINUSE.
-	        **  Test for this status also.
-	        */
-                if ((status < 0) && ((SOCKET_ERRNO == EISCONN) ||
+		/*
+		**  A UCX feature: Instead of returning EISCONN
+		**		 UCX returns EADDRINUSE.
+		**  Test for this status also.
+		*/
+		if ((status < 0) && ((SOCKET_ERRNO == EISCONN) ||
 				     (SOCKET_ERRNO == EADDRINUSE)))
 #else
-                if ((status < 0) && (SOCKET_ERRNO == EISCONN))
+		if ((status < 0) && (SOCKET_ERRNO == EISCONN))
 #endif /* UCX */
-                {
-                    status = 0;
-                }
+		{
+		    status = 0;
+		}
 
-	        if (status && (SOCKET_ERRNO == EALREADY)) /* new stuff LJM */
+		if (status && (SOCKET_ERRNO == EALREADY)) /* new stuff LJM */
 		    ret = 0; /* keep going */
-	        else
-                    break;
+		else
+		    break;
 #ifdef SOCKS
-	        }
+		}
 #endif /* SOCKS */
-            } 
+	    }
 #ifdef SOCKS
 	    else if (!socks_flag)
 #else
-            else
+	    else
 #endif /* SOCKS */
-            {
+	    {
 		/*
 		**  The select says we aren't ready yet.  Try to connect
 		**  again to make sure.  If we don't get EALREADY or EISCONN,
@@ -922,51 +922,51 @@ PUBLIC int HTDoConnect ARGS4(
 		**  For some reason, UCX pre 3 apparently returns
 		**  errno = 18242 instead the EALREADY or EISCONN.
 		*/
-                status = connect(*s, (struct sockaddr*)&soc_address,
-                                 sizeof(soc_address));
-                if ((status < 0) &&
-	            (SOCKET_ERRNO != EALREADY && SOCKET_ERRNO != EAGAIN) &&
+		status = connect(*s, (struct sockaddr*)&soc_address,
+				 sizeof(soc_address));
+		if ((status < 0) &&
+		    (SOCKET_ERRNO != EALREADY && SOCKET_ERRNO != EAGAIN) &&
 #ifdef UCX
 		    (SOCKET_ERRNO != 18242) &&
 #endif /* UCX */
 		    (SOCKET_ERRNO != EISCONN)) {
-                    break;
-                }
-            }
-            if (HTCheckForInterrupt()) {
-                if (TRACE)
-                    fprintf(stderr, "*** INTERRUPTED in middle of connect.\n");
-                status = HT_INTERRUPTED;
-                SOCKET_ERRNO = EINTR;
-                break;
-            }
-        }
+		    break;
+		}
+	    }
+	    if (HTCheckForInterrupt()) {
+		if (TRACE)
+		    fprintf(stderr, "*** INTERRUPTED in middle of connect.\n");
+		status = HT_INTERRUPTED;
+		SOCKET_ERRNO = EINTR;
+		break;
+	    }
+	}
     }
-#endif /* DJGPP */
+#endif /* !DJGPP */
     if (status < 0) {
-        /*
-        **  The connect attempt failed or was interrupted,
-        **  so close up the socket.
-        */
-        NETCLOSE(*s);
+	/*
+	**  The connect attempt failed or was interrupted,
+	**  so close up the socket.
+	*/
+	NETCLOSE(*s);
     }
 #ifndef DOSPATH
 #if !defined(NO_IOCTL) || defined(USE_FCNTL)
     else {
-        /*
+	/*
 	**  Make the socket blocking again on good connect.
 	*/
 #ifdef USE_FCNTL
-        int ret = fcntl(*s, F_SETFL, 0);
-#else 
-        int val = 0;
-        int ret = IOCTL(*s, FIONBIO, &val);
+	int ret = fcntl(*s, F_SETFL, 0);
+#else
+	int val = 0;
+	int ret = IOCTL(*s, FIONBIO, &val);
 #endif /* USE_FCNTL */
-        if (ret == -1)
-            _HTProgress("Could not restore socket to blocking.");
+	if (ret == -1)
+	    _HTProgress("Could not restore socket to blocking.");
     }
 #endif /* !NO_IOCTL || USE_FCNTL */
-#endif /* DOSPATH */
+#endif /* !DOSPATH */
 
     FREE(line);
     return status;
@@ -977,7 +977,7 @@ PUBLIC int HTDoConnect ARGS4(
 */
 PUBLIC int HTDoRead ARGS3(
 	int,		fildes,
-	void *,		buf,
+	void *, 	buf,
 	unsigned,	nbyte)
 {
     int ready, ret;
@@ -989,11 +989,11 @@ PUBLIC int HTDoRead ARGS3(
 #endif /* UCX, BSN */
 
     if (fildes <= 0)
-        return -1;
+	return -1;
 
     if (HTCheckForInterrupt()) {
-        SOCKET_ERRNO = EINTR;
-        return (HT_INTERRUPTED);
+	SOCKET_ERRNO = EINTR;
+	return (HT_INTERRUPTED);
     }
 
 #if !defined(NO_IOCTL)
@@ -1012,17 +1012,17 @@ PUBLIC int HTDoRead ARGS3(
 	}
 
 	/*
-	**  If we suspend, then it is possible that select will be 
+	**  If we suspend, then it is possible that select will be
 	**  interrupted.  Allow for this possibility. - JED
 	*/
-        do {
+	do {
 	    timeout.tv_sec = 0;
 	    timeout.tv_usec = 100000;
 	    FD_ZERO(&readfds);
 	    FD_SET(fildes, &readfds);
 #ifdef SOCKS
 	    if (socks_flag)
-	        ret = Rselect(FD_SETSIZE,
+		ret = Rselect(FD_SETSIZE,
 			      (void *)&readfds, NULL, NULL, &timeout);
 	    else
 #endif /* SOCKS */
@@ -1030,34 +1030,34 @@ PUBLIC int HTDoRead ARGS3(
 			     (void *)&readfds, NULL, NULL, &timeout);
 	} while ((ret == -1) && (errno == EINTR));
 
-        if (ret < 0) {
-            return -1;
-        } else if (ret > 0) {
-            ready = 1;
-        } else if (HTCheckForInterrupt()) {
-       	    SOCKET_ERRNO = EINTR;
-            return HT_INTERRUPTED;
-        }
+	if (ret < 0) {
+	    return -1;
+	} else if (ret > 0) {
+	    ready = 1;
+	} else if (HTCheckForInterrupt()) {
+	    SOCKET_ERRNO = EINTR;
+	    return HT_INTERRUPTED;
+	}
     }
 
 #if !defined(UCX) || !defined(VAXC)
     return SOCKET_READ (fildes, buf, nbyte);
 #else
     /*
-    **  VAXC and UCX problem only.
+    **	VAXC and UCX problem only.
     */
     errno = vaxc$errno = 0;
     nb = SOCKET_READ (fildes, buf, nbyte);
     CTRACE(tfp,
-    	   "Read - nb,errno,vaxc$errno: %d %d %d\n", nb,errno,vaxc$errno);
+	   "Read - nb,errno,vaxc$errno: %d %d %d\n", nb,errno,vaxc$errno);
     if ((nb <= 0) && TRACE)
-        perror ("HTTCP.C:HTDoRead:read");          /* RJF */
+	perror ("HTTCP.C:HTDoRead:read");	   /* RJF */
     /*
-    **  An errno value of EPIPE and nb < 0 indicates end-of-file on VAXC.
+    **	An errno value of EPIPE and nb < 0 indicates end-of-file on VAXC.
     */
     if ((nb <= 0) && (errno == EPIPE)) {
-        nb = 0;
-        errno = 0;
+	nb = 0;
+	errno = 0;
     }
     return nb;
 #endif /* UCX, BSN */
diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c
index 2459d1b1..140630e1 100644
--- a/WWW/Library/Implementation/HTTelnet.c
+++ b/WWW/Library/Implementation/HTTelnet.c
@@ -544,8 +544,8 @@ PRIVATE int HTLoadTelnet
 ARGS4
 (
  CONST char *,		addr,
- HTParentAnchor *,	anchor,
- HTFormat,		format_out,
+ HTParentAnchor *,	anchor GCC_UNUSED,
+ HTFormat,		format_out GCC_UNUSED,
  HTStream *,		sink			/* Ignored */
 )
 {
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 0eb9bfba..63025052 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -19,6 +19,8 @@
 #include <sys/types.h>
 #else
 
+#define DONT_TRACK_INTERNAL_LINKS 1
+
 /* Explicit system-configure */
 #ifdef VMS
 #define NO_SIZECHANGE
@@ -146,6 +148,10 @@ SOLARIS 2
 
 #endif
 
+#ifndef	GCC_UNUSED
+#define	GCC_UNUSED /* nothing */
+#endif
+
 #ifdef _WINDOWS                         /* SCW */
 #include "windef.h"
 #define BOOLEAN_DEFINED
@@ -420,7 +426,7 @@ Upper- and Lowercase macros
   /* Pyramid and Mips can't uppercase non-alpha */
 #define TOLOWER(c) (isupper((unsigned char)c) ? tolower((unsigned char)c) : (c))
 #define TOUPPER(c) (islower((unsigned char)c) ? toupper((unsigned char)c) : (c))
-#endif /* ndef TOLOWER */
+#endif /* TOLOWER */
 
 /*
 
diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c
index 56608ac3..e7f15dad 100644
--- a/WWW/Library/Implementation/HTWSRC.c
+++ b/WWW/Library/Implementation/HTWSRC.c
@@ -14,9 +14,6 @@
 #include "HTWSRC.h"
 
 
-/* #include <sys/types.h>	already in tcp.h */
-/* #include <sys/stat.h>	this too	 */
-/* #include <stdio.h> included in HTUtils.h -- FM */
 #include "HTML.h"
 #include "HTParse.h"
 
@@ -428,7 +425,7 @@ PRIVATE void WSRCParser_free ARGS1(HTStream *, me)
     FREE(me);
 }
 
-PRIVATE void WSRCParser_abort ARGS2(HTStream *, me, HTError, e)
+PRIVATE void WSRCParser_abort ARGS2(HTStream *, me, HTError, e GCC_UNUSED)
 {
     WSRCParser_free(me);
 }
diff --git a/WWW/Library/Implementation/HTWriter.c b/WWW/Library/Implementation/HTWriter.c
index e9a369aa..f803920f 100644
--- a/WWW/Library/Implementation/HTWriter.c
+++ b/WWW/Library/Implementation/HTWriter.c
@@ -24,7 +24,7 @@ struct _HTStream {
 
 	int	soc;
 	char	*write_pointer;
-	char 	buffer[BUFFER_SIZE];
+	char	buffer[BUFFER_SIZE];
 #ifdef NOT_ASCII
 	BOOL	make_ascii;	/* Are we writing to the net? */
 #endif
@@ -37,19 +37,19 @@ struct _HTStream {
 
 PRIVATE void flush ARGS1(HTStream *, me)
 {
-    char *read_pointer 	= me->buffer;
+    char *read_pointer	= me->buffer;
     char *write_pointer = me->write_pointer;
 
 #ifdef NOT_ASCII
     if (me->make_ascii) {
-    	char * p;
+	char * p;
 	for(p = me->buffer; p < me->write_pointer; p++)
 	    *p = TOASCII(*p);
     }
 #endif
     while (read_pointer < write_pointer) {
-        int status;
-	status = NETWRITE(me->soc, me->buffer,  /* Put timeout? @@@ */
+	int status;
+	status = NETWRITE(me->soc, me->buffer,	/* Put timeout? @@@ */
 			write_pointer - read_pointer);
 	if (status<0) {
 	    if(TRACE) fprintf(stderr,
@@ -64,7 +64,7 @@ PRIVATE void flush ARGS1(HTStream *, me)
 
 /*_________________________________________________________________________
 **
-**			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
@@ -98,14 +98,14 @@ PRIVATE void HTWriter_put_string ARGS2(HTStream *, me, CONST char*, s)
 */
 PRIVATE void HTWriter_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 {
- 
-    CONST char *read_pointer 	= s;
+
+    CONST char *read_pointer	= s;
     CONST char *write_pointer = s+l;
 
     flush(me);		/* First get rid of our buffer */
 
     while (read_pointer < write_pointer) {
-        int status = NETWRITE(me->soc, (char *)read_pointer,
+	int status = NETWRITE(me->soc, (char *)read_pointer,
 			write_pointer - read_pointer);
 	if (status<0) {
 	    if(TRACE) fprintf(stderr,
@@ -132,7 +132,7 @@ PRIVATE void HTWriter_free ARGS1(HTStream *, me)
     FREE(me);
 }
 
-PRIVATE void HTWriter_abort ARGS2(HTStream *, me, HTError, e)
+PRIVATE void HTWriter_abort ARGS2(HTStream *, me, HTError, e GCC_UNUSED)
 {
     HTWriter_free(me);
 }
@@ -142,13 +142,13 @@ PRIVATE void HTWriter_abort ARGS2(HTStream *, me, HTError, e)
 **	-----------------------
 */
 PRIVATE CONST HTStreamClass HTWriter = /* As opposed to print etc */
-{		
+{
 	"SocketWriter",
 	HTWriter_free,
 	HTWriter_abort,
 	HTWriter_put_character, HTWriter_put_string,
 	HTWriter_write
-}; 
+};
 
 
 /*	Subclass-specific Methods
@@ -159,11 +159,11 @@ PUBLIC HTStream* HTWriter_new ARGS1(int, soc)
 {
     HTStream* me = (HTStream*)malloc(sizeof(*me));
     if (me == NULL) outofmem(__FILE__, "HTML_new");
-    me->isa = &HTWriter;       
-    
+    me->isa = &HTWriter;
+
 #ifdef NOT_ASCII
     me->make_ascii = NO;
-#endif    
+#endif
     me->soc = soc;
     me->write_pointer = me->buffer;
     return me;
@@ -177,11 +177,11 @@ PUBLIC HTStream* HTASCIIWriter ARGS1(int, soc)
 {
     HTStream* me = (HTStream*)malloc(sizeof(*me));
     if (me == NULL) outofmem(__FILE__, "HTML_new");
-    me->isa = &HTWriter;       
+    me->isa = &HTWriter;
 
 #ifdef NOT_ASCII
     me->make_ascii = YES;
-#endif    
+#endif
     me->soc = soc;
     me->write_pointer = me->buffer;
     return me;
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index 982343c4..df5d8e3d 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -418,44 +418,11 @@ PRIVATE void handle_entity ARGS2(
     CONST char *s = context->string->data;
 #ifdef NOTUSED_FOTEMODS
     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;
-    }
-
-    /*
-    **	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
 
+
     /*
-    **	Handle all other entities normally. - FM
+    **	Handle all entities normally. - FM
     */
     FoundEntity = FALSE;
     if ((code = HTMLGetEntityUCValue(s)) != 0) {
@@ -1873,12 +1840,15 @@ top1:
 	    HTChunkTerminate(string);
 	    if ((context->isHex ? sscanf(string->data, "%lx", &code) :
 				  sscanf(string->data, "%ld", &code)) == 1) {
-#ifdef NOTUSED_FOTEMODS
 		if ((code == 1) ||
 		    (code > 129 && code < 156)) {
 		    /*
 		    **	Assume these are MicroSoft code points,
 		    **	inflicted on us by FrontPage. - FM
+		    **
+		    **	MS FrontPage uses syntax like &#153; in 128-159 range
+		    **	and doesn't follow Unicode standards for this area.
+		    **	Windows-1252 codepoints are assumed here.
 		    */
 		    switch (code) {
 			case 1:
@@ -1999,7 +1969,6 @@ top1:
 			    break;
 		    }
 		}
-#endif /* NOTUSED_FOTEMODS */
 		/*
 		**  Check for special values. - FM
 		*/
diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h
index 7b27da6e..09ff6fe9 100644
--- a/WWW/Library/Implementation/SGML.h
+++ b/WWW/Library/Implementation/SGML.h
@@ -142,13 +142,13 @@ typedef struct {
     int                 number_of_tags;
     CONST char **       entity_names;   /* Must be in strcmp order by name */
     size_t              number_of_entities;
-    CONST UC_entity_info * extra_entity_info; /* strcmp order by name */
-    size_t              number_of_extra_entities;
+    CONST UC_entity_info * unicode_entity_info; /* strcmp order by name */
+    size_t              number_of_unicode_entities;
 			/*
-			**  All calls to extra_entities table should be done
+			**  All calls to unicode_entities table should be done
 			**  through HTMLGetEntityUCValue (LYCharSets.c) only.
-			**  Unicode-based extra_entities table now hold *all*
-			**  old-style entities either.
+			**  unicode_entities table now holds *all*
+			**  old-style entities too.
 			*/
 } SGML_dtd;
 
diff --git a/WWW/Library/Implementation/entities.h b/WWW/Library/Implementation/entities.h
index 1fcbac53..55ce977b 100644
--- a/WWW/Library/Implementation/entities.h
+++ b/WWW/Library/Implementation/entities.h
@@ -1,10 +1,8 @@
-/*	Extra Entity Names
-**	------------------
-**
-**	This table contains Unicodes in addition to the Names.
+/*	Entity Names to Unicode table
+**	-----------------------------
 **
 *
-*	Whole entities[] thing above (and much more) now present
+*	Whole entities[] thing (and much more) now present
 *	in this kind of structure. The structured streams to which
 *	the SGML modules sends its output could then easily have access
 *	to both entity names and unicode values for each (special)
@@ -17,11 +15,13 @@
 *	Why keep two structures for entities?  Backward compatibility..
 */
 
-/* UC_entity_info structure is defined in SGML.h. */
-/* This has to be sorted alphabetically (case-sensitive),
-   bear this in mind when you add some more entities..
+/* UC_entity_info structure is defined in SGML.h.
+   This has to be sorted alphabetically (case-sensitive),
+   bear this in mind when you add some more entities..  */
+
+/*
 
-This table available from ftp://ftp.unicode.org/MAPPINGS/
+This table available from ftp://ftp.unicode.org/
 original comment follows:
 
 
@@ -50,10 +50,11 @@ original comment follows:
 # The contents of this table are drawn from various sources, and
 # are in the public domain.
 #
-*/
+########################
 
-/* We just sort it and move column 2 away (line too long, sorry).
-   Also we add a few synonyms (obsolete):
+   We just sort it and move column 2 away (line too long, sorry;
+   look at sgml.html in test/ directory for details).
+   Also we add a few (obsolete) synonyms:
    "brkbar"  for "brvbar" 0x00A6
    "emdash"  for "mdash" 0x2014
    "endash"  for "ndash" 0x2013
@@ -62,7 +63,7 @@ original comment follows:
    BTW, lots of synonyms found in this table, we shouldn't worry about...
 */
 
-static CONST UC_entity_info extra_entities[] = {
+static CONST UC_entity_info unicode_entities[] = {
   {"AElig",	0x00C6},  /* LATIN CAPITAL LETTER AE			   */
   {"Aacgr",	0x0386},  /* GREEK CAPITAL LETTER ALPHA WITH TONOS	   */
   {"Aacute",	0x00C1},  /* LATIN CAPITAL LETTER A WITH ACUTE		   */
diff --git a/WWW/Library/unix/makefile.in b/WWW/Library/unix/makefile.in
index 89c1cf2f..94918497 100644
--- a/WWW/Library/unix/makefile.in
+++ b/WWW/Library/unix/makefile.in
@@ -20,7 +20,7 @@ LYFLAGS		= # FIXME: set in parent makefile
 CC		= @CC@
 DEFS		= @DEFS@
 CPPFLAGS	= @CPPFLAGS@
-CPPOPTS		= $(DEFS) $(CPPFLAGS) $(LYFLAGS) -I../../.. -I../../../src
+CPPOPTS		= $(DEFS) $(CPPFLAGS) $(LYFLAGS) -I../../.. -I../../../src -I$(top_srcdir) -I$(top_srcdir)/src
 LY_CFLAGS	= @CFLAGS@
 CFLAGS		= $(CPPOPTS) $(LY_CFLAGS)
 
diff --git a/aclocal.m4 b/aclocal.m4
index c445c450..c72d6cf8 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -144,6 +144,9 @@ AC_DEFUN([CF_CHECK_ERRNO],
 AC_MSG_CHECKING([declaration of $1])
 AC_CACHE_VAL(cf_cv_dcl_$1,[
     AC_TRY_COMPILE([
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 #include <stdio.h>
 #include <sys/types.h>
 #include <errno.h> ],
@@ -394,7 +397,7 @@ dnl
 AC_DEFUN([CF_DISABLE_ECHO],[
 AC_MSG_CHECKING(if you want to see long compiling messages)
 CF_ARG_DISABLE(echo,
-	[  --disable-echo          test: display \"compiling\" commands],
+	[  --disable-echo          test: display "compiling" commands],
 	[
     ECHO_LD='@echo linking [$]@;'
     RULE_CC='	@echo compiling [$]<'
@@ -508,6 +511,28 @@ AC_TRY_LINK([
 test "$cf_cv_fionbio" = "fcntl" && AC_DEFINE(USE_FCNTL)
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl A conventional existence-check for 'lstat' won't work with the Linux
+dnl version of gcc 2.7.0, since the symbol is defined only within <sys/stat.h>
+dnl as an inline function.
+dnl
+dnl So much for portability.
+AC_DEFUN([CF_FUNC_LSTAT],
+[
+AC_MSG_CHECKING(for lstat)
+AC_CACHE_VAL(ac_cv_func_lstat,[
+AC_TRY_LINK([
+#include <sys/types.h>
+#include <sys/stat.h>],
+	[lstat(".", (struct stat *)0)],
+	[ac_cv_func_lstat=yes],
+	[ac_cv_func_lstat=no])
+	])
+AC_MSG_RESULT($ac_cv_func_lstat )
+if test $ac_cv_func_lstat = yes; then
+	AC_DEFINE(HAVE_LSTAT)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'
 dnl and/or 'waitpid()'.
 dnl
@@ -546,6 +571,83 @@ if test $cf_cv_type_unionwait = yes; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl Test for availability of useful gcc __attribute__ directives to quiet
+dnl compiler warnings.  Though useful, not all are supported -- and contrary
+dnl to documentation, unrecognized directives cause older compilers to barf.
+AC_DEFUN([CF_GCC_ATTRIBUTES],
+[
+if test -n "$GCC"
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test -n "$GCC"
+then
+	AC_CHECKING([for gcc __attribute__ directives])
+	changequote(,)dnl
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+	changequote([,])dnl
+	for cf_attribute in scanf printf unused noreturn
+	do
+		CF_UPPER(CF_ATTRIBUTE,$cf_attribute)
+		cf_directive="__attribute__(($cf_attribute))"
+		echo "checking for gcc $cf_directive" 1>&AC_FD_CC
+		case $cf_attribute in
+		scanf|printf)
+		cat >conftest.h <<EOF
+#define GCC_$CF_ATTRIBUTE 1
+EOF
+			;;
+		*)
+		cat >conftest.h <<EOF
+#define GCC_$CF_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
+			cat conftest.h >>confdefs.h
+#		else
+#			sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl Check if the compiler supports useful warning options.  There's a few that
 dnl we don't use, simply because they're too noisy:
 dnl
diff --git a/config.hin b/config.hin
index ce313f5f..11ac7008 100644
--- a/config.hin
+++ b/config.hin
@@ -16,8 +16,10 @@
 #undef DECL_SYS_ERRLIST
 #undef DIRED_SUPPORT		/* AC_ARG_WITH(dired) */
 #undef DONT_TRACK_INTERNAL_LINKS /* CF_ARG_DISABLE(internal-links) */
+#undef EXP_8BIT_TOUPPER		/* AC_ARG_WITH(8bit-toupper) */
 #undef EXP_CHARTRANS_AUTOSWITCH	/* AC_ARG_WITH(font-switch) */
 #undef FANCY_CURSES		/* defined by CF_FANCY_CURSES */
+#undef GCC_UNUSED		/* CF_GCC_ATTRIBUTES */
 #undef GZIP_PATH		/* CF_PATH_PROG(gzip) */
 #undef HAVE_CBREAK
 #undef HAVE_CUSERID
@@ -28,10 +30,12 @@
 #undef HAVE_GETGROUPS
 #undef HAVE_KEYPAD
 #undef HAVE_LIMITS_H
+#undef HAVE_LSTAT		/* defined by CF_FUNC_LSTAT */
 #undef HAVE_NCURSES_H		/* defined if we include <ncurses.h> */
 #undef HAVE_PUTENV
 #undef HAVE_READDIR
 #undef HAVE_SIZECHANGE		/* defined by CF_SIZECHANGE */
+#undef HAVE_STDLIB_H
 #undef HAVE_STRERROR
 #undef HAVE_STRING_H
 #undef HAVE_SYS_DIR_H		/* defined by AC_HEADER_DIRENT */
@@ -88,6 +92,7 @@
 #undef UNIX
 #undef UNZIP_PATH		/* CF_PATH_PROG(unzip) */
 #undef USE_COLOR_STYLE		/* CF_ARG_ENABLE(color-style) */
+#undef USE_DEFAULT_COLORS	/* CF_ARG_ENABLE(default-colors) */
 #undef USE_EXTERNALS		/* CF_ARG_ENABLE(externs) */
 #undef USE_FCNTL		/* CF_FIONBIO */
 #undef USE_HASH			/* see USE_COLOR_STYLE */
@@ -120,6 +125,10 @@
 /* FIXME:SVR4_BSDSELECT */
 /* FIXME:SYSLOG_REQUESTED_URLS */
 
+#ifndef HAVE_LSTAT
+#define lstat stat
+#endif
+
 #ifdef DECL_GETGRGID
 extern struct group * getgrgid ();
 #endif
diff --git a/configure b/configure
index f9d2f474..15d17de4 100755
--- a/configure
+++ b/configure
@@ -184,7 +184,7 @@ EOF
 cat <<EOF
 --enable and --with options recognized:
 Development Options:
-  --disable-echo          test: display \"compiling\" commands (default: on)
+  --disable-echo          test: display "compiling" commands (default: on)
   --enable-find-leaks     logic for testing memory leaks (default: off)
   --enable-debug          logic for traces/debugging (default: off)
   --enable-warnings       GCC compiler warnings (default: off)
@@ -193,13 +193,15 @@ Basic Configuration Options:
   --with-screen=XXX       select screen type
                           (XXX is curses (default), ncurses or slang)
 Miscellaneous Options:
+  --enable-8bit-toupper   use experimental 8-bit case-conversion (default: off)
   --enable-color-style    use optional/experimental color style (default: off)
+  --enable-default-colors enable use of default-colors (ncurses/slang) (default: off)
   --disable-extended-dtd  disable extended HTML DTD logic (default: on)
-  --enable-externs        use external commands (default: off)
-  --enable-font-switch    use Linux setfont for character-translation (default: off)
 EOF
 cat <<EOF
-  --disable-internal-links handle following links to same doc differently (default: on)
+  --enable-externs        use external commands (default: off)
+  --enable-font-switch    use Linux setfont for character-translation (default: off)
+  --enable-internal-links  handle following links to same doc differently (default: off)
   --enable-nsl-fork       fork NSL requests, allowing them to be aborted (default: off)
   --enable-underlines     underline links rather than using boldface (default: off)
   --with-zlib             use zlib for decompression of some gzip files
@@ -209,10 +211,10 @@ Directory Editor Options:
   --disable-dired-override disable private keymaps (default: on)
   --disable-dired-permit  disable chmod/attrib commands (default: on)
   --disable-dired-xpermit disable chmod/attrib commands (default: on)
-  --disable-dired-tar     disable "tar" command (default: on)
-  --disable-dired-uudecode disable "uudecode" command (default: on)
 EOF
 cat <<EOF
+  --disable-dired-tar     disable "tar" command (default: on)
+  --disable-dired-uudecode disable "uudecode" command (default: on)
   --disable-dired-zip     disable "zip", "unzip"  commands (default: on)
   --disable-dired-gzip    disable "gzip", "gunzip" commands (default: on)
   --disable-long-list     disable long "ls -l" directory listings (default: on)
@@ -583,7 +585,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:587: checking host system type" >&5
+echo "configure:589: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -608,7 +610,7 @@ echo "$ac_t""$host" 1>&6
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:612: checking for $ac_word" >&5
+echo "configure:614: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -637,7 +639,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:641: checking for $ac_word" >&5
+echo "configure:643: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -685,7 +687,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:689: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -695,11 +697,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 699 "configure"
+#line 701 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -719,12 +721,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:723: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:728: checking whether we are using GNU C" >&5
+echo "configure:730: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -733,7 +735,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -748,7 +750,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:752: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:754: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -776,7 +778,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:780: checking how to run the C preprocessor" >&5
+echo "configure:782: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -791,13 +793,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 795 "configure"
+#line 797 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -808,13 +810,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 812 "configure"
+#line 814 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -839,7 +841,7 @@ echo "$ac_t""$CPP" 1>&6
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:843: checking for $ac_word" >&5
+echo "configure:845: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -866,7 +868,7 @@ else
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:870: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:872: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -894,7 +896,7 @@ fi
 
 
 echo $ac_n "checking for style of include in makefiles""... $ac_c" 1>&6
-echo "configure:898: checking for style of include in makefiles" >&5
+echo "configure:900: checking for style of include in makefiles" >&5
 
 make_include_left=""
 make_include_right=""
@@ -955,7 +957,7 @@ echo "$ac_t""${make_include_left}file${make_include_right}" 1>&6
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:959: checking for a BSD compatible install" >&5
+echo "configure:961: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1009,7 +1011,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1013: checking for $ac_word" >&5
+echo "configure:1015: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1043,7 +1045,7 @@ done
 
 
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:1047: checking if you want to see long compiling messages" >&5
+echo "configure:1049: checking if you want to see long compiling messages" >&5
 
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
@@ -1083,7 +1085,7 @@ echo "$ac_t""$enableval" 1>&6
 
 
 echo $ac_n "checking if you want to check memory-leaks""... $ac_c" 1>&6
-echo "configure:1087: checking if you want to check memory-leaks" >&5
+echo "configure:1089: checking if you want to check memory-leaks" >&5
 
 # Check whether --enable-find-leaks or --disable-find-leaks was given.
 if test "${enable_find_leaks+set}" = set; then
@@ -1107,7 +1109,7 @@ EOF
 
 
 echo $ac_n "checking if you want to enable debug-code""... $ac_c" 1>&6
-echo "configure:1111: checking if you want to enable debug-code" >&5
+echo "configure:1113: checking if you want to enable debug-code" >&5
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
@@ -1152,7 +1154,7 @@ fi
 if test -n "$GCC"
 then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:1156: checking if you want to turn on gcc warnings" >&5
+echo "configure:1158: checking if you want to turn on gcc warnings" >&5
 
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
@@ -1175,12 +1177,85 @@ then
 	
 if test -n "$GCC"
 then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test -n "$GCC"
+then
+	echo "checking for gcc __attribute__ directives" 1>&6
+echo "configure:1198: checking for gcc __attribute__ directives" >&5
+	cat > conftest.$ac_ext <<EOF
+#line 1200 "configure"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+		for cf_attribute in scanf printf unused noreturn
+	do
+		
+CF_ATTRIBUTE=`echo $cf_attribute | tr '[a-z]' '[A-Z]'`
+
+		cf_directive="__attribute__(($cf_attribute))"
+		echo "checking for gcc $cf_directive" 1>&5
+		case $cf_attribute in
+		scanf|printf)
+		cat >conftest.h <<EOF
+#define GCC_$CF_ATTRIBUTE 1
+EOF
+			;;
+		*)
+		cat >conftest.h <<EOF
+#define GCC_$CF_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+		if { (eval echo configure:1238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+			test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
+			cat conftest.h >>confdefs.h
+#		else
+#			sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+
+	
+if test -n "$GCC"
+then
 		cat > conftest.$ac_ext <<EOF
-#line 1180 "configure"
+#line 1255 "configure"
 int main(int argc, char *argv[]) { return argv[argc-1] == 0; }
 EOF
 		echo "checking for gcc warning options" 1>&6
-echo "configure:1184: checking for gcc warning options" >&5
+echo "configure:1259: checking for gcc warning options" >&5
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-W -Wall"
 	cf_warn_CONST=""
@@ -1198,7 +1273,7 @@ echo "configure:1184: checking for gcc warning options" >&5
 		Wstrict-prototypes $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo configure:1202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+		if { (eval echo configure:1277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 			test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
@@ -1216,7 +1291,7 @@ fi
 
 
 echo $ac_n "checking if you want full utility pathnames""... $ac_c" 1>&6
-echo "configure:1220: checking if you want full utility pathnames" >&5
+echo "configure:1295: checking if you want full utility pathnames" >&5
 
 # Check whether --enable-full-paths or --disable-full-paths was given.
 if test "${enable_full_paths+set}" = set; then
@@ -1237,7 +1312,7 @@ echo "$ac_t""$with_full_paths" 1>&6
 
 
 echo $ac_n "checking for system mailer""... $ac_c" 1>&6
-echo "configure:1241: checking for system mailer" >&5
+echo "configure:1316: checking for system mailer" >&5
 if eval "test \"`echo '$''{'cf_cv_SYSTEM_MAIL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1264,7 +1339,7 @@ EOF
 
 
 echo $ac_n "checking system mail flags""... $ac_c" 1>&6
-echo "configure:1268: checking system mail flags" >&5
+echo "configure:1343: checking system mail flags" >&5
 if eval "test \"`echo '$''{'cf_cv_system_mail_flags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1292,7 +1367,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "chmod", so it can be a program name with args.
 set dummy chmod; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1296: checking for $ac_word" >&5
+echo "configure:1371: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1323,7 +1398,7 @@ fi
 
 else
 	echo $ac_n "checking for chmod""... $ac_c" 1>&6
-echo "configure:1327: checking for chmod" >&5
+echo "configure:1402: checking for chmod" >&5
 	echo "$ac_t""$CHMOD" 1>&6
 fi
 
@@ -1357,7 +1432,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "compress", so it can be a program name with args.
 set dummy compress; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1361: checking for $ac_word" >&5
+echo "configure:1436: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1388,7 +1463,7 @@ fi
 
 else
 	echo $ac_n "checking for compress""... $ac_c" 1>&6
-echo "configure:1392: checking for compress" >&5
+echo "configure:1467: checking for compress" >&5
 	echo "$ac_t""$COMPRESS" 1>&6
 fi
 
@@ -1422,7 +1497,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1426: checking for $ac_word" >&5
+echo "configure:1501: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1453,7 +1528,7 @@ fi
 
 else
 	echo $ac_n "checking for cp""... $ac_c" 1>&6
-echo "configure:1457: checking for cp" >&5
+echo "configure:1532: checking for cp" >&5
 	echo "$ac_t""$COPY" 1>&6
 fi
 
@@ -1487,7 +1562,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1491: checking for $ac_word" >&5
+echo "configure:1566: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1518,7 +1593,7 @@ fi
 
 else
 	echo $ac_n "checking for gzip""... $ac_c" 1>&6
-echo "configure:1522: checking for gzip" >&5
+echo "configure:1597: checking for gzip" >&5
 	echo "$ac_t""$GZIP" 1>&6
 fi
 
@@ -1552,7 +1627,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "mkdir", so it can be a program name with args.
 set dummy mkdir; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1556: checking for $ac_word" >&5
+echo "configure:1631: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1583,7 +1658,7 @@ fi
 
 else
 	echo $ac_n "checking for mkdir""... $ac_c" 1>&6
-echo "configure:1587: checking for mkdir" >&5
+echo "configure:1662: checking for mkdir" >&5
 	echo "$ac_t""$MKDIR" 1>&6
 fi
 
@@ -1617,7 +1692,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1621: checking for $ac_word" >&5
+echo "configure:1696: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1648,7 +1723,7 @@ fi
 
 else
 	echo $ac_n "checking for mv""... $ac_c" 1>&6
-echo "configure:1652: checking for mv" >&5
+echo "configure:1727: checking for mv" >&5
 	echo "$ac_t""$MV" 1>&6
 fi
 
@@ -1682,7 +1757,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "rm", so it can be a program name with args.
 set dummy rm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1686: checking for $ac_word" >&5
+echo "configure:1761: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1713,7 +1788,7 @@ fi
 
 else
 	echo $ac_n "checking for rm""... $ac_c" 1>&6
-echo "configure:1717: checking for rm" >&5
+echo "configure:1792: checking for rm" >&5
 	echo "$ac_t""$RM" 1>&6
 fi
 
@@ -1747,7 +1822,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "tar", so it can be a program name with args.
 set dummy tar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1751: checking for $ac_word" >&5
+echo "configure:1826: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1778,7 +1853,7 @@ fi
 
 else
 	echo $ac_n "checking for tar""... $ac_c" 1>&6
-echo "configure:1782: checking for tar" >&5
+echo "configure:1857: checking for tar" >&5
 	echo "$ac_t""$TAR" 1>&6
 fi
 
@@ -1812,7 +1887,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "touch", so it can be a program name with args.
 set dummy touch; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1816: checking for $ac_word" >&5
+echo "configure:1891: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1843,7 +1918,7 @@ fi
 
 else
 	echo $ac_n "checking for touch""... $ac_c" 1>&6
-echo "configure:1847: checking for touch" >&5
+echo "configure:1922: checking for touch" >&5
 	echo "$ac_t""$TOUCH" 1>&6
 fi
 
@@ -1877,7 +1952,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "gunzip", so it can be a program name with args.
 set dummy gunzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1881: checking for $ac_word" >&5
+echo "configure:1956: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNCOMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1908,7 +1983,7 @@ fi
 
 else
 	echo $ac_n "checking for gunzip""... $ac_c" 1>&6
-echo "configure:1912: checking for gunzip" >&5
+echo "configure:1987: checking for gunzip" >&5
 	echo "$ac_t""$UNCOMPRESS" 1>&6
 fi
 
@@ -1942,7 +2017,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "unzip", so it can be a program name with args.
 set dummy unzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1946: checking for $ac_word" >&5
+echo "configure:2021: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1973,7 +2048,7 @@ fi
 
 else
 	echo $ac_n "checking for unzip""... $ac_c" 1>&6
-echo "configure:1977: checking for unzip" >&5
+echo "configure:2052: checking for unzip" >&5
 	echo "$ac_t""$UNZIP" 1>&6
 fi
 
@@ -2007,7 +2082,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "uudecode", so it can be a program name with args.
 set dummy uudecode; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2011: checking for $ac_word" >&5
+echo "configure:2086: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UUDECODE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2038,7 +2113,7 @@ fi
 
 else
 	echo $ac_n "checking for uudecode""... $ac_c" 1>&6
-echo "configure:2042: checking for uudecode" >&5
+echo "configure:2117: checking for uudecode" >&5
 	echo "$ac_t""$UUDECODE" 1>&6
 fi
 
@@ -2072,7 +2147,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "zcat", so it can be a program name with args.
 set dummy zcat; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2076: checking for $ac_word" >&5
+echo "configure:2151: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZCAT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2103,7 +2178,7 @@ fi
 
 else
 	echo $ac_n "checking for zcat""... $ac_c" 1>&6
-echo "configure:2107: checking for zcat" >&5
+echo "configure:2182: checking for zcat" >&5
 	echo "$ac_t""$ZCAT" 1>&6
 fi
 
@@ -2137,7 +2212,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "zip", so it can be a program name with args.
 set dummy zip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2141: checking for $ac_word" >&5
+echo "configure:2216: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2168,7 +2243,7 @@ fi
 
 else
 	echo $ac_n "checking for zip""... $ac_c" 1>&6
-echo "configure:2172: checking for zip" >&5
+echo "configure:2247: checking for zip" >&5
 	echo "$ac_t""$ZIP" 1>&6
 fi
 
@@ -2221,7 +2296,7 @@ EOF
 if test -z "$GCC" ; then
 	
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:2225: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:2300: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2239,7 +2314,7 @@ for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
 do
 	CFLAGS="$cf_save_CFLAGS $cf_arg"
 	cat > conftest.$ac_ext <<EOF
-#line 2243 "configure"
+#line 2318 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -2255,7 +2330,7 @@ int main() {
 	struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:2259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -2283,12 +2358,12 @@ fi
 
 fi
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2287: checking for working const" >&5
+echo "configure:2362: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2292 "configure"
+#line 2367 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2337,7 +2412,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2358,6 +2433,7 @@ EOF
 fi
 
 
+PROG_EXT=
 case $host_os in
 aix4*)
 	CFLAGS="$CFLAGS -DAIX4 -D_BSD=44" 
@@ -2377,7 +2453,7 @@ clix*)
 	# contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also
 	# references -lmalloc and -lbsd.
 	echo $ac_n "checking for strcmp in -lc_s""... $ac_c" 1>&6
-echo "configure:2381: checking for strcmp in -lc_s" >&5
+echo "configure:2457: checking for strcmp in -lc_s" >&5
 ac_lib_var=`echo c_s'_'strcmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2385,7 +2461,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2389 "configure"
+#line 2465 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2396,7 +2472,7 @@ int main() {
 strcmp()
 ; return 0; }
 EOF
-if { (eval echo configure:2400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2453,6 +2529,12 @@ next*)
 openbsd*)
 	LIBS="$LIBS -lcompat"
 	;;
+os2*)
+	# We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
+	CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
+	LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
+	PROG_EXT=".exe"
+	;;
 osf*)
 	# Increase the maximum size of functions that will be optimized.
 	test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 4000"
@@ -2474,7 +2556,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2478: checking for $ac_word" >&5
+echo "configure:2560: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2518,17 +2600,17 @@ sony-newsos*)
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2522: checking for $ac_hdr" >&5
+echo "configure:2604: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2527 "configure"
+#line 2609 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2572,17 +2654,17 @@ ultrix*)
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2576: checking for $ac_hdr" >&5
+echo "configure:2658: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2581 "configure"
+#line 2663 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2613,9 +2695,10 @@ esac
 
 
 
+
 cf_test_netlibs=no
 echo $ac_n "checking for network libraries""... $ac_c" 1>&6
-echo "configure:2619: checking for network libraries" >&5
+echo "configure:2702: checking for network libraries" >&5
 if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2626,12 +2709,12 @@ cf_test_netlibs=yes
 for ac_func in gethostname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2630: checking for $ac_func" >&5
+echo "configure:2713: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2635 "configure"
+#line 2718 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2654,7 +2737,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2677,7 +2760,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:2681: checking for gethostname in -lnsl" >&5
+echo "configure:2764: checking for gethostname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2685,7 +2768,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2689 "configure"
+#line 2772 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2696,7 +2779,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2729,7 +2812,7 @@ else
 	
 		
 echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:2733: checking for gethostname in -lsocket" >&5
+echo "configure:2816: checking for gethostname in -lsocket" >&5
 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2737,7 +2820,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2741 "configure"
+#line 2824 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2748,7 +2831,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2792,21 +2875,21 @@ done
 # FIXME:  sequent needs this library (i.e., -lsocket -linet -lnsl), but
 # I don't know the entrypoints - 97/7/22 TD
 echo $ac_n "checking for -linet""... $ac_c" 1>&6
-echo "configure:2796: checking for -linet" >&5
+echo "configure:2879: checking for -linet" >&5
 if eval "test \"`echo '$''{'ac_cv_lib_inet'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2803 "configure"
+#line 2886 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_inet=yes
 else
@@ -2829,12 +2912,12 @@ if test "$ac_cv_func_lsocket" != no ; then
 for ac_func in socket
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2833: checking for $ac_func" >&5
+echo "configure:2916: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2838 "configure"
+#line 2921 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2857,7 +2940,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2880,7 +2963,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2884: checking for socket in -lsocket" >&5
+echo "configure:2967: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2888,7 +2971,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2892 "configure"
+#line 2975 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2899,7 +2982,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2932,7 +3015,7 @@ else
 	
 		
 echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
-echo "configure:2936: checking for socket in -lbsd" >&5
+echo "configure:3019: checking for socket in -lbsd" >&5
 ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2940,7 +3023,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2944 "configure"
+#line 3027 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2951,7 +3034,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2996,12 +3079,12 @@ fi
 for ac_func in gethostbyname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3000: checking for $ac_func" >&5
+echo "configure:3083: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3005 "configure"
+#line 3088 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3024,7 +3107,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3047,7 +3130,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3051: checking for gethostbyname in -lnsl" >&5
+echo "configure:3134: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3055,7 +3138,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3059 "configure"
+#line 3142 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3066,7 +3149,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3107,12 +3190,12 @@ done
 for ac_func in strcasecmp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3111: checking for $ac_func" >&5
+echo "configure:3194: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3116 "configure"
+#line 3199 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3135,7 +3218,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3158,7 +3241,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:3162: checking for strcasecmp in -lresolv" >&5
+echo "configure:3245: checking for strcasecmp in -lresolv" >&5
 ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3166,7 +3249,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3170 "configure"
+#line 3253 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3177,7 +3260,7 @@ int main() {
 strcasecmp()
 ; return 0; }
 EOF
-if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3222,7 +3305,7 @@ test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6
 
 
 echo $ac_n "checking for screen type""... $ac_c" 1>&6
-echo "configure:3226: checking for screen type" >&5
+echo "configure:3309: checking for screen type" >&5
 if eval "test \"`echo '$''{'cf_cv_screen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3257,12 +3340,12 @@ case $cf_cv_screen in
 curses)
 	
 echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:3261: checking for initscr" >&5
+echo "configure:3344: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3266 "configure"
+#line 3349 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -3285,7 +3368,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -3306,7 +3389,7 @@ else
 case $host_os in #(vi
 freebsd*) #(vi
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:3310: checking for tgoto in -lmytinfo" >&5
+echo "configure:3393: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3314,7 +3397,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3318 "configure"
+#line 3401 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3325,7 +3408,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3348,7 +3431,7 @@ fi
 	;;
 *hp-hpux10.*)
 	echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:3352: checking for initscr in -lHcurses" >&5
+echo "configure:3435: checking for initscr in -lHcurses" >&5
 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3356,7 +3439,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3360 "configure"
+#line 3443 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3367,7 +3450,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3392,7 +3475,7 @@ else
   echo "$ac_t""no" 1>&6
 
 	echo $ac_n "checking for initscr in -lcur_color""... $ac_c" 1>&6
-echo "configure:3396: checking for initscr in -lcur_color" >&5
+echo "configure:3479: checking for initscr in -lcur_color" >&5
 ac_lib_var=`echo cur_color'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3400,7 +3483,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_color  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3404 "configure"
+#line 3487 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3411,7 +3494,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3456,12 +3539,12 @@ if test ".$ac_cv_func_initscr" != .yes ; then
 	# Check for library containing tgoto.  Do this before curses library
 	# because it may be needed to link the test-case for initscr.
 	echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:3460: checking for tgoto" >&5
+echo "configure:3543: checking for tgoto" >&5
 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3465 "configure"
+#line 3548 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
@@ -3484,7 +3567,7 @@ tgoto();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
@@ -3505,7 +3588,7 @@ else
 		for cf_term_lib in termcap termlib unknown
 		do
 			echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
-echo "configure:3509: checking for tgoto in -l$cf_term_lib" >&5
+echo "configure:3592: checking for tgoto in -l$cf_term_lib" >&5
 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3513,7 +3596,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_term_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3517 "configure"
+#line 3600 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3524,7 +3607,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3554,7 +3637,7 @@ fi
 	for cf_curs_lib in curses ncurses xcurses cursesX jcurses unknown
 	do
 		echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
-echo "configure:3558: checking for initscr in -l$cf_curs_lib" >&5
+echo "configure:3641: checking for initscr in -l$cf_curs_lib" >&5
 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3562,7 +3645,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_curs_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3566 "configure"
+#line 3649 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3573,7 +3656,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3599,16 +3682,16 @@ fi
 	LIBS="-l$cf_curs_lib $cf_save_LIBS"
 	if test "$cf_term_lib" = unknown ; then
 		echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
-echo "configure:3603: checking if we can link with $cf_curs_lib library" >&5
+echo "configure:3686: checking if we can link with $cf_curs_lib library" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 3605 "configure"
+#line 3688 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -3622,16 +3705,16 @@ rm -f conftest*
 		test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
 	elif test "$cf_term_lib" != predefined ; then
 		echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
-echo "configure:3626: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo "configure:3709: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 3628 "configure"
+#line 3711 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:3635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=no
 else
@@ -3641,14 +3724,14 @@ else
   
 			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
 			cat > conftest.$ac_ext <<EOF
-#line 3645 "configure"
+#line 3728 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -3670,14 +3753,14 @@ fi
 
 	
 echo $ac_n "checking for curses performance tradeoff""... $ac_c" 1>&6
-echo "configure:3674: checking for curses performance tradeoff" >&5
+echo "configure:3757: checking for curses performance tradeoff" >&5
 if eval "test \"`echo '$''{'cf_cv_curs_performance'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cf_cv_curs_performance=no
     cat > conftest.$ac_ext <<EOF
-#line 3681 "configure"
+#line 3764 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -3691,11 +3774,11 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:3695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 3699 "configure"
+#line 3782 "configure"
 #include "confdefs.h"
 
 #define CURS_PERFORMANCE
@@ -3710,7 +3793,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:3714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_curs_performance=yes
 else
@@ -3735,13 +3818,13 @@ EOF
 ncurses)
 	
 echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6
-echo "configure:3739: checking for ncurses header file" >&5
+echo "configure:3822: checking for ncurses header file" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 3745 "configure"
+#line 3828 "configure"
 #include "confdefs.h"
 #include <curses.h>
 int main() {
@@ -3758,7 +3841,7 @@ make an error
 	
 ; return 0; }
 EOF
-if { (eval echo configure:3762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_header=predefined
 else
@@ -3844,7 +3927,7 @@ done
 	;;
 esac
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:3848: checking for ncurses version" >&5
+echo "configure:3931: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3869,7 +3952,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:3873: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:3956: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -3878,7 +3961,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 3882 "configure"
+#line 3965 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -3901,7 +3984,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -3926,7 +4009,7 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:3930: checking for Gpm_Open in -lgpm" >&5
+echo "configure:4013: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3934,7 +4017,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3938 "configure"
+#line 4021 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3945,7 +4028,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:3949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3961,7 +4044,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:3965: checking for initscr in -lgpm" >&5
+echo "configure:4048: checking for initscr in -lgpm" >&5
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3969,7 +4052,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3973 "configure"
+#line 4056 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3980,7 +4063,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4011,7 +4094,7 @@ freebsd*)
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:4015: checking for tgoto in -lmytinfo" >&5
+echo "configure:4098: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4019,7 +4102,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4023 "configure"
+#line 4106 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4030,7 +4113,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4058,12 +4141,12 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 	cf_cv_have_lib_ncurses=no
 	cf_libdir=""
 	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:4062: checking for initscr" >&5
+echo "configure:4145: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4067 "configure"
+#line 4150 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -4086,7 +4169,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -4106,17 +4189,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:4110: checking for initscr in -lncurses" >&5
+echo "configure:4193: checking for initscr in -lncurses" >&5
 		LIBS="-lncurses $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 4113 "configure"
+#line 4196 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_ncurses=yes
@@ -4143,17 +4226,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/ncur
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4147: checking for -lncurses in $cf_libdir" >&5
+echo "configure:4230: checking for -lncurses in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 4150 "configure"
+#line 4233 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_ncurses=yes
@@ -4180,7 +4263,7 @@ fi
 
 if test -n "$cf_ncurses_LIBS" ; then
 	echo $ac_n "checking if we can link ncurses without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:4184: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
+echo "configure:4267: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
 		q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'`
@@ -4189,14 +4272,14 @@ echo "configure:4184: checking if we can link ncurses without $cf_ncurses_LIBS"
 		fi
 	done
 	cat > conftest.$ac_ext <<EOF
-#line 4193 "configure"
+#line 4276 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -4213,20 +4296,20 @@ fi
 slang)
 	
 echo $ac_n "checking for slang header file""... $ac_c" 1>&6
-echo "configure:4217: checking for slang header file" >&5
+echo "configure:4300: checking for slang header file" >&5
 if eval "test \"`echo '$''{'cf_cv_slang_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 4223 "configure"
+#line 4306 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 printf("%s\n", SLANG_VERSION)
 ; return 0; }
 EOF
-if { (eval echo configure:4230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_slang_header=predefined
 else
@@ -4310,7 +4393,7 @@ cf_cv_lib_termcap=none
 # HP-UX 9.x terminfo has setupterm, but no tigetstr.
 if test "$termlib" = none; then
 	echo $ac_n "checking for tigetstr in -ltermlib""... $ac_c" 1>&6
-echo "configure:4314: checking for tigetstr in -ltermlib" >&5
+echo "configure:4397: checking for tigetstr in -ltermlib" >&5
 ac_lib_var=`echo termlib'_'tigetstr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4318,7 +4401,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4322 "configure"
+#line 4405 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4329,7 +4412,7 @@ int main() {
 tigetstr()
 ; return 0; }
 EOF
-if { (eval echo configure:4333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4352,7 +4435,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>&6
-echo "configure:4356: checking for tgoto in -ltermlib" >&5
+echo "configure:4439: checking for tgoto in -ltermlib" >&5
 ac_lib_var=`echo termlib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4360,7 +4443,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4364 "configure"
+#line 4447 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4371,7 +4454,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4395,7 +4478,7 @@ fi
 if test "$cf_cv_lib_termcap" = none; then
 	# allow curses library for broken AIX system.
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:4399: checking for initscr in -lcurses" >&5
+echo "configure:4482: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4403,7 +4486,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4407 "configure"
+#line 4490 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4414,7 +4497,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4435,7 +4518,7 @@ else
 fi
 
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:4439: checking for tgoto in -ltermcap" >&5
+echo "configure:4522: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4443,7 +4526,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4447 "configure"
+#line 4530 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4454,7 +4537,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4477,7 +4560,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:4481: checking for tgoto in -ltermcap" >&5
+echo "configure:4564: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4485,7 +4568,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4489 "configure"
+#line 4572 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4496,7 +4579,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4519,7 +4602,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -lncurses""... $ac_c" 1>&6
-echo "configure:4523: checking for tgoto in -lncurses" >&5
+echo "configure:4606: checking for tgoto in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4527,7 +4610,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4531 "configure"
+#line 4614 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4538,7 +4621,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4568,12 +4651,12 @@ fi
 
 cf_slang_LIBS2="$LIBS"
 echo $ac_n "checking for acos""... $ac_c" 1>&6
-echo "configure:4572: checking for acos" >&5
+echo "configure:4655: checking for acos" >&5
 if eval "test \"`echo '$''{'ac_cv_func_acos'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4577 "configure"
+#line 4660 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char acos(); below.  */
@@ -4596,7 +4679,7 @@ acos();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_acos=yes"
 else
@@ -4615,7 +4698,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for acos in -lm""... $ac_c" 1>&6
-echo "configure:4619: checking for acos in -lm" >&5
+echo "configure:4702: checking for acos in -lm" >&5
 ac_lib_var=`echo m'_'acos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4623,7 +4706,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm $LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4627 "configure"
+#line 4710 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4634,7 +4717,7 @@ int main() {
 acos()
 ; return 0; }
 EOF
-if { (eval echo configure:4638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4674,12 +4757,12 @@ fi
 	cf_cv_have_lib_slang=no
 	cf_libdir=""
 	echo $ac_n "checking for SLtt_get_screen_size""... $ac_c" 1>&6
-echo "configure:4678: checking for SLtt_get_screen_size" >&5
+echo "configure:4761: checking for SLtt_get_screen_size" >&5
 if eval "test \"`echo '$''{'ac_cv_func_SLtt_get_screen_size'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4683 "configure"
+#line 4766 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char SLtt_get_screen_size(); below.  */
@@ -4702,7 +4785,7 @@ SLtt_get_screen_size();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_SLtt_get_screen_size=yes"
 else
@@ -4722,17 +4805,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for SLtt_get_screen_size in -lslang""... $ac_c" 1>&6
-echo "configure:4726: checking for SLtt_get_screen_size in -lslang" >&5
+echo "configure:4809: checking for SLtt_get_screen_size in -lslang" >&5
 		LIBS="-lslang $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 4729 "configure"
+#line 4812 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_slang=yes
@@ -4759,17 +4842,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/slan
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lslang in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4763: checking for -lslang in $cf_libdir" >&5
+echo "configure:4846: checking for -lslang in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lslang $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 4766 "configure"
+#line 4849 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:4773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_slang=yes
@@ -4795,7 +4878,7 @@ fi
 
 cf_slang_LIBS3="$LIBS"
 echo $ac_n "checking if we can link slang without termcap""... $ac_c" 1>&6
-echo "configure:4799: checking if we can link slang without termcap" >&5
+echo "configure:4882: checking if we can link slang without termcap" >&5
 if test -n "`echo $cf_slang_LIBS1 | sed -e 's/ //g'`" ; then
 	cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s@$cf_slang_LIBS1@@" -e 's@^.@@'`
 else
@@ -4803,14 +4886,14 @@ else
 fi
 LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s@$cf_exclude@@" -e 's@^.@@'`
 cat > conftest.$ac_ext <<EOF
-#line 4807 "configure"
+#line 4890 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:4814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -4830,7 +4913,7 @@ eval cf_libdir=$libdir
 cf_libdir=`echo $cf_libdir | sed -e s@'^NONE/'@$prefix/@ -e s@'^NONE/'@$ac_default_prefix/@`
 
 echo $ac_n "checking for location of config-file""... $ac_c" 1>&6
-echo "configure:4834: checking for location of config-file" >&5
+echo "configure:4917: checking for location of config-file" >&5
 LYNX_CFG_FILE=$cf_libdir/lynx.cfg
 cat >> confdefs.h <<EOF
 #define LYNX_CFG_FILE "$LYNX_CFG_FILE"
@@ -4840,12 +4923,12 @@ echo "$ac_t""$LYNX_CFG_FILE" 1>&6
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4844: checking for ANSI C header files" >&5
+echo "configure:4927: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4849 "configure"
+#line 4932 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4853,7 +4936,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4870,7 +4953,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 4874 "configure"
+#line 4957 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4888,7 +4971,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 4892 "configure"
+#line 4975 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4909,7 +4992,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4913 "configure"
+#line 4996 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4920,7 +5003,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4944,12 +5027,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4948: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5031: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4953 "configure"
+#line 5036 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4958,7 +5041,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4983,12 +5066,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4987: checking for $ac_hdr that defines DIR" >&5
+echo "configure:5070: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4992 "configure"
+#line 5075 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4996,7 +5079,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -5021,7 +5104,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:5025: checking for opendir in -ldir" >&5
+echo "configure:5108: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5029,7 +5112,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5033 "configure"
+#line 5116 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5040,7 +5123,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5062,7 +5145,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:5066: checking for opendir in -lx" >&5
+echo "configure:5149: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5070,7 +5153,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5074 "configure"
+#line 5157 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5081,7 +5164,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5106,6 +5189,7 @@ fi
 for ac_hdr in \
 	fcntl.h \
 	limits.h \
+	stdlib.h \
 	string.h \
 	sys/fcntl.h \
 	sys/filio.h \
@@ -5119,17 +5203,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5123: checking for $ac_hdr" >&5
+echo "configure:5207: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5128 "configure"
+#line 5212 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5157,13 +5241,13 @@ done
 
 
 echo $ac_n "checking termio.h and termios.h""... $ac_c" 1>&6
-echo "configure:5161: checking termio.h and termios.h" >&5
+echo "configure:5245: checking termio.h and termios.h" >&5
 if eval "test \"`echo '$''{'cf_cv_termio_and_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 5167 "configure"
+#line 5251 "configure"
 #include "confdefs.h"
 
 #if HAVE_TERMIO_H
@@ -5176,7 +5260,7 @@ int main() {
 putchar (0x0a)
 ; return 0; }
 EOF
-if { (eval echo configure:5180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_termio_and_termios=yes
 else
@@ -5199,17 +5283,17 @@ for ac_hdr in sys/wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5203: checking for $ac_hdr" >&5
+echo "configure:5287: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5208 "configure"
+#line 5292 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5246,17 +5330,17 @@ for ac_hdr in wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5250: checking for $ac_hdr" >&5
+echo "configure:5334: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5255 "configure"
+#line 5339 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5286,17 +5370,17 @@ for ac_hdr in waitstatus.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5290: checking for $ac_hdr" >&5
+echo "configure:5374: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5295 "configure"
+#line 5379 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5337,13 +5421,13 @@ fi
 
 
 echo $ac_n "checking for union wait""... $ac_c" 1>&6
-echo "configure:5341: checking for union wait" >&5
+echo "configure:5425: checking for union wait" >&5
 if eval "test \"`echo '$''{'cf_cv_type_unionwait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 5347 "configure"
+#line 5431 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -5354,7 +5438,7 @@ int x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_type_unionwait=no
 	 echo compiles ok w/o union wait 1>&5
@@ -5365,7 +5449,7 @@ else
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 5369 "configure"
+#line 5453 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -5380,7 +5464,7 @@ union wait x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_type_unionwait=yes
 	 echo compiles ok with union wait and possibly macros too 1>&5
@@ -5407,20 +5491,20 @@ EOF
 if test $cf_cv_type_unionwait = yes; then
 
 	echo $ac_n "checking if union wait can be used as wait-arg""... $ac_c" 1>&6
-echo "configure:5411: checking if union wait can be used as wait-arg" >&5
+echo "configure:5495: checking if union wait can be used as wait-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_wait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5417 "configure"
+#line 5501 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; wait(&x)
 ; return 0; }
 EOF
-if { (eval echo configure:5424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_wait=yes
 else
@@ -5440,20 +5524,20 @@ EOF
 
 
 	echo $ac_n "checking if union wait can be used as waitpid-arg""... $ac_c" 1>&6
-echo "configure:5444: checking if union wait can be used as waitpid-arg" >&5
+echo "configure:5528: checking if union wait can be used as waitpid-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_waitpid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5450 "configure"
+#line 5534 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; waitpid(0, &x, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:5457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_waitpid=yes
 else
@@ -5475,12 +5559,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:5479: checking for mode_t" >&5
+echo "configure:5563: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5484 "configure"
+#line 5568 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -5510,12 +5594,12 @@ fi
 
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:5514: checking for pid_t" >&5
+echo "configure:5598: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5519 "configure"
+#line 5603 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -5544,17 +5628,17 @@ fi
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:5548: checking for vfork.h" >&5
+echo "configure:5632: checking for vfork.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5553 "configure"
+#line 5637 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5579,18 +5663,18 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:5583: checking for working vfork" >&5
+echo "configure:5667: checking for working vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:5589: checking for vfork" >&5
+echo "configure:5673: checking for vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5594 "configure"
+#line 5678 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -5613,7 +5697,7 @@ vfork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vfork=yes"
 else
@@ -5634,7 +5718,7 @@ fi
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5638 "configure"
+#line 5722 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -5729,7 +5813,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:5733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_vfork_works=yes
 else
@@ -5753,13 +5837,13 @@ fi
 
 
 echo $ac_n "checking if we should use fcntl or ioctl""... $ac_c" 1>&6
-echo "configure:5757: checking if we should use fcntl or ioctl" >&5
+echo "configure:5841: checking if we should use fcntl or ioctl" >&5
 if eval "test \"`echo '$''{'cf_cv_fionbio'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 5763 "configure"
+#line 5847 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5771,7 +5855,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fionbio=ioctl
 else
@@ -5780,7 +5864,7 @@ else
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 5784 "configure"
+#line 5868 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5797,7 +5881,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fionbio=fcntl
 else
@@ -5820,20 +5904,20 @@ EOF
 
 
 echo $ac_n "checking for broken/missing definition of remove""... $ac_c" 1>&6
-echo "configure:5824: checking for broken/missing definition of remove" >&5
+echo "configure:5908: checking for broken/missing definition of remove" >&5
 if eval "test \"`echo '$''{'cf_cv_baddef_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 5830 "configure"
+#line 5914 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:5837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_baddef_remove=no
 else
@@ -5841,7 +5925,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 5845 "configure"
+#line 5929 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 		int __unlink(name) { return unlink(name); } 
@@ -5849,7 +5933,7 @@ int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:5853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_baddef_remove=yes
 else
@@ -5871,6 +5955,44 @@ test "$cf_cv_baddef_remove" != no && cat >> confdefs.h <<\EOF
 EOF
 
 
+
+echo $ac_n "checking for lstat""... $ac_c" 1>&6
+echo "configure:5961: checking for lstat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_lstat'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 5967 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+lstat(".", (struct stat *)0)
+; return 0; }
+EOF
+if { (eval echo configure:5976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ac_cv_func_lstat=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_func_lstat=no
+fi
+rm -f conftest*
+	
+fi
+
+echo "$ac_t""$ac_cv_func_lstat " 1>&6
+if test $ac_cv_func_lstat = yes; then
+	cat >> confdefs.h <<\EOF
+#define HAVE_LSTAT 1
+EOF
+
+fi
+
 for ac_func in \
 	cuserid \
 	getcwd \
@@ -5882,12 +6004,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5886: checking for $ac_func" >&5
+echo "configure:6008: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5891 "configure"
+#line 6013 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5910,7 +6032,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5940,12 +6062,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5944: checking for $ac_func" >&5
+echo "configure:6066: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5949 "configure"
+#line 6071 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5968,7 +6090,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5999,12 +6121,12 @@ for ac_func in strstr
 do
 
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:6003: checking for $ac_func declaration" >&5
+echo "configure:6125: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6008 "configure"
+#line 6130 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -6013,11 +6135,11 @@ extern	int	${ac_func}();
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 6021 "configure"
+#line 6143 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -6026,7 +6148,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 eval "ac_cv_func_decl_$ac_func=yes"
@@ -6068,12 +6190,12 @@ for ac_func in getgrgid getgrnam
 do
 
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:6072: checking for $ac_func declaration" >&5
+echo "configure:6194: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6077 "configure"
+#line 6199 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6084,11 +6206,11 @@ extern	int	${ac_func}();
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 6092 "configure"
+#line 6214 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6099,7 +6221,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 eval "ac_cv_func_decl_$ac_func=yes"
@@ -6141,13 +6263,13 @@ done
 
 
 echo $ac_n "checking if TRUE/FALSE are defined""... $ac_c" 1>&6
-echo "configure:6145: checking if TRUE/FALSE are defined" >&5
+echo "configure:6267: checking if TRUE/FALSE are defined" >&5
 if eval "test \"`echo '$''{'cf_cv_bool_defs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6151 "configure"
+#line 6273 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6156,7 +6278,7 @@ int main() {
 int x = TRUE, y = FALSE
 ; return 0; }
 EOF
-if { (eval echo configure:6160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_bool_defs=yes
 else
@@ -6183,15 +6305,18 @@ fi
 
 
 echo $ac_n "checking declaration of errno""... $ac_c" 1>&6
-echo "configure:6187: checking declaration of errno" >&5
+echo "configure:6309: checking declaration of errno" >&5
 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6193 "configure"
+#line 6315 "configure"
 #include "confdefs.h"
 
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 #include <stdio.h>
 #include <sys/types.h>
 #include <errno.h> 
@@ -6199,7 +6324,7 @@ int main() {
 long x = (long) errno
 ; return 0; }
 EOF
-if { (eval echo configure:6203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'errno'=yes'
 else
@@ -6229,9 +6354,9 @@ cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
 EOF
 
     echo $ac_n "checking existence of errno""... $ac_c" 1>&6
-echo "configure:6233: checking existence of errno" >&5
+echo "configure:6358: checking existence of errno" >&5
         cat > conftest.$ac_ext <<EOF
-#line 6235 "configure"
+#line 6360 "configure"
 #include "confdefs.h"
 
 #undef errno
@@ -6241,7 +6366,7 @@ int main() {
 errno = 2
 ; return 0; }
 EOF
-if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_have_'errno'=yes'
 else
@@ -6271,20 +6396,20 @@ EOF
 
 
 echo $ac_n "checking for setlocale()""... $ac_c" 1>&6
-echo "configure:6275: checking for setlocale()" >&5
+echo "configure:6400: checking for setlocale()" >&5
 if eval "test \"`echo '$''{'cf_cv_locale'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6281 "configure"
+#line 6406 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 setlocale(LC_ALL, "")
 ; return 0; }
 EOF
-if { (eval echo configure:6288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_locale=yes
 else
@@ -6305,13 +6430,13 @@ EOF
 
 
 echo $ac_n "checking if NGROUPS is defined""... $ac_c" 1>&6
-echo "configure:6309: checking if NGROUPS is defined" >&5
+echo "configure:6434: checking if NGROUPS is defined" >&5
 if eval "test \"`echo '$''{'cf_cv_ngroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6315 "configure"
+#line 6440 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -6325,7 +6450,7 @@ int main() {
 int x = NGROUPS
 ; return 0; }
 EOF
-if { (eval echo configure:6329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=yes
 else
@@ -6333,7 +6458,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 6337 "configure"
+#line 6462 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -6347,7 +6472,7 @@ int main() {
 int x = NGROUPS_MAX
 ; return 0; }
 EOF
-if { (eval echo configure:6351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=NGROUPS_MAX
 else
@@ -6381,15 +6506,18 @@ for cf_name in sys_nerr sys_errlist
 do
     
 echo $ac_n "checking declaration of $cf_name""... $ac_c" 1>&6
-echo "configure:6385: checking declaration of $cf_name" >&5
+echo "configure:6510: checking declaration of $cf_name" >&5
 if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6391 "configure"
+#line 6516 "configure"
 #include "confdefs.h"
 
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 #include <stdio.h>
 #include <sys/types.h>
 #include <errno.h> 
@@ -6397,7 +6525,7 @@ int main() {
 long x = (long) $cf_name
 ; return 0; }
 EOF
-if { (eval echo configure:6401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'$cf_name'=yes'
 else
@@ -6427,9 +6555,9 @@ cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
 EOF
 
     echo $ac_n "checking existence of $cf_name""... $ac_c" 1>&6
-echo "configure:6431: checking existence of $cf_name" >&5
+echo "configure:6559: checking existence of $cf_name" >&5
         cat > conftest.$ac_ext <<EOF
-#line 6433 "configure"
+#line 6561 "configure"
 #include "confdefs.h"
 
 #undef $cf_name
@@ -6439,7 +6567,7 @@ int main() {
 $cf_name = 2
 ; return 0; }
 EOF
-if { (eval echo configure:6443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_have_'$cf_name'=yes'
 else
@@ -6470,13 +6598,13 @@ done
 
 
 echo $ac_n "checking if struct utmp is declared""... $ac_c" 1>&6
-echo "configure:6474: checking if struct utmp is declared" >&5
+echo "configure:6602: checking if struct utmp is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6480 "configure"
+#line 6608 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6485,7 +6613,7 @@ int main() {
 struct utmp x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:6489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=yes
 else
@@ -6493,14 +6621,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 6497 "configure"
+#line 6625 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 int main() {
 struct utmpx x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:6504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=utmpx
 else
@@ -6531,13 +6659,13 @@ EOF
 if test $cf_cv_screen != slang ; then
 	
 echo $ac_n "checking if curses supports alternate-character set""... $ac_c" 1>&6
-echo "configure:6535: checking if curses supports alternate-character set" >&5
+echo "configure:6663: checking if curses supports alternate-character set" >&5
 if eval "test \"`echo '$''{'cf_cv_alt_char_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6541 "configure"
+#line 6669 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6546,7 +6674,7 @@ int main() {
 chtype x = acs_map['l']; acs_map['m'] = 0
 ; return 0; }
 EOF
-if { (eval echo configure:6550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_alt_char_set=yes
 else
@@ -6566,13 +6694,13 @@ EOF
 
 	
 echo $ac_n "checking if curses supports fancy attributes""... $ac_c" 1>&6
-echo "configure:6570: checking if curses supports fancy attributes" >&5
+echo "configure:6698: checking if curses supports fancy attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_fancy_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6576 "configure"
+#line 6704 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6585,7 +6713,7 @@ attrset(A_UNDERLINE|A_BOLD|A_REVERSE);
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fancy_curses=yes
 else
@@ -6605,7 +6733,7 @@ EOF
 
 
 	echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:6609: checking for ncurses version" >&5
+echo "configure:6737: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6630,7 +6758,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:6634: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:6762: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -6639,7 +6767,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 6643 "configure"
+#line 6771 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6662,7 +6790,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:6666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6682,13 +6810,13 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 
 if test "$cf_cv_ncurses_version" != no ; then
 echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6
-echo "configure:6686: checking for obsolete/broken version of ncurses" >&5
+echo "configure:6814: checking for obsolete/broken version of ncurses" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6692 "configure"
+#line 6820 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6702,7 +6830,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_broken=no
 else
@@ -6727,13 +6855,13 @@ fi
 
 	
 echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6
-echo "configure:6731: checking if curses supports color attributes" >&5
+echo "configure:6859: checking if curses supports color attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_color_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6737 "configure"
+#line 6865 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6748,7 +6876,7 @@ chtype x = COLOR_BLUE;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_color_curses=yes
 else
@@ -6775,7 +6903,7 @@ fi
 
 	
 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
-echo "configure:6779: checking declaration of size-change" >&5
+echo "configure:6907: checking declaration of size-change" >&5
 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6789,7 +6917,7 @@ do
     CFLAGS="$cf_save_CFLAGS"
     test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
     cat > conftest.$ac_ext <<EOF
-#line 6793 "configure"
+#line 6921 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if HAVE_TERMIOS_H
@@ -6828,7 +6956,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sizechange=yes
 else
@@ -6860,20 +6988,20 @@ EOF
 
 	
 echo $ac_n "checking if ttytype is declared in curses library""... $ac_c" 1>&6
-echo "configure:6864: checking if ttytype is declared in curses library" >&5
+echo "configure:6992: checking if ttytype is declared in curses library" >&5
 if eval "test \"`echo '$''{'cf_cv_have_ttytype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6870 "configure"
+#line 6998 "configure"
 #include "confdefs.h"
 #include <$cf_cv_ncurses_header>
 int main() {
 char *x = &ttytype[1]; *x = 1
 ; return 0; }
 EOF
-if { (eval echo configure:6877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_have_ttytype=yes
 else
@@ -6900,12 +7028,12 @@ EOF
 	
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6904: checking for $ac_func" >&5
+echo "configure:7032: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6909 "configure"
+#line 7037 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6928,7 +7056,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6957,8 +7085,31 @@ fi
 
 
 
+echo $ac_n "checking if experimental 8-bit case-conversion should be used""... $ac_c" 1>&6
+echo "configure:7090: checking if experimental 8-bit case-conversion should be used" >&5
+
+# Check whether --enable-8bit-toupper or --disable-8bit-toupper was given.
+if test "${enable_8bit_toupper+set}" = set; then
+  enableval="$enable_8bit_toupper"
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    use_8bit_toupper=$enableval 
+  else
+    use_8bit_toupper=no
+  fi
+else
+  enableval=no 
+  use_8bit_toupper=no
+  
+fi
+
+test $use_8bit_toupper != no && cat >> confdefs.h <<\EOF
+#define EXP_8BIT_TOUPPER 1
+EOF
+
+
 echo $ac_n "checking if color-style code should be used""... $ac_c" 1>&6
-echo "configure:6962: checking if color-style code should be used" >&5
+echo "configure:7113: checking if color-style code should be used" >&5
 
 # Check whether --enable-color-style or --disable-color-style was given.
 if test "${enable_color_style+set}" = set; then
@@ -7006,7 +7157,7 @@ EOF
 	echo "$ac_t""curses-style" 1>&6
 
 	echo $ac_n "checking for location of style-sheet file""... $ac_c" 1>&6
-echo "configure:7010: checking for location of style-sheet file" >&5
+echo "configure:7161: checking for location of style-sheet file" >&5
 	LYNX_LSS_FILE=$cf_libdir/lynx.lss
 	cat >> confdefs.h <<EOF
 #define LYNX_LSS_FILE "$LYNX_LSS_FILE"
@@ -7018,8 +7169,38 @@ EOF
 esac
 
 
+use_dft_colors=no
+test ".$cf_cv_screen" = ".slang"                && use_dft_colors=maybe
+test ".$ac_cv_func_use_default_colors" = ".yes" && use_dft_colors=maybe
+
+if test "$use_dft_colors" != no ; then
+echo $ac_n "checking if you want to use default-colors""... $ac_c" 1>&6
+echo "configure:7179: checking if you want to use default-colors" >&5
+
+# Check whether --enable-default-colors or --disable-default-colors was given.
+if test "${enable_default_colors+set}" = set; then
+  enableval="$enable_default_colors"
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    use_dft_colors=yes 
+  else
+    use_dft_colors=no
+  fi
+else
+  enableval=no 
+  use_dft_colors=no
+  
+fi
+
+echo "$ac_t""$use_dft_colors" 1>&6
+test $use_dft_colors = "yes" && cat >> confdefs.h <<\EOF
+#define USE_DEFAULT_COLORS 1
+EOF
+
+fi
+
 echo $ac_n "checking if you want to use extended HTML DTD logic""... $ac_c" 1>&6
-echo "configure:7023: checking if you want to use extended HTML DTD logic" >&5
+echo "configure:7204: checking if you want to use extended HTML DTD logic" >&5
 
 # Check whether --enable-extended-dtd or --disable-extended-dtd was given.
 if test "${enable_extended_dtd+set}" = set; then
@@ -7043,7 +7224,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use external commands""... $ac_c" 1>&6
-echo "configure:7047: checking if you want to use external commands" >&5
+echo "configure:7228: checking if you want to use external commands" >&5
 
 # Check whether --enable-externs or --disable-externs was given.
 if test "${enable_externs+set}" = set; then
@@ -7067,7 +7248,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use setfont support""... $ac_c" 1>&6
-echo "configure:7071: checking if you want to use setfont support" >&5
+echo "configure:7252: checking if you want to use setfont support" >&5
 
 # Check whether --enable-font-switch or --disable-font-switch was given.
 if test "${enable_font_switch+set}" = set; then
@@ -7091,20 +7272,20 @@ EOF
 
 
 echo $ac_n "checking if you want internal-links feature""... $ac_c" 1>&6
-echo "configure:7095: checking if you want internal-links feature" >&5
+echo "configure:7276: checking if you want internal-links feature" >&5
 
 # Check whether --enable-internal-links or --disable-internal-links was given.
 if test "${enable_internal_links+set}" = set; then
   enableval="$enable_internal_links"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    use_internal_links=no 
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    use_internal_links=yes 
   else
-    use_internal_links=yes
+    use_internal_links=no
   fi
 else
-  enableval=yes 
-  use_internal_links=yes
+  enableval=no 
+  use_internal_links=no
   
 fi
 
@@ -7115,7 +7296,7 @@ EOF
 
 
 echo $ac_n "checking if you want to fork NSL requests""... $ac_c" 1>&6
-echo "configure:7119: checking if you want to fork NSL requests" >&5
+echo "configure:7300: checking if you want to fork NSL requests" >&5
 
 # Check whether --enable-nsl-fork or --disable-nsl-fork was given.
 if test "${enable_nsl_fork+set}" = set; then
@@ -7139,7 +7320,7 @@ EOF
 
 
 echo $ac_n "checking if you want to underline links""... $ac_c" 1>&6
-echo "configure:7143: checking if you want to underline links" >&5
+echo "configure:7324: checking if you want to underline links" >&5
 
 # Check whether --enable-underlines or --disable-underlines was given.
 if test "${enable_underlines+set}" = set; then
@@ -7163,7 +7344,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use zlib for decompression of some gzip files""... $ac_c" 1>&6
-echo "configure:7167: checking if you want to use zlib for decompression of some gzip files" >&5
+echo "configure:7348: checking if you want to use zlib for decompression of some gzip files" >&5
 
 # Check whether --with-zlib or --without-zlib was given.
 if test "${with_zlib+set}" = set; then
@@ -7180,12 +7361,12 @@ if test ".$use_zlib" != ".no" ; then
 	cf_cv_have_lib_z=no
 	cf_libdir=""
 	echo $ac_n "checking for gzopen""... $ac_c" 1>&6
-echo "configure:7184: checking for gzopen" >&5
+echo "configure:7365: checking for gzopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gzopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7189 "configure"
+#line 7370 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gzopen(); below.  */
@@ -7208,7 +7389,7 @@ gzopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gzopen=yes"
 else
@@ -7228,17 +7409,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6
-echo "configure:7232: checking for gzopen in -lz" >&5
+echo "configure:7413: checking for gzopen in -lz" >&5
 		LIBS="-lz $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 7235 "configure"
+#line 7416 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:7242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_z=yes
@@ -7265,17 +7446,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/z"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lz in $cf_libdir""... $ac_c" 1>&6
-echo "configure:7269: checking for -lz in $cf_libdir" >&5
+echo "configure:7450: checking for -lz in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lz $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 7272 "configure"
+#line 7453 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:7279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_z=yes
@@ -7311,7 +7492,7 @@ fi
 # All DirEd functions that were enabled on compilation can be disabled
 # or modified at run time via DIRED_MENU symbols in lynx.cfg.
 echo $ac_n "checking if directory-editor code should be used""... $ac_c" 1>&6
-echo "configure:7315: checking if directory-editor code should be used" >&5
+echo "configure:7496: checking if directory-editor code should be used" >&5
 
 # Check whether --enable-dired or --disable-dired was given.
 if test "${enable_dired+set}" = set; then
@@ -7337,7 +7518,7 @@ EOF
 
 
 	echo $ac_n "checking if you wish to allow extracting from archives via DirEd""... $ac_c" 1>&6
-echo "configure:7341: checking if you wish to allow extracting from archives via DirEd" >&5
+echo "configure:7522: checking if you wish to allow extracting from archives via DirEd" >&5
 	
 # Check whether --enable-dired-archive or --disable-dired-archive was given.
 if test "${enable_dired_archive+set}" = set; then
@@ -7356,7 +7537,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow users to redefine DirEd keys""... $ac_c" 1>&6
-echo "configure:7360: checking if you wish to allow users to redefine DirEd keys" >&5
+echo "configure:7541: checking if you wish to allow users to redefine DirEd keys" >&5
 	
 # Check whether --enable-dired-override or --disable-dired-override was given.
 if test "${enable_dired_override+set}" = set; then
@@ -7382,7 +7563,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow permissions commands via DirEd""... $ac_c" 1>&6
-echo "configure:7386: checking if you wish to allow permissions commands via DirEd" >&5
+echo "configure:7567: checking if you wish to allow permissions commands via DirEd" >&5
 	
 # Check whether --enable-dired-permit or --disable-dired-permit was given.
 if test "${enable_dired_permit+set}" = set; then
@@ -7408,7 +7589,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow executable-permission commands via DirEd""... $ac_c" 1>&6
-echo "configure:7412: checking if you wish to allow executable-permission commands via DirEd" >&5
+echo "configure:7593: checking if you wish to allow executable-permission commands via DirEd" >&5
 	
 # Check whether --enable-dired-xpermit or --disable-dired-xpermit was given.
 if test "${enable_dired_xpermit+set}" = set; then
@@ -7427,7 +7608,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "tar" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7431: checking if you wish to allow "tar" commands from DirEd" >&5
+echo "configure:7612: checking if you wish to allow "tar" commands from DirEd" >&5
 	
 # Check whether --enable-dired-tar or --disable-dired-tar was given.
 if test "${enable_dired_tar+set}" = set; then
@@ -7453,7 +7634,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "uudecode" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7457: checking if you wish to allow "uudecode" commands from DirEd" >&5
+echo "configure:7638: checking if you wish to allow "uudecode" commands from DirEd" >&5
 	
 # Check whether --enable-dired-uudecode or --disable-dired-uudecode was given.
 if test "${enable_dired_uudecode+set}" = set; then
@@ -7479,7 +7660,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "zip" and "unzip" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7483: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5
+echo "configure:7664: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5
 	
 # Check whether --enable-dired-zip or --disable-dired-zip was given.
 if test "${enable_dired_zip+set}" = set; then
@@ -7505,7 +7686,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "gzip" and "gunzip" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7509: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5
+echo "configure:7690: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5
 	
 # Check whether --enable-dired-gzip or --disable-dired-gzip was given.
 if test "${enable_dired_gzip+set}" = set; then
@@ -7532,7 +7713,7 @@ fi
 fi
 
 echo $ac_n "checking if you want long-directory listings""... $ac_c" 1>&6
-echo "configure:7536: checking if you want long-directory listings" >&5
+echo "configure:7717: checking if you want long-directory listings" >&5
 
 # Check whether --enable-long-list or --disable-long-list was given.
 if test "${enable_long_list+set}" = set; then
@@ -7558,7 +7739,7 @@ fi
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking if parent-directory references are permitted""... $ac_c" 1>&6
-echo "configure:7562: checking if parent-directory references are permitted" >&5
+echo "configure:7743: checking if parent-directory references are permitted" >&5
 
 # Check whether --enable-parent-dir-refs or --disable-parent-dir-refs was given.
 if test "${enable_parent_dir_refs+set}" = set; then
@@ -7756,6 +7937,7 @@ s%@UNZIP@%$UNZIP%g
 s%@UUDECODE@%$UUDECODE%g
 s%@ZCAT@%$ZCAT%g
 s%@ZIP@%$ZIP%g
+s%@PROG_EXT@%$PROG_EXT%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@INSTALL_LSS@%$INSTALL_LSS%g
 s%@SRCDIR_CLEAN@%$SRCDIR_CLEAN%g
diff --git a/configure.in b/configure.in
index 4da43109..a1cf7315 100644
--- a/configure.in
+++ b/configure.in
@@ -77,6 +77,7 @@ CF_ARG_ENABLE(warnings,
 AC_MSG_RESULT($with_warnings)
 if test "$with_warnings" = "yes"
 then
+	CF_GCC_ATTRIBUTES
 	CF_GCC_WARNINGS
 fi
 fi
@@ -140,6 +141,7 @@ fi
 AC_C_CONST
 
 dnl Only add to this case statement things that we cannot design tests for.
+PROG_EXT=
 case $host_os in
 aix4*)
 	CFLAGS="$CFLAGS -DAIX4 -D_BSD=44" 
@@ -189,6 +191,12 @@ next*)
 openbsd*)
 	LIBS="$LIBS -lcompat"
 	;;
+os2*)
+	# We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
+	CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
+	LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
+	PROG_EXT=".exe"
+	;;
 osf*)
 	# Increase the maximum size of functions that will be optimized.
 	test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 4000"
@@ -235,6 +243,7 @@ ultrix*)
 	AC_CHECK_HEADERS(cursesX.h, cf_cv_ncurses_header=cursesX.h)
 	;;
 esac
+AC_SUBST(PROG_EXT)
 
 dnl --------------------------------------------------------------------------
 dnl Checks for library configuration (added right-to-left)
@@ -301,6 +310,7 @@ dnl Don't check for sys/wait.h here since it is covered by another test.
 AC_CHECK_HEADERS( \
 	fcntl.h \
 	limits.h \
+	stdlib.h \
 	string.h \
 	sys/fcntl.h \
 	sys/filio.h \
@@ -322,6 +332,7 @@ dnl --------------------------------------------------------------------------
 AC_FUNC_VFORK
 CF_FIONBIO
 CF_REMOVE_BROKEN
+CF_FUNC_LSTAT
 AC_CHECK_FUNCS( \
 	cuserid \
 	getcwd \
@@ -376,6 +387,13 @@ dnl --------------------------------------------------------------------------
 CF_HELP_MESSAGE(
 Miscellaneous Options:)
 
+AC_MSG_CHECKING(if experimental 8-bit case-conversion should be used)
+CF_ARG_ENABLE(8bit-toupper,
+[  --enable-8bit-toupper   use experimental 8-bit case-conversion],
+	[use_8bit_toupper=$enableval],
+	[use_8bit_toupper=no])
+test $use_8bit_toupper != no && AC_DEFINE(EXP_8BIT_TOUPPER)
+
 AC_MSG_CHECKING(if color-style code should be used)
 CF_ARG_ENABLE(color-style,
 [  --enable-color-style    use optional/experimental color style],
@@ -411,6 +429,20 @@ no)
 esac
 AC_SUBST(INSTALL_LSS)
 
+use_dft_colors=no
+test ".$cf_cv_screen" = ".slang"                && use_dft_colors=maybe
+test ".$ac_cv_func_use_default_colors" = ".yes" && use_dft_colors=maybe
+
+if test "$use_dft_colors" != no ; then
+AC_MSG_CHECKING(if you want to use default-colors)
+CF_ARG_ENABLE(default-colors,
+[  --enable-default-colors enable use of default-colors (ncurses/slang)],
+	[use_dft_colors=yes],
+	[use_dft_colors=no])
+AC_MSG_RESULT($use_dft_colors)
+test $use_dft_colors = "yes" && AC_DEFINE(USE_DEFAULT_COLORS)
+fi
+
 AC_MSG_CHECKING(if you want to use extended HTML DTD logic)
 CF_ARG_DISABLE(extended-dtd,
 [  --disable-extended-dtd  disable extended HTML DTD logic],
@@ -436,10 +468,10 @@ AC_MSG_RESULT($use_setfont)
 test $use_setfont = yes && AC_DEFINE(EXP_CHARTRANS_AUTOSWITCH)
 
 AC_MSG_CHECKING(if you want internal-links feature)
-CF_ARG_DISABLE(internal-links,
-[  --disable-internal-links handle following links to same doc differently],
-	[use_internal_links=no],
-	[use_internal_links=yes])
+CF_ARG_ENABLE(internal-links,
+[  --enable-internal-links  handle following links to same doc differently],
+	[use_internal_links=yes],
+	[use_internal_links=no])
 AC_MSG_RESULT($use_internal_links)
 test $use_internal_links = no && AC_DEFINE(DONT_TRACK_INTERNAL_LINKS)
 
diff --git a/docs/README.chartrans b/docs/README.chartrans
index 77ee6c61..81aedd45 100644
--- a/docs/README.chartrans
+++ b/docs/README.chartrans
@@ -131,7 +131,7 @@ HOW TO INSTALL:
 
      Note that definition of new character entities (if e.g. you want
      Lynx to recognize &Zcaron;) are not covered by these table files,
-     they have to be listed in HTMLDTD.c.  
+     they have to be listed in entities.h.  
 
      _If you are on a Linux system_ and using Lynx on the console (i.e.
      not xterm, not a dialup *into* the Linux box), you can compile
diff --git a/lynx.hlp b/lynx.hlp
index 6770ada0..93adb3c0 100644
--- a/lynx.hlp
+++ b/lynx.hlp
@@ -417,7 +417,7 @@
  o Type "k" for a complete list of the current key-stroke command mappings.
 
 2 NOTES
- This is the Lynx v2.7.2 Release for Unix/VMS
+ This is the Lynx v2.8 Release for Unix/VMS
 
  If you wish to contribute to the further development of Lynx, subscribe
  to our mailing list.  Send email to <majordomo@sig.net> with
diff --git a/lynx.man b/lynx.man
index d81d0c30..6a81a8bc 100644
--- a/lynx.man
+++ b/lynx.man
@@ -30,7 +30,8 @@ remote systems running Gopher, HTTP, FTP, WAIS, and NNTP servers.
 Current versions of
 .I
 Lynx
-run on Unix and VMS.
+run on
+Unix, VMS, Windows95/NT, 386DOS and OS/2 EMX.
 .PP
 .I
 Lynx
@@ -176,6 +177,23 @@ send a HEAD request for the mime headers.
 .B -help
 print this Lynx command syntax usage message.
 .TP
+.B -hiddenlinks=[option]
+control the display of hidden links.
+
+.I merge
+hidden links show up as bracketed numbers
+and are numbered together with other links in the sequence of their
+occurrence in the document.
+
+.I listonly
+hidden links are shown only on L)ist screens and listings generated by
+.I -dump
+or from the P)rint menu, but appear separately at the end of those lists.
+This is the default behavior.
+
+.I ignore
+hidden links do not appear even in listings.
+.TP
 .B -historical
 toggles use of '>' or '-->' as a terminator for comments.
 .TP
@@ -488,7 +506,7 @@ of key-stroke commands.
 o Type \fB"k"\fR for a complete list of the current key-stroke 
 command mappings.
 .SH NOTES
-This is the Lynx v2.7.2 Release for Unix/VMS
+This is the Lynx v2.8 Release for Unix/VMS
 .PP
 If you wish to contribute to the further development
 of \fILynx\fR, subscribe to our mailing list.  Send email to
diff --git a/lynx_help/Lynx_users_guide.html b/lynx_help/Lynx_users_guide.html
index 182b3531..303ce116 100644
--- a/lynx_help/Lynx_users_guide.html
+++ b/lynx_help/Lynx_users_guide.html
@@ -1,12 +1,12 @@
 <!DOCTYPE html public "-//IETF//DTD HTML 3.0//EN">
 <html>
 <head>
-<title>Lynx Users Guide v2.7.2</title>
+<title>Lynx Users Guide v2.8</title>
 <link rev="made" href="mailto:lynx-dev@sig.net">
 </head>
 
 <body>
-<h1>Lynx Users Guide v2.7.2</h1>
+<h1>Lynx Users Guide v2.8</h1>
 
 Lynx is a fully-featured <em>World Wide Web</em> (<em>WWW</em>) client
 for users running cursor-addressable, character-cell display devices (e.g.,
@@ -753,7 +753,7 @@ return to Lynx or the '<em>&gt;</em>' command to save the options to a
 	<dd>The header string which Lynx sends to servers to indicate the
 	    User-Agent is displayed here.  Changes may be disallowed via
 	    the <em>-restrictions</em> switch.  Otherwise, the header can be
-	    changed temporarily to a string such as <em>L_y_n_x/2.7.2</em>
+	    changed temporarily to a string such as <em>L_y_n_x/2.8</em>
 	    for access to sites which discriminate against Lynx based on
 	    checks for the presence of &quot;Lynx&quot; in the header. If
 	    changed during a Lynx session, the default User-Agent header can
@@ -2270,6 +2270,7 @@ The Lynx2-5FM code set was released as v2.6 in September 1996.
 The Lynx2-6FM code set was released as v2.7 in February 1997.
 The v2-7FM code set was released as v2.7.1 in April 1997.
 The v2-7-1FM code set was released as v2.7.2 in January 1998.
+The 2.7.1 development set was released as v2.8 in March 1998.
 
 <p>Since early 1997, the Lynx code has expanded into autoconfigure and
 PC versions.  The branching of the Lynx source base from a single
diff --git a/makefile.in b/makefile.in
index 42b3d91a..75c6b1d9 100644
--- a/makefile.in
+++ b/makefile.in
@@ -1,6 +1,9 @@
 ##makefile for lynx
 
-SHELL = /bin/sh
+SHELL		= /bin/sh
+
+x		= @PROG_EXT@
+
 .SUFFIXES:
 @SET_MAKE@
 prefix		= @prefix@
@@ -160,7 +163,7 @@ SITE_DEFS = # Your defines here
 # for installation of local execution links, please see the file userdefs.h
 
 # TESTED: Linux FreeBSD SunOS Solaris IRIX CLIX HP-UX AIX SCO
-all lynx:
+all lynx$x:
 	cd WWW/Library/unix && $(MAKE) CC="$(CC)" \
 		LY_CFLAGS="$(CFLAGS)" \
 		CPPFLAGS="$(CPPFLAGS)" \
@@ -189,7 +192,7 @@ clean:
 	rm -f WWW/Library/*/*.[aob]
 	rm -f WWW/Library/*/.created
 	cd src && $(MAKE) clean
-	rm -f *.b src/lynx core Lynx.leaks
+	rm -f *.b src/lynx$x core Lynx.leaks
 
 depend:
 	cd WWW/Library/unix && $(MAKE) $@
@@ -208,14 +211,14 @@ distclean: clean
 	@SRCDIR_CLEAN@-rmdir WWW/Library/unix && rmdir WWW/Library && rmdir WWW
 	@SRCDIR_CLEAN@-rmdir src/chrtrans && rmdir src
 	-rm -f makefile lynx_cfg.h config.status config.log config.cache
-	-rm -f lynx install-*
+	-rm -f lynx$x install-*
 
 maintainer-clean: distclean
 	-rm -rf WWW/Library/*/obsolete
 	-rm -f Lynx.prj .*_aux
 
 tar:  clean
-	rm -f lynx
+	rm -f lynx$x
 	$(MAKE) save
 
 turnover:	clean
@@ -225,8 +228,8 @@ zipcompress: compress zip
 	echo "done!"
 
 zip:  clean
-	rm -f src/lynx
-	rm -f lynx
+	rm -f src/lynx$x
+	rm -f lynx$x
 	rm -f src/a.out
 	rm -f ../$(lynxname).zip
 	cd ..; rm -f $(lynxname).zip; zip -r $(lynxname).zip $(lynxdir)
@@ -237,14 +240,14 @@ save:
 compress: tar
 	cd ..; rm -f $(lynxname).tar.Z; compress -f -v $(lynxname).tar
 
-install: lynx install-bin install-man install-cfg @INSTALL_LSS@
+install: lynx$x install-bin install-man install-cfg @INSTALL_LSS@
 	@echo
 	@echo "Use $(MAKE) install-help to install the help-files"
 	@echo
 
 install-bin: $(bindir)
-	-mv -f $(bindir)/lynx $(bindir)/lynx.old
-	$(installbin) lynx $(bindir)/
+	-mv -f $(bindir)/lynx$x $(bindir)/lynx.old
+	$(installbin) lynx$x $(bindir)/
 
 install-man : $(mandir) 
 	$(installdoc) $(srcdir)/lynx.man $(mandir)/lynx.1
@@ -268,7 +271,7 @@ install-lss : $(libdir)
 	$(INSTALL_DATA) $(srcdir)/samples/lynx.lss $(libdir)/lynx.lss
 
 uninstall:
-	-rm -f $(bindir)/lynx
+	-rm -f $(bindir)/lynx$x
 	-rm -f $(mandir)/lynx.1
 	-rm -f $(libdir)/lynx.cfg
 	-rm -f $(libdir)/lynx.lss
diff --git a/src/DefaultStyle.c b/src/DefaultStyle.c
index 140f0a77..7299ede1 100644
--- a/src/DefaultStyle.c
+++ b/src/DefaultStyle.c
@@ -12,7 +12,7 @@
 
 /*	Tab arrays:
 */
-PRIVATE HTTabStop tabs_8[] = {
+PRIVATE CONST HTTabStop tabs_8[] = {
 	{ 0, 8 }, {0, 16}, {0, 24}, {0, 32}, {0, 40},
 	{ 0, 48 }, {0, 56}, {0, 64}, {0, 72}, {0, 80},
 	{ 0, 88 }, {0, 96}, {0, 104}, {0, 112}, {0, 120},
@@ -364,5 +364,38 @@ PRIVATE HTStyle HTStyleHeadingRight = {
 PRIVATE HTStyleSheet sheet = { "default.style",
 				&HTStyleHeadingRight }; /* sheet */
 
-PUBLIC HTStyleSheet * styleSheet = &sheet;
- 
+PUBLIC HTStyleSheet * DefaultStyle NOARGS
+{
+    static HTStyleSheet *result;
+    HTStyle *p, *q;
+
+    /*
+     * The first time we're called, allocate a copy of the 'sheet' linked
+     * list.  Thereafter, simply copy the data from 'sheet' into our copy
+     * (preserving the copy's linked-list pointers).  We do this to reset the
+     * parameters of a style that might be altered while processing a page.
+     */
+    if (result == 0) {	/* allocate & copy */
+    	result = HTStyleSheetNew ();
+	*result = sheet;
+	result->styles = 0;
+	for (p = sheet.styles; p != 0; p = p->next) {
+	    q = HTStyleNew ();
+	    *q = *p;
+	    q->next = result->styles;
+	    result->styles = q;
+	}
+    } else {		/* recopy the data */
+    	for (p = result->styles, q = sheet.styles;
+		p != 0 && q != 0;
+		p = p->next, q = q->next) {
+    	    HTStyle *r = p->next;
+	    HTStyle temp;
+	    temp = *p;
+	    temp.next = q->next;
+	    *p = *q;
+	    p->next = r;
+	}
+    }
+    return result;
+}
diff --git a/src/GridText.c b/src/GridText.c
index 102f5a43..160b5fe9 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -78,10 +78,6 @@ extern BOOL HTPassHighCtrlRaw;
 extern HTkcode kanji_code;
 extern HTCJKlang HTCJK;
 
-/*	From default style sheet:
-*/
-extern HTStyleSheet * styleSheet;	/* Default or overridden */
-
 /*	Exports
 */
 PUBLIC HText * HTMainText = NULL;		/* Equivalent of main window */
@@ -2338,7 +2334,7 @@ PUBLIC void HText_appendCharacter ARGS2(
      *  Tabs.
      */
     if (ch == '\t') {
-	HTTabStop * Tab;
+	CONST HTTabStop * Tab;
 	int target;	/* Where to tab to */
 	int here;
 
@@ -3355,7 +3351,7 @@ re_parse:
 /*	Dump diagnostics to stderr
 */
 PUBLIC void HText_dump ARGS1(
-	HText *,	text)
+	HText *,	text GCC_UNUSED)
 {
     fprintf(stderr, "HText: Dump called\n");
 }
@@ -3491,7 +3487,9 @@ PUBLIC int HTGetLinkInfo ARGS6(
 {
     TextAnchor *a;
     HTAnchor *link_dest;
+#ifndef DONT_TRACK_INTERNAL_LINKS
     HTAnchor *link_dest_intl = NULL;
+#endif
     int anchors_this_line = 0, anchors_this_screen = 0;
     int prev_anchor_line = -1, prev_prev_anchor_line = -1;
 
@@ -4271,8 +4269,8 @@ PUBLIC BOOL HText_selectAnchor ARGS2(
 /*	Apply this style to the selection
 */
 PUBLIC void HText_applyStyle ARGS2(
-	HText *,	me,
-	HTStyle *,	style)
+	HText *,	me GCC_UNUSED,
+	HTStyle *,	style GCC_UNUSED)
 {
 
 }
@@ -4281,8 +4279,8 @@ PUBLIC void HText_applyStyle ARGS2(
 /*	Update all text with changed style.
 */
 PUBLIC void HText_updateStyle ARGS2(
-	HText *,	me,
-	HTStyle *,	style)
+	HText *,	me GCC_UNUSED,
+	HTStyle *,	style GCC_UNUSED)
 {
 
 }
@@ -4291,8 +4289,8 @@ PUBLIC void HText_updateStyle ARGS2(
 /*	Return style of  selection
 */
 PUBLIC HTStyle * HText_selectionStyle ARGS2(
-	HText *,		me,
-	HTStyleSheet *,		sheet)
+	HText *,		me GCC_UNUSED,
+	HTStyleSheet *,		sheet GCC_UNUSED)
 {
     return 0;
 }
@@ -4301,9 +4299,9 @@ PUBLIC HTStyle * HText_selectionStyle ARGS2(
 /*	Paste in styled text
 */
 PUBLIC void HText_replaceSel ARGS3(
-	HText *,	me,
-	CONST char *,	aString,
-	HTStyle *,	aStyle)
+	HText *,	me GCC_UNUSED,
+	CONST char *,	aString GCC_UNUSED,
+	HTStyle *,	aStyle GCC_UNUSED)
 {
 }
 
@@ -4312,8 +4310,8 @@ PUBLIC void HText_replaceSel ARGS3(
 **	(style recovery only)
 */
 PUBLIC void HTextApplyToSimilar ARGS2(
-	HText *,	me,
-	HTStyle *,	style)
+	HText *,	me GCC_UNUSED,
+	HTStyle *,	style GCC_UNUSED)
 {
 
 }
@@ -4323,8 +4321,8 @@ PUBLIC void HTextApplyToSimilar ARGS2(
 **	(style recovery only)
 */
 PUBLIC void HTextSelectUnstyled ARGS2(
-	HText *,		me,
-	HTStyleSheet *,		sheet)
+	HText *,		me GCC_UNUSED,
+	HTStyleSheet *,		sheet GCC_UNUSED)
 {
 
 }
@@ -4333,13 +4331,13 @@ PUBLIC void HTextSelectUnstyled ARGS2(
 /*	Anchor handling:
 */
 PUBLIC void HText_unlinkSelection ARGS1(
-	HText *,	me)
+	HText *,	me GCC_UNUSED)
 {
 
 }
 
 PUBLIC HTAnchor * HText_referenceSelected ARGS1(
-	HText *,	me)
+	HText *,	me GCC_UNUSED)
 {
      return 0;
 }
@@ -4358,8 +4356,8 @@ PUBLIC int HText_getLines ARGS1(
 }
 
 PUBLIC HTAnchor * HText_linkSelTo ARGS2(
-	HText *,	me,
-	HTAnchor *,	anchor)
+	HText *,	me GCC_UNUSED,
+	HTAnchor *,	anchor GCC_UNUSED)
 {
     return 0;
 }
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index a2c78dbe..a5390387 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -414,7 +414,9 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
 /*	Abort writing
 **	-------------
 */
-PRIVATE void HTFWriter_abort ARGS2(HTStream *, me, HTError, e)
+PRIVATE void HTFWriter_abort ARGS2(
+	HTStream *,	me,
+	HTError,	e GCC_UNUSED)
 {
     if (TRACE)
 	fprintf(stderr,"HTFWriter_abort called\n");
@@ -908,8 +910,7 @@ Prepend_BASE:
 	    StrAllocCopy(temp, anchor->charset);
 	    collapse_spaces(temp);
 		fprintf(ret_obj->fp,
-		"<META HTTP-EQUIV=\"Content-Type\" "
-		"CONTENT=\"text/html; charset=%s\">\n\n",
+		"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=%s\">\n\n",
 		temp);
 	}
 	FREE(temp);
@@ -1158,9 +1159,9 @@ Compressed_tempname:
 **
 */
 PUBLIC HTStream* HTDumpToStdout ARGS3(
-	HTPresentation *,	pres,
+	HTPresentation *,	pres GCC_UNUSED,
 	HTParentAnchor *,	anchor,
-	HTStream *,		sink)
+	HTStream *,		sink GCC_UNUSED)
 {
     HTStream * ret_obj;
     ret_obj = (HTStream*)calloc(sizeof(* ret_obj),1);
diff --git a/src/HTML.c b/src/HTML.c
index 33fe2440..8d5c705b 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -72,11 +72,15 @@ extern BOOLEAN HT_Is_Gopher_URL;
 /* from Curses.h */
 extern int LYcols;
 
-extern HTStyleSheet * styleSheet;	/* Application-wide */
+struct _HTStream {
+    CONST HTStreamClass *	isa;
+    /* .... */
+};
+
+PRIVATE HTStyleSheet * styleSheet;	/* Application-wide */
 
 /*	Module-wide style cache
 */
-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    */
@@ -265,7 +269,7 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 
     case HTML_PRE:				/* Formatted text */
 	/*
-	 *  We guarrantee that the style is up-to-date in begin_litteral
+	 *  We guarantee that the style is up-to-date in begin_litteral
 	 *  But we still want to strip \r's
 	 */
 	if (c != '\r' &&
@@ -282,7 +286,7 @@ PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
     case HTML_XMP:
     case HTML_PLAINTEXT:
 	/*
-	 *  We guarrantee that the style is up-to-date in begin_litteral
+	 *  We guarantee that the style is up-to-date in begin_litteral
 	 *  But we still want to strip \r's
 	 */
 	if (c != '\r')	{
@@ -397,7 +401,7 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s)
     case HTML_XMP:
     case HTML_PLAINTEXT:
 	/*
-	 *  We guarrantee that the style is up-to-date in begin_litteral
+	 *  We guarantee that the style is up-to-date in begin_litteral
 	 */
 	HText_appendText(me->text, s);
 	break;
@@ -6695,8 +6699,7 @@ End_Object:
 */
 PUBLIC int HTML_put_entity ARGS2(HTStructured *, me, int, entity_number)
 {
-    int nent = HTML_dtd.number_of_entities, c_out;
-    UCode_t uni;
+    int nent = HTML_dtd.number_of_entities;
 
     if (entity_number < nent) {
 	HTML_put_string(me, p_entity_values[entity_number]);
@@ -7005,8 +7008,6 @@ PRIVATE void HTML_abort ARGS2(HTStructured *, me, HTError, e)
 */
 PRIVATE void get_styles NOARGS
 {
-    got_styles = YES;
-
     default_style =		HTStyleNamed(styleSheet, "Normal");
 
     styles[HTML_H1] =		HTStyleNamed(styleSheet, "Heading1");
@@ -7128,10 +7129,14 @@ PUBLIC HTStructured* HTML_new ARGS3(
     if (me == NULL)
 	outofmem(__FILE__, "HTML_new");
 
-    if (!got_styles)
-	get_styles();
-    else
-	default_style = HTStyleNamed(styleSheet, "Normal");
+    /*
+     * This used to call 'get_styles()' only on the first time through this
+     * function.  However, if the user reloads a page with ^R, the styles[]
+     * array is not necessarily the same as it was from 'get_styles()'.  So
+     * we reinitialize the whole thing.
+     */
+    styleSheet = DefaultStyle();
+    get_styles();
 
     me->isa = &HTMLPresentation;
     me->node_anchor = anchor;
@@ -7427,7 +7432,7 @@ PUBLIC HTStream* HTMLParsedPresent ARGS3(
 **	This will convert from HTML to presentation or plain text.
 */
 PUBLIC HTStream* HTMLToC ARGS3(
-	HTPresentation *,	pres,
+	HTPresentation *,	pres GCC_UNUSED,
 	HTParentAnchor *,	anchor,
 	HTStream *,		sink)
 {
@@ -7450,9 +7455,9 @@ PUBLIC HTStream* HTMLToC ARGS3(
 */
 #ifndef GUI
 PUBLIC HTStream* HTMLPresent ARGS3(
-	HTPresentation *,	pres,
+	HTPresentation *,	pres GCC_UNUSED,
 	HTParentAnchor *,	anchor,
-	HTStream *,		sink)
+	HTStream *,		sink GCC_UNUSED)
 {
     return SGML_new(&HTML_dtd, anchor, HTML_new(anchor, WWW_PRESENT, NULL));
 }
@@ -7477,7 +7482,7 @@ PUBLIC HTStream* HTMLPresent ARGS3(
 **	returns a negative number to indicate lack of success in the load.
 */
 PUBLIC int HTLoadError ARGS3(
-	HTStream *,	sink,
+	HTStream *,	sink GCC_UNUSED,
 	int,		number,
 	CONST char *,	message)
 {
diff --git a/src/HTML.h b/src/HTML.h
index 7507d3ea..5a642367 100644
--- a/src/HTML.h
+++ b/src/HTML.h
@@ -210,11 +210,6 @@ struct _HTStructured {
     int 		tag_charset; /* charset for attribute values etc. */
 };
 
-struct _HTStream {
-    CONST HTStreamClass *	isa;
-    /* .... */
-};
-
 extern  HTStyle *styles[HTML_ELEMENTS+31]; /* adding 24 nested list styles  */
 					   /* and 3 header alignment styles */
 					   /* and 3 div alignment styles    */
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index 4798e8e3..2f9e4362 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -31,16 +31,25 @@ PUBLIC int LYNumCharsets = 0; /* Will be initialized later by UC_Register. */
  *  INSTRUCTIONS for adding new character sets which do not have
  *		 Unicode tables.
  *
+ *  Currently we only declare some charset's properties here
+ *  (such as MIME names, etc.), it does not include real mapping.
+ *
+ *  [We hope you need not correct/add old-style mapping
+ *  as in ISO_LATIN1[] or SevenBitApproximations[] any more -
+ *  it works now via new chartrans mechanism, but kept for compatibility only:
+ *  we should cleanup the stuff, but this is not so easy...]
+ *
+ *  There is a place marked "Add your new character sets HERE" in this file.
  *  Make up a character set and add it in the same
  *  style as the ISO_LATIN1 set below, giving it a unique name.
  *
- *  Near the end of this file is a place marked "Add your character sets HERE".
+ *  Add the name of the set to LYCharSets.
+ *  Similarly add the appropriate information to the tables below:
+ *  LYchar_set_names, LYCharSet_UC, LYlowest_eightbit.
+ *  These 4 tables all MUST have the same order.
+ *  (And this is the order you will see in Lynx Options Menu,
+ *  which is why few unicode-based charsets are listed here).
  *
- *  Add the name of the set to LYCharSets at the bottom of this file, and
- *  also add it to the LYchar_set_names table below LYCharSets.
- *  Similarly add the appropriate information to LYCharSet_UC and to
- *  LYlowest_eightbit below that.
- *  These tables all MUST have the same order.
  */
 
 /*	Entity values -- for ISO Latin 1 local representation
@@ -96,7 +105,7 @@ PRIVATE char * ISO_Latin1[] = {
 	"\251", /* copyright sign (&#169;) - copy */
 	"\244", /* currency sign (&#164;) - curren */
 	"\260", /* degree sign (&#176;) - deg */
-	"\250", /* spacing diaresis (&#168;) - die */
+	"\250", /* spacing dieresis (&#168;) - die */
 	"\367", /* division sign (&#247;) - divide */
 	"\351", /* small e, acute accent (&#233;) - eacute */
 	"\352", /* small e, circumflex accent (&#234;) - ecirc */
@@ -155,7 +164,7 @@ PRIVATE char * ISO_Latin1[] = {
 	"\372", /* small u, acute accent (&#250;) - uacute */
 	"\373", /* small u, circumflex accent (&#251;) - ucirc */
 	"\371", /* small u, grave accent (&#249;) - ugrave */
-	"\250", /* spacing diaresis (&#168;) - uml */
+	"\250", /* spacing dieresis (&#168;) - uml */
 	"\374", /* small u, dieresis or umlaut mark (&#252;) - uuml */
 	"\375", /* small y, acute accent (&#253;) - yacute */
 	"\245", /* yen sign (&#165;) - yen */
@@ -231,7 +240,7 @@ PUBLIC char * SevenBitApproximations[] = {
 	"(c)",	/* copyright sign (&#169;) - copy */
 	"CUR",	/* currency sign (&#164;) - curren */
 	"DEG",	/* degree sign (&#176;) - deg */
-	"\042", /* spacing diaresis (&#168;) - die */
+	"\042", /* spacing dieresis (&#168;) - die */
 	"/",	/* division sign (&#247;) - divide */
 	"e",	/* small e, acute accent (&#233;) - eacute */
 	"e",	/* small e, circumflex accent (&#234;) - ecirc */
@@ -294,7 +303,7 @@ PUBLIC char * SevenBitApproximations[] = {
 	"u",	/* small u, acute accent (&#250;) - uacute */
 	"u",	/* small u, circumflex accent (&#251;) - ucirc */
 	"u",	/* small u, grave accent (&#249;) - ugrave */
-	"\042", /* spacing diaresis (&#168;) - uml */
+	"\042", /* spacing dieresis (&#168;) - uml */
 #ifdef LY_UMLAUT
 	"ue",	/* small u, dieresis or umlaut mark (&#252;) - uuml */
 #else
@@ -670,7 +679,7 @@ PUBLIC CONST char * LYEntityNames[] = {
 	"yen",		/* 165, yen sign */
 	"brvbar",	/* 166, broken vertical bar, (brkbar) */
 	"sect", 	/* 167, section sign */
-	"uml",		/* 168, spacing diaresis */
+	"uml",		/* 168, spacing dieresis */
 	"copy", 	/* 169, copyright sign */
 	"ordf", 	/* 170, feminine ordinal indicator */
 	"laquo",	/* 171, angle quotation mark, left */
@@ -779,15 +788,17 @@ 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
+ *  in the ISO_Latin1 and UC_entity_info unicode_entities arrays.
+ *  It returns 0 if not found. - FM
+ *
+ *  unicode_entities[] now handles all the names from old style entities[] too.
+ *  Lynx now calls unicode_entities[] only through this function:
+ *  HTMLGetEntityUCValue().  Note, we need not check for special characters
+ *  here in function or even before it, we should check them *after*
+ *  invoking this function, see put_special_unicodes() in SGML.c.
  *
- *  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
+ *  In the future we will try to isolate all calls to entities[]
+ *  in favor of new unicode-based chartrans scheme. - LP
  */
 PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
 	CONST char *,	name)
@@ -796,7 +807,7 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
     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;
+    CONST UC_entity_info * unicode_entities = HTML_dtd.unicode_entity_info;
 
     /*
      *	Make sure we have a non-zero length name. - FM
@@ -807,7 +818,9 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
 
 #ifdef NOTDEFINED
 /*
-**  extra_entities[] now handle all names from entities[], so disable latter.
+**  unicode_entities[] now handles all names from entities[], so disable latter.
+**  Let us keep this some sort of comment until we remove
+**  all calls to old-style entities[] from the code. - LP
 */
 
     /*
@@ -864,23 +877,23 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
     }
 
     /*
-     *	Not yet found, so try UC_entity_info extra_entities[]. - FM
+     *	Not yet found...    - FM
      */
 #endif /* NOTDEFINED */
 
     /*
-     *	Try UC_entity_info extra_entities[].
+     *	Try UC_entity_info unicode_entities[].
      */
-    for (low = 0, high = HTML_dtd.number_of_extra_entities;
+    for (low = 0, high = HTML_dtd.number_of_unicode_entities;
 	 high > low;
 	 diff < 0 ? (low = i+1) : (high = i)) {
 	/*
 	**  Binary search.
 	*/
 	i = (low + (high-low)/2);
-	diff = strcmp(extra_entities[i].name, name);
+	diff = strcmp(unicode_entities[i].name, name);	/* Case sensitive! */
 	if (diff == 0) {
-	    value = extra_entities[i].code;
+	    value = unicode_entities[i].code;
 	    break;
 	}
     }
diff --git a/src/LYCharSets.h b/src/LYCharSets.h
index 08c9f482..17ee98e2 100644
--- a/src/LYCharSets.h
+++ b/src/LYCharSets.h
@@ -15,7 +15,8 @@ extern int current_char_set;
 extern CONST char * LYchar_set_names[];
 
 /*
- *  Initializer for LYCharSets.c.
+ *  Initializer, calls initialization function for the
+ *  CHARTRANS handling. - KW
  */
 extern int LYCharSetsDeclared NOPARAMS;
 
@@ -30,9 +31,17 @@ extern void HTMLSetCharacterHandling PARAMS((int i));
 extern void HTMLSetRawModeDefault PARAMS((int i));
 extern void HTMLSetUseDefaultRawMode PARAMS((int i, BOOLEAN modeflag));
 extern void HTMLSetHaveCJKCharacterSet PARAMS((int i));
+extern void HTMLUseCharacterSet PARAMS((int i));
+extern UCode_t HTMLGetEntityUCValue PARAMS((CONST char *name));
+
 extern CONST char * LYEntityNames[];
 extern CONST char * HTMLGetEntityName PARAMS((UCode_t code));
-extern UCode_t HTMLGetEntityUCValue PARAMS((CONST char *name));
-extern void HTMLUseCharacterSet PARAMS((int i));
+		/*
+		** HTMLGetEntityName calls LYEntityNames for iso-8859-1 entity
+		** names only.	This is an obsolete technique but widely used in
+		** the code.  Note that unicode number in general may have
+		** several equivalent entity names because of synonyms.
+		*/
+
 
 #endif /* LYCHARSETS_H */
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index acc8e0aa..33e775b0 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -833,7 +833,7 @@ PUBLIC void LYGetChartransInfo ARGS1(
 				      UCT_STAGE_STRUCTURED);
 }
 
-#if 0
+#if NOTUSED_FOTEMODS
 /*
 **  This function reallocates an allocated string and converts
 **  characters for the current display character set.  It assumes
@@ -1026,7 +1026,7 @@ PUBLIC void LYExpandString ARGS2(
 		/*
 		**  Got an ASCII character when expecting
 		**  UTF-8 multibytes, so ignore the buffered
-		**  multibye characters and fall through with
+		**  multibyte characters and fall through with
 		**  the current ASCII character. - FM
 		*/
 		utf_count = 0;
@@ -1115,7 +1115,7 @@ PUBLIC void LYExpandString ARGS2(
 	}
 	/*
 	**  Ignore low ISO 646 7-bit control characters
-	**  if they sneeked through (should have been
+	**  if they sneaked through (should have been
 	**  filtered by the parser). - FM
 	*/
 	if (code < 32 &&
@@ -1124,7 +1124,7 @@ PUBLIC void LYExpandString ARGS2(
 	}
 	/*
 	**  Ignore 127 if we don't have HTPassHighCtrlRaw
-	**  and it sneeked through (should have been
+	**  and it sneaked through (should have been
 	**  filtered by the parser). - FM
 	*/
 	if (c == 127 &&
@@ -1134,7 +1134,7 @@ PUBLIC void LYExpandString ARGS2(
 	}
 	/*
 	**  Ignore 8-bit control characters 128 - 159 if we don't
-	**  have HTPassHighCtrlRaw set and they sneeked through
+	**  have HTPassHighCtrlRaw set and they sneaked through
 	**  (should have been filtered by the parser). - FM
 	*/
 	if (code > 127 && code < 160 &&
@@ -1362,7 +1362,7 @@ PUBLIC void LYExpandString ARGS2(
 						UCGetLYhndl_byMIME("us-ascii"),
 						0) >= 0)) {
 		/*
-		**  Got a repacement string (yippey). - FM
+		**  Got a replacement string (yippey). - FM
 		*/
 		HTChunkPuts(s, replace_buf);
 		continue;
@@ -1393,7 +1393,7 @@ PUBLIC void LYExpandString ARGS2(
     StrAllocCopy(*str, s->data);
     HTChunkFree(s);
 }
-#endif
+#endif /* NOTUSED_FOTEMODS */
 
 /*
 ** Get UCS character code for one character from UTF-8 encoded string.
@@ -1547,7 +1547,7 @@ PRIVATE char *hex = "0123456789ABCDEF";
 **
 **  If `stype' is st_URL, non-ASCII characters are URL-encoded instead.
 **  The sequence of bytes being URL-encoded is the raw input character if
-**  we couldn't transtate it from `cs_in' (CJK etc.); otherwise it is the
+**  we couldn't translate it from `cs_in' (CJK etc.); otherwise it is the
 **  UTF-8 representation if either `cs_to' requires this or if the
 **  character's Unicode value is > 255, otherwise it should be the iso-8859-1
 **  representation.
@@ -1592,8 +1592,6 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
     long int lcode;
     BOOL output_utf8 = 0, repl_translated_C0 = 0;
     size_t len;
-    int high, low, diff = 0, i;
-    CONST char ** entities = HTML_dtd.entity_names;
     CONST char * name = NULL;
     BOOLEAN no_bytetrans;
     UCTransParams T;
@@ -2509,7 +2507,7 @@ PUBLIC void LYHandleMETA ARGS4(
 	 *  header via META tags, because it's likely
 	 *  to be untrustworthy, but do check for a
 	 *  Date header from a server when making the
-	 *  comparsion. - FM
+	 *  comparison. - FM
 	 */
 	LYUCFullyTranslateString(&content, me->tag_charset, me->tag_charset,
 				 NO, NO, YES, st_other);
@@ -3168,7 +3166,7 @@ PUBLIC void LYHandleSELECT ARGS5(
 	     *	Force a newline when we're using a popup in
 	     *	a PRE block and are within 7 columns from the
 	     *	right margin.  This will allow for the '['
-	     *	popup designater and help avoid a wrap in the
+	     *	popup designator and help avoid a wrap in the
 	     *	underscore placeholder for the retracted popup
 	     *	entry in the HText structure. - FM
 	     */
@@ -3312,7 +3310,7 @@ PUBLIC int LYLegitimizeHREF ARGS4(
     if (!strncasecomp(*href, "lynxexec:", 9) ||
 	!strncasecomp(*href, "lynxprog:", 9)) {
 	/*
-	 *  The original implementions of these schemes expected
+	 *  The original implementations of these schemes expected
 	 *  white space without hex escaping, and did not check
 	 *  for hex escaping, so we'll continue to support that,
 	 *  until that code is redone in conformance with SGML
@@ -3567,8 +3565,8 @@ PUBLIC void LYHandleID ARGS2(
 }
 
 /*
-**  This function checks whether we want to overrride
-**  the current default alignment for parargraphs and
+**  This function checks whether we want to override
+**  the current default alignment for paragraphs and
 **  instead use that specified in the element's style
 **  sheet. - FM
 */
diff --git a/src/LYCurses.c b/src/LYCurses.c
index b23c7662..70eeb249 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -113,20 +113,20 @@ PUBLIC void LYsubAttr ARGS1(
 
 PUBLIC void lynx_setup_colors NOARGS
 {
-    SLtt_set_color(0, NULL, "black", "white");
-    SLtt_set_color(1, NULL, "blue", "white");	 /* bold */
-    SLtt_set_color(2, NULL, "yellow", "blue");	 /* reverse */
-    SLtt_set_color(4, NULL, "magenta", "white"); /* underline */
+    SLtt_set_color(0, NULL, DEFAULT_FG, DEFAULT_BG);
+    SLtt_set_color(1, NULL, "blue",	DEFAULT_BG); /* bold */
+    SLtt_set_color(2, NULL, "yellow",	"blue");     /* reverse */
+    SLtt_set_color(4, NULL, "magenta",	DEFAULT_BG); /* underline */
     /*
      *	The other objects are '|'ed together to get rest.
      */
-    SLtt_set_color(3, NULL, "green", "white");	 /* bold-reverse */
-    SLtt_set_color(5, NULL, "blue", "white");	 /* bold-underline */
-    SLtt_set_color(6, NULL, "red", "white");	 /* reverse-underline */
-    SLtt_set_color(7, NULL, "magenta", "cyan");  /* reverse-underline-bold */
+    SLtt_set_color(3, NULL, "green",	DEFAULT_BG); /* bold-reverse */
+    SLtt_set_color(5, NULL, "blue",	DEFAULT_BG); /* bold-underline */
+    SLtt_set_color(6, NULL, "red",	DEFAULT_BG); /* reverse-underline */
+    SLtt_set_color(7, NULL, "magenta",	"cyan");     /* reverse-underline-bold */
 
     /*
-     *	Now set monchrome attributes.
+     *	Now set monochrome attributes.
      */
     SLtt_set_mono(1, NULL, SLTT_BOLD_MASK);
     SLtt_set_mono(2, NULL, SLTT_REV_MASK);
@@ -235,7 +235,7 @@ PUBLIC void LYbox ARGS2(
      *	If we don't have explicitly specified characters for either
      *	vertical or horizontal lines, the characters that box() would
      *	use for the corners probably also won't work well.  So we
-     *	specifiy our own ASCII characters for the corners and call
+     *	specify our own ASCII characters for the corners and call
      *	wborder() instead of box(). - kw
      */
 #ifdef HAVE_WBORDER
@@ -444,13 +444,13 @@ PRIVATE struct {
     int fg, bg;
     chtype attr;
 } lynx_color_cfg[] = {
-    /*0*/ { COLOR_BLACK,   COLOR_WHITE, A_NORMAL}, /* A_NORMAL */
-    /*1*/ { COLOR_BLUE,    COLOR_WHITE, A_NORMAL}, /* A_BOLD */
+    /*0*/ { DEFAULT_FG,    DEFAULT_BG,	A_NORMAL}, /* A_NORMAL */
+    /*1*/ { COLOR_BLUE,    DEFAULT_BG,	A_NORMAL}, /* A_BOLD */
     /*2*/ { COLOR_YELLOW,  COLOR_BLUE,	A_BOLD},   /* A_REVERSE */
-    /*3*/ { COLOR_GREEN,   COLOR_WHITE, A_NORMAL}, /* A_REVERSE | A_BOLD */
-    /*4*/ { COLOR_MAGENTA, COLOR_WHITE, A_NORMAL}, /* A_UNDERLINE */
-    /*5*/ { COLOR_BLUE,    COLOR_WHITE, A_NORMAL}, /* A_UNDERLINE | A_BOLD */
-    /*6*/ { COLOR_RED,	   COLOR_WHITE, A_NORMAL}, /* A_UNDERLINE | A_REVERSE */
+    /*3*/ { COLOR_GREEN,   DEFAULT_BG,	A_NORMAL}, /* A_REVERSE | A_BOLD */
+    /*4*/ { COLOR_MAGENTA, DEFAULT_BG,	A_NORMAL}, /* A_UNDERLINE */
+    /*5*/ { COLOR_BLUE,    DEFAULT_BG,	A_NORMAL}, /* A_UNDERLINE | A_BOLD */
+    /*6*/ { COLOR_RED,	   DEFAULT_BG,	A_NORMAL}, /* A_UNDERLINE | A_REVERSE */
     /*7*/ { COLOR_MAGENTA, COLOR_CYAN,	A_NORMAL}  /* A_UNDERLINE | A_BOLD | A_REVERSE */
 };
 
@@ -489,7 +489,7 @@ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
 	}
 	if (no_color_video < 0)
 		no_color_video = 0;
-#endif /* __DJGPP__ */
+#endif /* !__DJGPP__ and !_WINDOWS */
 
 	if (Current_Attr & A_BOLD)
 		code |= 1;
@@ -714,12 +714,12 @@ PUBLIC void start_curses NOARGS
     SLsmg_Display_Eight_Bit = LYlowest_eightbit[current_char_set];
     if (SLsmg_Display_Eight_Bit > 191)
        SLsmg_Display_Eight_Bit = 191; /* may print ctrl chars otherwise - kw */
-    SLsmg_Newline_Moves = -1;
+    scrollok(0,0);
     SLsmg_Backspace_Moves = 1;
 #ifndef VMS
 #ifndef _WINDOWS
    SLtty_set_suspend_state(1);
-#endif /* _WINDOWS */
+#endif /* !_WINDOWS */
 #ifdef SIGTSTP
     if (!no_suspend)
 	signal(SIGTSTP, sl_suspend);
@@ -750,7 +750,7 @@ PUBLIC void start_curses NOARGS
 		"Terminal initialisation failed - unknown terminal type?\n");
 #ifndef NOSIGHUP
 	    (void) signal(SIGHUP, SIG_DFL);
-#endif /* NOSIGHUP */
+#endif /* !NOSIGHUP */
 	    (void) signal(SIGTERM, SIG_DFL);
 	    (void) signal(SIGINT, SIG_DFL);
 #ifdef SIGTSTP
@@ -791,7 +791,7 @@ PUBLIC void start_curses NOARGS
 		default_fg = DEFAULT_COLOR;
 		default_bg = DEFAULT_COLOR;
 	    }
-#endif
+#endif /* HAVE_USE_DEFAULT_COLORS */
 	}
 #endif /* USE_COLOR_STYLE || USE_COLOR_TABLE */
 
@@ -860,7 +860,7 @@ PUBLIC void lynx_enable_mouse ARGS1(int,state)
      mousemask(0, NULL);
 #else
    if (state) mouse_set(BUTTON1_CLICKED && BUTTON2_CLICKED && BUTTON3_CLICKED);
-#endif /* _WINDOWS */
+#endif /* !_WINDOWS */
 #endif /* NCURSES_MOUSE_VERSION */
 
 #if defined(DJGPP) && !defined(USE_SLANG)
@@ -1105,7 +1105,7 @@ PRIVATE int dumbterm ARGS1(
     int dumb = FALSE;
 
     /*
-     *	Began checking for terminal == NULL in case that TERM environemnt
+     *	Began checking for terminal == NULL in case that TERM environment
      *	variable is not set.  Thanks to Dick Wesseling (ftu@fi.ruu.nl).
      */
     if (terminal == NULL ||
@@ -1149,8 +1149,8 @@ PUBLIC void LYsubAttr ARGS1(
 {
     LYsubWAttr(stdscr, a);
 }
-#endif
-#endif /* USE_COLOR_STYLE */
+#endif /* USE_COLOR_TABLE */
+#endif /* !USE_COLOR_STYLE */
 #endif /* FANCY_CURSES */
 #endif /* VMS */
 
@@ -1285,7 +1285,7 @@ PUBLIC void VMSexit NOARGS
     if (!DidCleanup) {
 	if (LYOutOfMemory == FALSE) {
 	    fprintf(stderr,
-"\nA Fatal error has occured in %s Ver. %s\n", LYNX_NAME, LYNX_VERSION);
+"\nA Fatal error has occurred in %s Ver. %s\n", LYNX_NAME, LYNX_VERSION);
 	    fprintf(stderr,
 "\nPlease notify your system administrator to confirm a bug, and if\n");
 	    fprintf(stderr,
@@ -1669,7 +1669,7 @@ PUBLIC void lynx_force_repaint NOARGS
     bkgd(a | ' ');
 #endif
     attrset(a);
-#endif
+#endif /* COLOR_CURSES */
     clearok(curscr, TRUE);
 }
 
@@ -1727,7 +1727,7 @@ PUBLIC void lynx_stop_link_color ARGS2(
 #if defined(FANCY_CURSES) && defined(COLOR_CURSES)
 	if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON)
 	    stop_underline ();
-#endif /* USE_SLANG */
+#endif /* FANCY_CURSES && COLOR_CURSES */
     } else {
 	stop_bold();
 	/*
diff --git a/src/LYCurses.h b/src/LYCurses.h
index 259f2926..41d04aea 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -52,6 +52,29 @@
 #undef HZ  /* to prevent parse error :( */
 #endif /* HZ */
 
+/* SunOS 4.x has a redefinition between ioctl.h and termios.h */
+#if defined(sun) && !defined(__SVR4)
+#undef NL0
+#undef NL1
+#undef CR0
+#undef CR1
+#undef CR2
+#undef CR3
+#undef TAB0
+#undef TAB1
+#undef TAB2
+#undef XTABS
+#undef BS0
+#undef BS1
+#undef FF0
+#undef FF1
+#undef ECHO
+#undef NOFLSH
+#undef TOSTOP
+#undef FLUSHO
+#undef PENDIN
+#endif
+
 #ifdef HAVE_CONFIG_H
 # ifdef HAVE_NCURSES_H
 #  include <ncurses.h>
@@ -163,7 +186,7 @@ extern unsigned int Lynx_Color_Flags;
 #ifdef USE_SLANG
 #if !defined(VMS) && !defined(DJGPP)
 #define USE_SLANG_MOUSE		1
-#endif
+#endif /* USE_SLANG */
 
 #define SL_LYNX_USE_COLOR	1
 #define SL_LYNX_USE_BLINK	2
@@ -198,11 +221,18 @@ extern void LY_SLerase NOPARAMS;
 #define standout SLsmg_reverse_video
 #define standend  SLsmg_normal_video
 #define clrtoeol SLsmg_erase_eol
+
+#ifdef SLSMG_NEWLINE_SCROLLS
+#define scrollok(a,b) SLsmg_Newline_Behavior \
+   = ((b) ? SLSMG_NEWLINE_SCROLLS : SLSMG_NEWLINE_MOVES)
+#else
 #define scrollok(a,b) SLsmg_Newline_Moves = ((b) ? 1 : -1)
+#endif
+
 #define addch SLsmg_write_char
 #define echo()
 #define printw SLsmg_printf
- 
+
 extern int curscr;
 extern BOOLEAN FullRefresh;
 #ifdef clearok
@@ -308,11 +338,11 @@ extern int  lynx_chg_color PARAMS((int, int, int));
  *  so we'll use them synonymously for bold and
  *  reverse, and ignore underline. - FM
  */
-#define start_bold()		standout()  
+#define start_bold()		standout()
 #define start_underline()	/* nothing */
 #define start_reverse()		standout()
 #define wstart_reverse(a)	wstandout(a)
-#define stop_bold()		standend()  
+#define stop_bold()		standend()
 #define stop_underline()	/* nothing */
 #define stop_reverse()		standend()
 #define wstop_reverse(a)	wstandend(a)
diff --git a/src/LYDownload.c b/src/LYDownload.c
index 0934266f..bc047b87 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -40,7 +40,7 @@ PUBLIC BOOLEAN LYDidRename = FALSE;
 PRIVATE char LYValidDownloadFile[256] = "\0";
 
 PUBLIC void LYDownload ARGS1(
-	char *,		line) 
+	char *, 	line)
 {
     char *Line = NULL, *method, *file, *sug_file = NULL;
     int method_number;
@@ -62,65 +62,65 @@ PUBLIC void LYDownload ARGS1(
 #endif /* VMS */
 
     /*
-     *  Make sure we have a valid download
-     *  file comparison string loaded via
-     *  the download options menu. - FM
+     *	Make sure we have a valid download
+     *	file comparison string loaded via
+     *	the download options menu. - FM
      */
     if (LYValidDownloadFile[0] == '\0') {
 	goto failed;
     }
 
     /*
-     *  Make a copy of the LYNXDOWNLOAD
-     *  internal URL for parsing. - FM
+     *	Make a copy of the LYNXDOWNLOAD
+     *	internal URL for parsing. - FM
      */
     StrAllocCopy(Line, line);
 
     /*
-     *  Parse out the sug_file, Method and the File.
+     *	Parse out the sug_file, Method and the File.
      */
     if ((sug_file = (char *)strstr(Line, "SugFile=")) != NULL) {
 	*(sug_file-1) = '\0';
-        /*
+	/*
 	 *  Go past "SugFile=".
 	 */
-        sug_file += 8;
+	sug_file += 8;
     }
 
     if ((file = (char *)strstr(Line, "File=")) == NULL)
 	goto failed;
     *(file-1) = '\0';
     /*
-     *  Go past "File=".
+     *	Go past "File=".
      */
     file += 5;
 
     /*
-     *  Make sure that the file string is the one from
-     *  the last displayed download options menu. - FM
+     *	Make sure that the file string is the one from
+     *	the last displayed download options menu. - FM
      */
     if (strcmp(file, LYValidDownloadFile)) {
-        goto failed;
+	goto failed;
     }
 
 #ifdef DIRED_SUPPORT
     if (!strncmp(file, "file://localhost", 16))
-        file += 16;
+	file += 16;
     else if (!strncmp(file, "file:", 5))
-        file += 5;
+	file += 5;
     HTUnEscape(file);
 #endif /* DIRED_SUPPORT */
 
     if ((method = (char *)strstr(Line, "Method=")) == NULL)
 	goto failed;
     /*
-     *  Go past "Method=".
+     *	Go past "Method=".
      */
     method += 7;
     method_number = atoi(method);
- 
+
     /*
-     *  Set up the sug_filenames recall buffer.
+     *	Set up the sug_filenames recall buffer.
      */
     FnameTotal = (sug_filenames ? HTList_count(sug_filenames) : 0);
     recall = ((FnameTotal >= 1) ? RECALL : NORECALL);
@@ -164,32 +164,32 @@ check_recall:
 		    goto retry;
 		} else if ((cp = (char *)HTList_objectAt(
 						sug_filenames,
-	    					FnameNum)) != NULL) {
+						FnameNum)) != NULL) {
 		    strcpy(buffer, cp);
 		    if (FnameTotal == 1) {
-		        _statusline(EDIT_THE_PREV_FILENAME);
+			_statusline(EDIT_THE_PREV_FILENAME);
 		    } else {
-		        _statusline(EDIT_A_PREV_FILENAME);
+			_statusline(EDIT_A_PREV_FILENAME);
 		    }
 		    goto check_recall;
 		}
 	    } else if (recall && ch == DNARROW) {
-	        if (FirstRecall) {
+		if (FirstRecall) {
 		    FirstRecall = FALSE;
 		    /*
-		     *  Use the first Fname in the list. - FM
+		     *	Use the first Fname in the list. - FM
 		     */
 		    FnameNum = FnameTotal - 1;
 		} else {
 		    /*
-		     *  Advance to the next Fname in the list. - FM
+		     *	Advance to the next Fname in the list. - FM
 		     */
 		    FnameNum--;
 		}
 		if (FnameNum < 0) {
 		    /*
-		     *  Set the FirstRecall flag,
-		     *  and use sug_file or a blank. - FM
+		     *	Set the FirstRecall flag,
+		     *	and use sug_file or a blank. - FM
 		     */
 		    FirstRecall = TRUE;
 		    FnameNum = FnameTotal;
@@ -197,19 +197,19 @@ check_recall:
 		    goto retry;
 		} else if ((cp = (char *)HTList_objectAt(
 						sug_filenames,
-	    					FnameNum)) != NULL) {
+						FnameNum)) != NULL) {
 		    strcpy(buffer, cp);
 		    if (FnameTotal == 1) {
-		        _statusline(EDIT_THE_PREV_FILENAME);
+			_statusline(EDIT_THE_PREV_FILENAME);
 		    } else {
-		        _statusline(EDIT_A_PREV_FILENAME);
+			_statusline(EDIT_A_PREV_FILENAME);
 		    }
 		    goto check_recall;
 		}
 	    }
 
 	    /*
-	     *  Save cancelled.
+	     *	Save cancelled.
 	     */
 	    goto cancelled;
 	}
@@ -245,7 +245,7 @@ check_recall:
 	    *(cp++) = '\0';
 	    strcpy(command, buffer);
 	    if ((len = strlen(command)) > 0 && command[len-1] == '/')
-	        command[len-1] = '\0';
+		command[len-1] = '\0';
 #ifdef DOSPATH
 	    strcat(command, HTDOS_wwwName((char *)Home_Dir()));
 #else
@@ -259,24 +259,24 @@ check_recall:
 	    strcpy(buffer, command);
 	}
 #ifdef VMS
-        if (strchr(buffer, '/') != NULL) {
+	if (strchr(buffer, '/') != NULL) {
 	    strcpy(command, HTVMS_name("", buffer));
 	    strcpy(buffer, command);
 	}
 	if (buffer[0] != '/' && strchr(buffer, ':') == NULL) {
 	    strcpy(command, "sys$disk:");
 	    if (strchr(buffer, ']') == NULL)
-	        strcat(command, "[]");
+		strcat(command, "[]");
 	    strcat(command, buffer);
 	    strcpy(buffer, command);
 	}
 #else
-        if (*buffer != '/')
+	if (*buffer != '/')
 	    cp = getenv("PWD");
 	else
 	    cp = NULL;
 	if (cp) {
-            sprintf(command, "%s/%s", cp, buffer);
+	    sprintf(command, "%s/%s", cp, buffer);
 #ifdef DOSPATH
 	    strcpy(buffer, HTDOS_name(command));
 #else
@@ -292,16 +292,16 @@ check_recall:
 	    fclose(fp);
 
 #ifdef VMS
-            _statusline(FILE_EXISTS_HPROMPT);
+	    _statusline(FILE_EXISTS_HPROMPT);
 #else
-            _statusline(FILE_EXISTS_OPROMPT);
+	    _statusline(FILE_EXISTS_OPROMPT);
 #endif /* VMS */
 	    c = 0;
 	    while(TOUPPER(c)!='Y' && TOUPPER(c)!='N' && c != 7 && c != 3)
- 	        c = LYgetch();
+		c = LYgetch();
 #ifdef VMS
 	    if (HadVMSInterrupt) {
-	        HadVMSInterrupt = FALSE;
+		HadVMSInterrupt = FALSE;
 		FREE(Line);
 		return;
 	    }
@@ -344,13 +344,13 @@ check_recall:
 	    fprintf(stderr, "command: rename(%s, %s)\n", file, buffer);
 	if (rename(file, buffer)) {
 	    /*
-	     *  Failed.  Use spawned COPY_COMMAND. - FM
+	     *	Failed.  Use spawned COPY_COMMAND. - FM
 	     */
 	    if (TRACE)
-	        fprintf(stderr, "         FAILED!\n");
+		fprintf(stderr, "         FAILED!\n");
 	    sprintf(command, COPY_COMMAND, file, buffer);
 	    if (TRACE)
-	        fprintf(stderr, "command: %s\n", command);
+		fprintf(stderr, "command: %s\n", command);
 	    fflush(stderr);
 	    fflush(stdout);
 	    stop_curses();
@@ -360,9 +360,9 @@ check_recall:
 	    start_curses();
 	} else {
 	    /*
-	     *  We don't have the temporary file (it was renamed to
-	     *  a permanent file), so set a flag to pop out of the
-	     *  download menu. - FM
+	     *	We don't have the temporary file (it was renamed to
+	     *	a permanent file), so set a flag to pop out of the
+	     *	download menu. - FM
 	     */
 	    LYDidRename = TRUE;
 	}
@@ -378,13 +378,13 @@ check_recall:
 	FREE(cp1);
 	if (TRACE)
 	    fprintf(stderr, "command: %s\n", command);
-        fflush(stderr);
-        fflush(stdout);
-        stop_curses();
+	fflush(stderr);
+	fflush(stdout);
+	stop_curses();
 	system(command);
-        fflush(stdout);
+	fflush(stdout);
 	fflush(stderr);
-        start_curses();
+	start_curses();
 #if defined(UNIX)
 	LYRelaxFilePermissions(buffer);
 #endif /* defined(UNIX) */
@@ -395,19 +395,19 @@ check_recall:
 	 *  Use configured download commands.
 	 */
 	buffer[0] = '\0';
-        for (count = 0, download_command=downloaders;
+	for (count = 0, download_command=downloaders;
 	     count < method_number;
-       	     count++, download_command = download_command->next)
+	     count++, download_command = download_command->next)
 	    ; /* null body */
 
 	/*
 	 *  Commands have the form "command %s [etc]"
 	 *  where %s is the filename.
 	 */
-        if (download_command->command != NULL) {
+	if (download_command->command != NULL) {
 	    /*
-	     *  Check for two '%s' and ask for the local filename if
-	     *  there is.
+	     *	Check for two '%s' and ask for the local filename if
+	     *	there is.
 	     */
 	    char *first_s = strstr(download_command->command, "%s");
 	    if (first_s && strstr(first_s+1, "%s")) {
@@ -418,26 +418,26 @@ check_recall:
 		    *buffer = '\0';
 	check_again:
 		if ((ch = LYgetstr(buffer, VISIBLE,
-		    		   sizeof(buffer), recall)) < 0 ||
-	    	    *buffer == '\0' || ch == UPARROW || ch == DNARROW) {
+				   sizeof(buffer), recall)) < 0 ||
+		    *buffer == '\0' || ch == UPARROW || ch == DNARROW) {
 		    if (recall && ch == UPARROW) {
 			if (FirstRecall) {
 			    FirstRecall = FALSE;
 			    /*
-			     *  Use the last Fname in the list. - FM
+			     *	Use the last Fname in the list. - FM
 			     */
 			    FnameNum = 0;
 			} else {
 			    /*
-			     *  Go back to the previous Fname
-			     *  in the list. - FM
+			     *	Go back to the previous Fname
+			     *	in the list. - FM
 			     */
 			    FnameNum++;
 			}
 			if (FnameNum >= FnameTotal) {
 			    /*
-			     *  Reset the FirstRecall flag,
-			     *  and use sug_file or a blank. - FM
+			     *	Reset the FirstRecall flag,
+			     *	and use sug_file or a blank. - FM
 			     */
 			    FirstRecall = TRUE;
 			    FnameNum = FnameTotal;
@@ -445,7 +445,7 @@ check_recall:
 			    goto again;
 			} else if ((cp = (char *)HTList_objectAt(
 							sug_filenames,
-	    						FnameNum)) != NULL) {
+							FnameNum)) != NULL) {
 			    strcpy(buffer, cp);
 			    if (FnameTotal == 1) {
 				_statusline(EDIT_THE_PREV_FILENAME);
@@ -458,19 +458,19 @@ check_recall:
 			if (FirstRecall) {
 			    FirstRecall = FALSE;
 			    /*
-			     *  Use the first Fname in the list. - FM
+			     *	Use the first Fname in the list. - FM
 			     */
 			    FnameNum = FnameTotal - 1;
 			} else {
 			    /*
-			     *  Advance to the next Fname in the list. - FM
+			     *	Advance to the next Fname in the list. - FM
 			     */
 			    FnameNum--;
 			}
 			if (FnameNum < 0) {
 			    /*
-			     *  Set the FirstRecall flag,
-			     *  and use sug_file or a blank. - FM
+			     *	Set the FirstRecall flag,
+			     *	and use sug_file or a blank. - FM
 			     */
 			    FirstRecall = TRUE;
 			    FnameNum = FnameTotal;
@@ -478,7 +478,7 @@ check_recall:
 			    goto again;
 			} else if ((cp = (char *)HTList_objectAt(
 							sug_filenames,
-	    						FnameNum)) != NULL) {
+							FnameNum)) != NULL) {
 			    strcpy(buffer, cp);
 			    if (FnameTotal == 1) {
 				_statusline(EDIT_THE_PREV_FILENAME);
@@ -495,18 +495,18 @@ check_recall:
 		    goto cancelled;
 		}
 
-	        if (no_dotfiles || !show_dotfiles) {
+		if (no_dotfiles || !show_dotfiles) {
 		    if (*buffer == '.' ||
 #ifdef VMS
 		       ((cp = strrchr(buffer, ':')) && *(cp+1) == '.') ||
 		       ((cp = strrchr(buffer, ']')) && *(cp+1) == '.') ||
 #endif /* VMS */
 		       ((cp = strrchr(buffer, '/')) && *(cp+1) == '.')) {
-		        HTAlert(FILENAME_CANNOT_BE_DOT);
+			HTAlert(FILENAME_CANNOT_BE_DOT);
 			_statusline(NEW_FILENAME_PROMPT);
-		        goto again;
+			goto again;
 		    }
-	        }
+		}
 		/*
 		 *  Cancel if the user entered "/dev/null" on Unix,
 		 *  or an "nl:" path (case-insensitive) on VMS. - FM
@@ -524,52 +524,52 @@ check_recall:
 	    }
 
 	    /*
-	     *  The following is considered a bug by the community.
-	     *  If the command only takes one argument on the command
-	     *  line, then the suggested file name is not used.
-	     *  It actually is not a bug at all and does as it should,
-	     *  putting both names on the command line.
+	     *	The following is considered a bug by the community.
+	     *	If the command only takes one argument on the command
+	     *	line, then the suggested file name is not used.
+	     *	It actually is not a bug at all and does as it should,
+	     *	putting both names on the command line.
 	     */
 #ifdef VMS
-   	    sprintf(command, download_command->command, file, buffer,
+	    sprintf(command, download_command->command, file, buffer,
 			     "", "", "", "", "", "", "", "", "", "");
 #else /* Unix: */
 	    /*
-	     *  Prevent spoofing of the shell.
+	     *	Prevent spoofing of the shell.
 	     */
 	    cp = quote_pathname(file);
 	    cp1 = quote_pathname(buffer);
-   	    sprintf(command, download_command->command, cp, cp1,
+	    sprintf(command, download_command->command, cp, cp1,
 			     "", "", "", "", "", "", "", "", "", "");
 	    FREE(cp);
 	    FREE(cp1);
 #endif /* VMS */
 
-        } else {
-            _statusline(MISCONF_DOWNLOAD_COMMAND);
+	} else {
+	    _statusline(MISCONF_DOWNLOAD_COMMAND);
 	    sleep(AlertSecs);
 	    goto failed;
-        }
+	}
 
-        if (TRACE)
-            fprintf(stderr, "command: %s\n", command);
-        stop_curses();
+	if (TRACE)
+	    fprintf(stderr, "command: %s\n", command);
+	stop_curses();
 	fflush(stderr);
 	fflush(stdout);
-        system(command);
-        fflush(stderr);
+	system(command);
+	fflush(stderr);
 	fflush(stdout);
-        start_curses();
-        /* don't remove(file); */
+	start_curses();
+	/* don't remove(file); */
     }
 
     if (SecondS == TRUE) {
 #ifdef VMS
-        if (0 == strncasecomp(buffer, "sys$disk:", 9)) {
+	if (0 == strncasecomp(buffer, "sys$disk:", 9)) {
 	    if (0 == strncmp((buffer+9), "[]", 2)) {
-	        HTAddSugFilename(buffer+11);
-	    } else { 
-	        HTAddSugFilename(buffer+9);
+		HTAddSugFilename(buffer+11);
+	    } else {
+		HTAddSugFilename(buffer+9);
 	    }
 	} else {
 	    HTAddSugFilename(buffer);
@@ -592,7 +592,7 @@ cancelled:
     sleep(InfoSecs);
     FREE(Line);
     return;
-}	
+}
 
 /*
  *  LYdownload_options writes out the current download choices to
@@ -602,7 +602,7 @@ cancelled:
  */
 PUBLIC int LYdownload_options ARGS2(
 	char **,	newfile,
-	char *,		data_file)
+	char *, 	data_file)
 {
     static char tempfile[256];
     static BOOLEAN first = TRUE;
@@ -613,7 +613,7 @@ PUBLIC int LYdownload_options ARGS2(
     int count;
 
     if (first) {
-        tempname(tempfile, NEW_FILE);
+	tempname(tempfile, NEW_FILE);
 	first = FALSE;
 #if defined (VMS) || defined (DOSPATH)
     sprintf(download_filename, "file://localhost/%s", tempfile);
@@ -622,12 +622,12 @@ PUBLIC int LYdownload_options ARGS2(
 #endif /* VMS */
 #ifdef VMS
     } else {
-        remove(tempfile);   /* Remove duplicates on VMS. */
+	remove(tempfile);   /* Remove duplicates on VMS. */
 #endif /* VMS */
     }
 
     /*
-     *  Get a suggested filename.
+     *	Get a suggested filename.
      */
     StrAllocCopy(sug_filename, *newfile);
     change_sug_filename(sug_filename);
@@ -644,23 +644,23 @@ PUBLIC int LYdownload_options ARGS2(
     LYforce_no_cache = TRUE;  /* don't cache this doc */
 
     fprintf(fp0, "<head>\n<title>%s</title>\n</head>\n<body>\n",
-    		 DOWNLOAD_OPTIONS_TITLE);
+		 DOWNLOAD_OPTIONS_TITLE);
 
-    fprintf(fp0,"<h1>Download Options (%s Version %s)</h1>\n",
-    				       LYNX_NAME, LYNX_VERSION);
+    fprintf(fp0,"<h1>Download Options (%s Version %s)</h1><pre>\n",
+				       LYNX_NAME, LYNX_VERSION);
 
 
-    fputs("You have the following download choices.<br>\n", fp0);
-    fputs("Please select one:<br>\n<pre>\n", fp0);
+    fprintf(fp0, "   You have the following download choices.\n");
+    fprintf(fp0, "   Please select one:\n\n");
 
     if(!no_disk_save && !child_lynx)
 #ifdef DIRED_SUPPORT
 	/*
 	 *  Disable save to disk option for local files.
 	 */
-	if (!lynx_edit_mode) 
+	if (!lynx_edit_mode)
 #endif /* DIRED_SUPPORT */
-            fprintf(fp0,"   \
+	    fprintf(fp0,"   \
 <a href=\"LYNXDOWNLOAD://Method=-1/File=%s/SugFile=%s%s\">Save to disk</a>\n",
 	   data_file, (lynx_save_space ? lynx_save_space : ""), sug_filename);
 #ifdef DIRED_SUPPORT
@@ -670,13 +670,13 @@ PUBLIC int LYdownload_options ARGS2(
 	fprintf(fp0,"   Save to disk disabled.\n");
 
     if (downloaders != NULL) {
-        for (count = 0, cur_download = downloaders; cur_download != NULL; 
+	for (count = 0, cur_download = downloaders; cur_download != NULL;
 			cur_download = cur_download->next, count++) {
 	    if (!no_download || cur_download->always_enabled) {
-	        fprintf(fp0,"   \
-<a href=\"LYNXDOWNLOAD://Method=%d/File=%s/SugFile=%s\">", 
+		fprintf(fp0,"   \
+<a href=\"LYNXDOWNLOAD://Method=%d/File=%s/SugFile=%s\">",
 				count,data_file, sug_filename);
-		fprintf(fp0, (cur_download->name ? 
+		fprintf(fp0, (cur_download->name ?
 				cur_download->name : "No Name Given"));
 		fprintf(fp0,"</a>\n");
 	    }
@@ -690,7 +690,7 @@ an unlimited number of download methods using the lynx.cfg file.\n");
     fclose(fp0);
 
     /*
-     *  Free off temp copy.
+     *	Free off temp copy.
      */
     FREE(sug_filename);
 
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index 7b672158..bd70042b 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -552,7 +552,7 @@ PRIVATE void print_binding ARGS3(HTStream *, target, char *, buf, int, i)
 }
 
 PRIVATE int LYLoadKeymap ARGS4 (
-	CONST char *, 		arg,
+	CONST char *, 		arg GCC_UNUSED,
 	HTParentAnchor *,	anAnchor,
 	HTFormat,		format_out,
 	HTStream*,		sink)
@@ -589,7 +589,7 @@ PRIVATE int LYLoadKeymap ARGS4 (
 			  i-' ');  /* uppercase mapping is different */
 	}
     }
-    for (i = 1; i < sizeof(keymap); i++) {
+    for (i = 1; i < (int) sizeof(keymap); i++) {
 	/*
 	 *  LYK_PIPE not implemented yet.
 	 */
@@ -796,6 +796,7 @@ PUBLIC BOOL LYisNonAlnumKeyname ARGS2(
     return(keymap[ch+1] == key_name);
 }
 
+#ifdef NOTUSED_FOTEMODS
 /*
  *  This function returns the (int)ch mapped to the
  *  LYK_foo value passed to it as an argument. - FM
@@ -813,3 +814,4 @@ PUBLIC int LYReverseKeymap ARGS1(
 
     return(0);
 }
+#endif
diff --git a/src/LYLocal.c b/src/LYLocal.c
index c17c9a9a..87139561 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -87,7 +87,7 @@ PUBLIC char LYDiredFileURL[256] = "\0";
 PRIVATE char *filename PARAMS((
 	char *		prompt,
 	char *		buf,
-	int		bufsize));
+	size_t		bufsize));
 
 #ifdef OK_PERMIT
 PRIVATE BOOLEAN permit_location PARAMS((
@@ -1896,7 +1896,7 @@ PUBLIC int dired_options ARGS2(
 PRIVATE char *filename ARGS3(
 	char *, 	prompt,
 	char *, 	buf,
-	int,		bufsize)
+	size_t,		bufsize)
 {
     char *cp;
 
diff --git a/src/LYMail.c b/src/LYMail.c
index b27cbade..b7acce45 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -1887,7 +1887,7 @@ cleandown:
     return;
 }
 
-PRIVATE void terminate_letter ARGS1(int,sig)
+PRIVATE void terminate_letter ARGS1(int,sig GCC_UNUSED)
 {
     term_letter = TRUE;
     /* Reassert the AST */
diff --git a/src/LYMain.c b/src/LYMain.c
index 1af4cfd4..2e600b1e 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -94,7 +94,7 @@ PUBLIC char *finger_proxy_putenv_cmd = NULL; /* lynx.cfg defined finger_proxy */
 PUBLIC char *no_proxy_putenv_cmd = NULL;     /* lynx.cfg defined no_proxy */
 PUBLIC char *list_format=NULL;		/* LONG_LIST formatting mask */
 #ifdef SYSLOG_REQUESTED_URLS
-PUBLIC char *syslog_txt = NULL;		/* syslog arb text for session */
+PUBLIC char *syslog_txt = NULL; 	/* syslog arb text for session */
 #endif /* SYSLOG_REQUESTED_URLS */
 #endif /* !VMS */
 
@@ -162,12 +162,12 @@ PUBLIC lynx_html_item_type *uploaders = NULL;
 PUBLIC int port_syntax = 1;
 PUBLIC int LYShowColor = SHOW_COLOR_UNKNOWN; /* to show or not to show */
 PUBLIC int LYChosenShowColor = SHOW_COLOR_UNKNOWN; /* whether to show and save */
-PUBLIC int LYrcShowColor = SHOW_COLOR_UNKNOWN;  /* ... as last read or written */
+PUBLIC int LYrcShowColor = SHOW_COLOR_UNKNOWN;	/* ... as last read or written */
 PUBLIC BOOLEAN LYShowCursor = SHOW_CURSOR; /* to show or not to show */
 PUBLIC BOOLEAN LYUseDefShoCur = TRUE;	/* Command line -show_cursor toggle */
 PUBLIC BOOLEAN LYforce_no_cache = FALSE;
 PUBLIC BOOLEAN LYoverride_no_cache = FALSE;/*override no-cache b/c history etc*/
-PUBLIC BOOLEAN LYinternal_flag = FALSE;	/* override no-cache b/c internal link*/
+PUBLIC BOOLEAN LYinternal_flag = FALSE; /* override no-cache b/c internal link*/
 PUBLIC BOOLEAN LYresubmit_posts = ALWAYS_RESUBMIT_POSTS;
 PUBLIC BOOLEAN LYUserSpecifiedURL = TRUE;/* always TRUE  the first time */
 PUBLIC BOOLEAN LYJumpFileURL = FALSE;	 /* always FALSE the first time */
@@ -262,7 +262,7 @@ PUBLIC BOOLEAN LYforce_HTML_mode = FALSE;
 PUBLIC char *homepage = NULL;	/* home page or main screen */
 PUBLIC char *editor = NULL;	/* the name of the current editor */
 PUBLIC char *jumpfile = NULL;	/* the name of the default jumps file */
-PUBLIC char *jumpprompt = NULL;	/* the default jumps prompt */
+PUBLIC char *jumpprompt = NULL; /* the default jumps prompt */
 PUBLIC char *bookmark_page = NULL; /* the name of the default bookmark page */
 PUBLIC char *BookmarkPage = NULL;  /* the name of the current bookmark page */
 PUBLIC char *LynxHome = NULL;	/* the default Home HREF. */
@@ -284,11 +284,11 @@ PUBLIC char *language = NULL;	    /* preferred language */
 PUBLIC char *pref_charset = NULL;   /* preferred character set */
 PUBLIC BOOLEAN LYNewsPosting = NEWS_POSTING; /* News posting supported? */
 PUBLIC char *LynxSigFile = NULL;    /* Signature file, in or off home */
-PUBLIC char *system_mail = NULL;          /* The path for sending mail */
-PUBLIC char *system_mail_flags = NULL;    /* Flags for sending mail */
+PUBLIC char *system_mail = NULL;	  /* The path for sending mail */
+PUBLIC char *system_mail_flags = NULL;	  /* Flags for sending mail */
 PUBLIC char *lynx_temp_space = NULL; /* The prefix for temporary file paths */
 PUBLIC char *lynx_save_space = NULL; /* The prefix for save to disk paths */
-PUBLIC char *LYHostName = NULL;		/* treat as a local host name */
+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;
@@ -326,15 +326,15 @@ PUBLIC int nlinks = 0;		/* number of links in memory */
 PUBLIC int nhist = 0;		/* number of history entries */
 PUBLIC int more = FALSE;	/* is there more text to display? */
 PUBLIC int InfoSecs;	/* Seconds to sleep() for Information messages */
-PUBLIC int MessageSecs;	/* Seconds to sleep() for important Messages   */
+PUBLIC int MessageSecs; /* Seconds to sleep() for important Messages   */
 PUBLIC int AlertSecs;	/* Seconds to sleep() for HTAlert() messages   */
 PUBLIC BOOLEAN bookmark_start = FALSE;
-PUBLIC char *LYUserAgent = NULL;	/* Lynx User-Agent header          */
-PUBLIC char *LYUserAgentDefault = NULL;	/* Lynx default User-Agent header  */
+PUBLIC char *LYUserAgent = NULL;	/* Lynx User-Agent header	   */
+PUBLIC char *LYUserAgentDefault = NULL; /* Lynx default User-Agent header  */
 PUBLIC BOOLEAN LYUseMouse = FALSE;
-PUBLIC BOOLEAN LYNoRefererHeader=FALSE;	/* Never send Referer header?      */
+PUBLIC BOOLEAN LYNoRefererHeader=FALSE; /* Never send Referer header?	   */
 PUBLIC BOOLEAN LYNoRefererForThis=FALSE;/* No Referer header for this URL? */
-PUBLIC BOOLEAN LYNoFromHeader = TRUE;	/* Never send From header?         */
+PUBLIC BOOLEAN LYNoFromHeader = TRUE;	/* Never send From header?	   */
 PUBLIC BOOLEAN LYListNewsNumbers = LIST_NEWS_NUMBERS;
 PUBLIC BOOLEAN LYListNewsDates = LIST_NEWS_DATES;
 PUBLIC BOOLEAN LYisConfiguredForX = FALSE;
@@ -371,8 +371,8 @@ PUBLIC BOOLEAN LYQuitDefaultYes = QUIT_DEFAULT_YES;
 
 /* These are declared in cutil.h for current freeWAIS libraries. - FM */
 #ifdef DECLARE_WAIS_LOGFILES
-PUBLIC char *log_file_name = NULL; /* for WAIS log file name    in libWWW */
-PUBLIC FILE *logfile = NULL;	   /* for WAIS log file output  in libWWW */
+PUBLIC char *log_file_name = NULL; /* for WAIS log file name	in libWWW */
+PUBLIC FILE *logfile = NULL;	   /* for WAIS log file output	in libWWW */
 #endif /* DECLARE_WAIS_LOGFILES */
 
 extern int HTNewsChunkSize; /* Number of news articles per chunk (HTNews.c) */
@@ -395,9 +395,9 @@ PRIVATE void FatalProblem PARAMS((int sig));
 #if defined(USE_HASH)
     char *lynx_lss_file=NULL;
 #endif
-    
+
 #ifdef __DJGPP__
-void  reset_break() 
+void  reset_break()
 {
     PDC_set_ctrl_break(init_ctrl_break[0]);
 }
@@ -576,7 +576,7 @@ else {init_ctrl_break[0] = 1;}
 
     LYShowColor = (SHOW_COLOR ? SHOW_COLOR_ON : SHOW_COLOR_OFF);
     /*
-     *  Set up the argument list.
+     *	Set up the argument list.
      */
     pgm = argv[0];
     if ((cp = strrchr(pgm, '/')) != NULL) {
@@ -584,7 +584,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Act on -help NOW, so we only output the help and exit. - FM
+     *	Act on -help NOW, so we only output the help and exit. - FM
      */
     for (i = 1; i < argc; i++) {
 	if (strncmp(argv[i], "-help", 5) == 0) {
@@ -600,35 +600,35 @@ else {init_ctrl_break[0] = 1;}
     atexit(LYLeaks);
 #endif /* LY_FIND_LEAKS */
     /*
-     *  Register the function which will free our allocated globals.
+     *	Register the function which will free our allocated globals.
      */
     atexit(free_lynx_globals);
 
 #ifdef LOCALE
     /*
-     *  LOCALE support for international characters.
+     *	LOCALE support for international characters.
      */
     setlocale(LC_ALL, "");
 #endif /* LOCALE */
 
     /*
-     *  Initialize our startup and global variables.
+     *	Initialize our startup and global variables.
      */
 #ifdef ULTRIX
     /*
-     *  Need this for Ultrix.
+     *	Need this for Ultrix.
      */
     terminal = getenv("TERM");
     if ((terminal == NULL) || !strncasecomp(terminal, "xterm", 5))
 	terminal = "vt100";
 #endif /* ULTRIX */
     /*
-     *  Zero the links and history struct arrays.
+     *	Zero the links and history struct arrays.
      */
     memset((void *)links, 0, sizeof(linkstruct)*MAXLINKS);
     memset((void *)history, 0, sizeof(histstruct)*MAXHIST);
     /*
-     *  Zero the MultiBookmark arrays.
+     *	Zero the MultiBookmark arrays.
      */
     memset((void *)MBM_A_subbookmark, 0, sizeof(char)*(MBM_V_MAXFILES+1));
     memset((void *)MBM_A_subdescript, 0, sizeof(char)*(MBM_V_MAXFILES+1));
@@ -638,9 +638,9 @@ else {init_ctrl_break[0] = 1;}
 #endif /* SYSLOG_REQUESTED_URLS */
     StrAllocCopy(list_format, LIST_FORMAT);
 #endif /* !VMS */
-    InfoSecs    = (int)INFOSECS;
+    InfoSecs	= (int)INFOSECS;
     MessageSecs = (int)MESSAGESECS;
-    AlertSecs   = (int)ALERTSECS;
+    AlertSecs	= (int)ALERTSECS;
     StrAllocCopy(helpfile, HELPFILE);
     StrAllocCopy(startfile, STARTFILE);
     LYTrimHead(startfile);
@@ -770,7 +770,7 @@ else {init_ctrl_break[0] = 1;}
     StrAllocCopy(URLDomainSuffixes, URL_DOMAIN_SUFFIXES);
     StrAllocCopy(XLoadImageCommand, XLOADIMAGE_COMMAND);
     /*
-     *  Set up the compilation default character set. - FM
+     *	Set up the compilation default character set. - FM
      */
     for (i = 0; LYchar_set_names[i]; i++) {
 	if (!strncmp(CHARACTER_SET, LYchar_set_names[i],
@@ -784,19 +784,19 @@ else {init_ctrl_break[0] = 1;}
     HTMLSetRawModeDefault(i);
 
     /*
-     *  Disable news posting if the compilation-based
-     *  LYNewsPosting value is FALSE.  This may be changed
-     *  further down via lynx.cfg or the -restriction
-     *  command line switch. - FM
+     *	Disable news posting if the compilation-based
+     *	LYNewsPosting value is FALSE.  This may be changed
+     *	further down via lynx.cfg or the -restriction
+     *	command line switch. - FM
      */
     no_newspost = (LYNewsPosting == FALSE);
 
     /*
-     *  Set up trace, the anonymous account defaults,
-     *  validate restrictions, and/or the nosocks flag,
-     *  if requested, and an alternate configuration
-     *  file, if specified, NOW.  Also, if we only want
-     *  the help menu, output that and exit. - FM
+     *	Set up trace, the anonymous account defaults,
+     *	validate restrictions, and/or the nosocks flag,
+     *	if requested, and an alternate configuration
+     *	file, if specified, NOW.  Also, if we only want
+     *	the help menu, output that and exit. - FM
      */
     for (i = 1; i < argc; i++) {
 	if (strncmp(argv[i], "-trace", 6) == 0) {
@@ -813,7 +813,7 @@ else {init_ctrl_break[0] = 1;}
 	    anon_restrictions_set = TRUE;
 	} else if (strcmp(argv[i], "-validate") == 0) {
 	    /*
-	     *  Follow only http URLs.
+	     *	Follow only http URLs.
 	     */
 	    LYValidate = TRUE;
 #ifdef SOCKS
@@ -844,19 +844,19 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  If we have a lone "-" switch for getting arguments from stdin,
-     *  get them NOW, and act on the relevant ones, saving the others
-     *  into an HTList for handling after the other initializations.
-     *  The primary purpose of this feature is to allow for the
-     *  potentially very long command line that can be associated with
-     *  post or get data.  The original implementation required that
-     *  the lone "-" be the only command line argument, but that
-     *  precluded its use when the lynx command is aliased with other
-     *  arguments.  When interactive, the stdin input is terminated by
-     *  by Control-D on Unix or Control-Z on VMS, and each argument
-     *  is terminated by a RETURN.  When the argument is -get_data or
-     *  -post_data, the data are terminate by a "___" string, alone
-     *  on the line (also terminated by RETURN). - FM
+     *	If we have a lone "-" switch for getting arguments from stdin,
+     *	get them NOW, and act on the relevant ones, saving the others
+     *	into an HTList for handling after the other initializations.
+     *	The primary purpose of this feature is to allow for the
+     *	potentially very long command line that can be associated with
+     *	post or get data.  The original implementation required that
+     *	the lone "-" be the only command line argument, but that
+     *	precluded its use when the lynx command is aliased with other
+     *	arguments.  When interactive, the stdin input is terminated by
+     *	by Control-D on Unix or Control-Z on VMS, and each argument
+     *	is terminated by a RETURN.  When the argument is -get_data or
+     *	-post_data, the data are terminate by a "___" string, alone
+     *	on the line (also terminated by RETURN). - FM
      */
     for (i = 1; i < argc; i++) {
 	if (strcmp(argv[i], "-") == 0) {
@@ -955,7 +955,7 @@ else {init_ctrl_break[0] = 1;}
 		    int j2;
 
 		    /*
-		     *  Strip line terminators.
+		     *	Strip line terminators.
 		     */
 		    for (j2 = strlen(buf) - 1; j2 >= 0 &&
 			 (buf[j2] == CR || buf[j2] == LF); j2--) {
@@ -985,7 +985,7 @@ else {init_ctrl_break[0] = 1;}
 		post_data = &form_post_data;
 
 		/*
-		 *  Build post data for later.  Stop reading when we see
+		 *  Build post data for later.	Stop reading when we see
 		 *  a line with "---" as its first three characters.
 		 */
 		while (fgets(buf, sizeof(buf), stdin) &&
@@ -1020,8 +1020,8 @@ else {init_ctrl_break[0] = 1;}
 #endif /* SOCKS */
 
     /*
-     *  If we had -validate set all of the restrictions
-     *  and disallow a TRACE log NOW. - FM
+     *	If we had -validate set all of the restrictions
+     *	and disallow a TRACE log NOW. - FM
      */
     if (LYValidate == TRUE) {
 	parse_restrictions("all");
@@ -1029,10 +1029,10 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  If we didn't get and act on a -validate or -anonymous
-     *  switch, but can verify that this is the anonymous account,
-     *  set the default restrictions for that account and disallow
-     *  a TRACE log NOW. - FM
+     *	If we didn't get and act on a -validate or -anonymous
+     *	switch, but can verify that this is the anonymous account,
+     *	set the default restrictions for that account and disallow
+     *	a TRACE log NOW. - FM
      */
     if (!LYValidate && !anon_restrictions_set &&
 	strlen((char *)ANONYMOUS_USER) > 0 &&
@@ -1052,7 +1052,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Set up the TRACE log path, and logging if appropriate. - FM
+     *	Set up the TRACE log path, and logging if appropriate. - FM
      */
 #ifdef VMS
     StrAllocCopy(LYTraceLogPath, "sys$login:Lynx.trace");
@@ -1090,15 +1090,15 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  If TRACE is on, indicate whether the
-     *  anonymous restrictions are set. - FM
+     *	If TRACE is on, indicate whether the
+     *	anonymous restrictions are set. - FM
      */
     if (TRACE && anon_restrictions_set) {
 	fprintf(stderr, "LYMain: Anonymous restrictions set.\n");
     }
 
     /*
-     *  Set up the default jump file stuff. - FM
+     *	Set up the default jump file stuff. - FM
      */
     StrAllocCopy(jumpprompt, JUMP_PROMPT);
 #ifdef JUMPFILE
@@ -1119,8 +1119,8 @@ else {init_ctrl_break[0] = 1;}
 #endif /* JUMPFILE */
 
     /*
-     *  If no alternate configuration file was specified on
-     *  the command line, see if it's in the environment.
+     *	If no alternate configuration file was specified on
+     *	the command line, see if it's in the environment.
      */
     if (!lynx_cfg_file) {
 	if (((cp=getenv("LYNX_CFG")) != NULL) ||
@@ -1129,14 +1129,14 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  If we still don't have a configuration file,
-     *  use the userdefs.h definition.
+     *	If we still don't have a configuration file,
+     *	use the userdefs.h definition.
      */
     if (!lynx_cfg_file)
 	StrAllocCopy(lynx_cfg_file, LYNX_CFG_FILE);
 
     /*
-     *  Convert a '~' in the configuration file path to $HOME.
+     *	Convert a '~' in the configuration file path to $HOME.
      */
 #ifndef _WINDOWS /* avoid the whole ~ thing for now */
    /* I think this should only be performed if lynx_cfg_file starts with ~/ */
@@ -1154,8 +1154,8 @@ else {init_ctrl_break[0] = 1;}
 #endif
 
     /*
-     *  If the configuration file is not available,
-     *  inform the user and exit.
+     *	If the configuration file is not available,
+     *	inform the user and exit.
      */
     if ((fp = fopen(lynx_cfg_file, "r")) == NULL) {
 	fprintf(stderr, "\nConfiguration file %s is not available.\n\n",
@@ -1166,7 +1166,7 @@ else {init_ctrl_break[0] = 1;}
 
     /*
      * Make sure we have the character sets declared.
-     *  This will initialize the CHARTRANS handling. - KW
+     *	This will initialize the CHARTRANS handling. - KW
      */
     if (!LYCharSetsDeclared()) {
 	fprintf(stderr, "\nLynx character sets not declared.\n\n");
@@ -1175,8 +1175,8 @@ else {init_ctrl_break[0] = 1;}
 
 #if defined(USE_HASH)
     /*
-     *  If no alternate lynx-style file was specified on
-     *  the command line, see if it's in the environment.
+     *	If no alternate lynx-style file was specified on
+     *	the command line, see if it's in the environment.
      */
     if (!lynx_lss_file) {
 	if (((cp=getenv("LYNX_LSS")) != NULL) ||
@@ -1185,14 +1185,14 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  If we still don't have a lynx-style file,
-     *  use the userdefs.h definition.
+     *	If we still don't have a lynx-style file,
+     *	use the userdefs.h definition.
      */
     if (!lynx_lss_file)
 	StrAllocCopy(lynx_lss_file, LYNX_LSS_FILE);
 
     /*
-     *  Convert a '~' in the lynx-style file path to $HOME.
+     *	Convert a '~' in the lynx-style file path to $HOME.
      */
     if ((cp = strchr(lynx_lss_file, '~'))) {
 	*(cp++) = '\0';
@@ -1209,8 +1209,8 @@ else {init_ctrl_break[0] = 1;}
 	FREE(temp);
     }
     /*
-     *  If the lynx-style file is not available,
-     *  inform the user and exit.
+     *	If the lynx-style file is not available,
+     *	inform the user and exit.
      */
     if ((fp = fopen(lynx_lss_file, "r")) == NULL) {
 	fprintf(stderr, "\nLynxile file %s is not available.\n\n",
@@ -1224,7 +1224,7 @@ else {init_ctrl_break[0] = 1;}
 #endif
 
     /*
-     *  Make sure we have the edit map declared. - FM
+     *	Make sure we have the edit map declared. - FM
      */
     if (!LYEditmapDeclared()) {
 	fprintf(stderr, "\nLynx edit map not declared.\n\n");
@@ -1233,13 +1233,13 @@ else {init_ctrl_break[0] = 1;}
 
 #if USE_COLOR_TABLE
     /*
-     *  Set up default foreground and background colors.
+     *	Set up default foreground and background colors.
      */
     lynx_setup_colors();
 #endif /* USE_SLANG */
 
     /*
-     *  Set the compilation default signature file. - FM
+     *	Set the compilation default signature file. - FM
      */
     strcpy(filename, LYNX_SIG_FILE);
     if (LYPathOffHomeOK(filename, sizeof(filename))) {
@@ -1255,7 +1255,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Process the configuration file.
+     *	Process the configuration file.
      */
     if (TRACE) {
 	fprintf(stderr,
@@ -1267,15 +1267,15 @@ else {init_ctrl_break[0] = 1;}
     HTSwitchDTD(New_DTD);
 
     /*
-     *  Check for a save space path in the environment.
-     *  If one was set in the configuration file, that
-     *  one will be overridden. - FM
+     *	Check for a save space path in the environment.
+     *	If one was set in the configuration file, that
+     *	one will be overridden. - FM
      */
     if ((cp=getenv("LYNX_SAVE_SPACE")) != NULL)
 	StrAllocCopy(lynx_save_space, cp);
 
     /*
-     *  We have a save space path, make sure it's valid. - FM
+     *	We have a save space path, make sure it's valid. - FM
      */
     if (lynx_save_space && *lynx_save_space == '\0') {
 	FREE(lynx_save_space);
@@ -1328,17 +1328,17 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Set up the file extension and mime type maps from
-     *  src/HTInit.c and the global and personal mime.types
-     *  and mailcap files.  These will override any SUFFIX
-     *  or VIEWER maps in userdefs.h or the configuration
-     *  file, if they overlap.
+     *	Set up the file extension and mime type maps from
+     *	src/HTInit.c and the global and personal mime.types
+     *	and mailcap files.  These will override any SUFFIX
+     *	or VIEWER maps in userdefs.h or the configuration
+     *	file, if they overlap.
      */
     HTFormatInit();
     HTFileInit();
 
     /*
-     *  Get WWW_HOME environment variable if it exists.
+     *	Get WWW_HOME environment variable if it exists.
      */
     if ((cp = getenv("WWW_HOME")) != NULL) {
 	StrAllocCopy(startfile, cp);
@@ -1346,11 +1346,11 @@ else {init_ctrl_break[0] = 1;}
 	if (!strncasecomp(startfile, "lynxexec:", 9) ||
 	    !strncasecomp(startfile, "lynxprog:", 9)) {
 	    /*
-	     *  The original implementations of these schemes expected
-	     *  white space without hex escaping, and did not check
-	     *  for hex escaping, so we'll continue to support that,
-	     *  until that code is redone in conformance with SGML
-	     *  principles.  - FM
+	     *	The original implementations of these schemes expected
+	     *	white space without hex escaping, and did not check
+	     *	for hex escaping, so we'll continue to support that,
+	     *	until that code is redone in conformance with SGML
+	     *	principles.  - FM
 	     */
 	    HTUnEscapeSome(startfile, " \r\n\t");
 	    convert_to_spaces(startfile, TRUE);
@@ -1358,24 +1358,24 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Set the LynxHome URL.  If it's a file URL and the
-     *  host is defaulted, force in "//localhost", and if
-     *  it's not an absolute URL, make it one. - FM
+     *	Set the LynxHome URL.  If it's a file URL and the
+     *	host is defaulted, force in "//localhost", and if
+     *	it's not an absolute URL, make it one. - FM
      */
     StrAllocCopy(LynxHome, startfile);
     LYFillLocalFileURL((char **)&LynxHome, "file://localhost");
     LYEnsureAbsoluteURL((char **)&LynxHome, "LynxHome");
 
     /*
-     *  Process any command line arguments not already handled. - FM
+     *	Process any command line arguments not already handled. - FM
      */
     for (i = 1; i < argc; i++) {
 	parse_arg(&argv[i], &i, argc);
     }
 
     /*
-     *  Process any stdin-derived arguments for a lone "-"  which we've
-     *  loaded into LYStdinArgs. - FM
+     *	Process any stdin-derived arguments for a lone "-"  which we've
+     *	loaded into LYStdinArgs. - FM
      */
     if (LYStdinArgs != NULL) {
 	char *my_args[2];
@@ -1399,7 +1399,7 @@ else {init_ctrl_break[0] = 1;}
 #endif /* !VMS */
 
     /*
-     *  Process the RC file.
+     *	Process the RC file.
      */
     read_rc();
 
@@ -1441,7 +1441,7 @@ else {init_ctrl_break[0] = 1;}
 	set_numbers_as_arrows();
 
     /*
-     *  Check the -popup command line toggle. - FM
+     *	Check the -popup command line toggle. - FM
      */
     if (LYUseDefSelPop == FALSE) {
 	if (LYSelectPopups == TRUE)
@@ -1451,7 +1451,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Check the -show_cursor command line toggle. - FM
+     *	Check the -show_cursor command line toggle. - FM
      */
     if (LYUseDefShoCur == FALSE) {
 	if (LYShowCursor == TRUE)
@@ -1461,17 +1461,17 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Check the -base command line switch with -source. - FM
+     *	Check the -base command line switch with -source. - FM
      */
     if (LYPrependBase && HTOutputFormat == HTAtom_for("www/download")) {
 	LYPrependBaseToSource = TRUE;
     }
 
     /*
-     *  Disable multiple bookmark support if not interactive,
-     *  so it doesn't crash on curses functions, or if the
-     *  support was blocked via userdefs.h and/or lynx.cfg,
-     *  or via command line restrictions. - FM
+     *	Disable multiple bookmark support if not interactive,
+     *	so it doesn't crash on curses functions, or if the
+     *	support was blocked via userdefs.h and/or lynx.cfg,
+     *	or via command line restrictions. - FM
      */
     if (no_multibook)
 	LYMBMBlocked = TRUE;
@@ -1520,23 +1520,23 @@ else {init_ctrl_break[0] = 1;}
 #endif /* !VMS */
 
     /*
-     *  Set up the proper character set with the desired
-     *  startup raw 8-bit or CJK mode handling.  - FM
+     *	Set up the proper character set with the desired
+     *	startup raw 8-bit or CJK mode handling.  - FM
      */
     HTMLUseCharacterSet(current_char_set);
 
     /*
-     *  If startfile is a file URL and the host is defaulted,
-     *  force in "//localhost", and if it's not an absolute URL,
-     *  make it one. - FM
+     *	If startfile is a file URL and the host is defaulted,
+     *	force in "//localhost", and if it's not an absolute URL,
+     *	make it one. - FM
      */
     LYFillLocalFileURL((char **)&startfile, "file://localhost");
     LYEnsureAbsoluteURL((char **)&startfile, "STARTFILE");
 
     /*
-     *  If homepage was specified and is a file URL with the
-     *  host defaulted, force in "//localhost", and if it's
-     *  not an absolute URL, make it one. - FM
+     *	If homepage was specified and is a file URL with the
+     *	host defaulted, force in "//localhost", and if it's
+     *	not an absolute URL, make it one. - FM
      */
     if (homepage) {
 	LYFillLocalFileURL((char **)&homepage, "file://localhost");
@@ -1544,9 +1544,9 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  If we don't have a homepage specified,
-     *  set it to startfile.  Otherwise, reset
-     *  LynxHome. - FM
+     *	If we don't have a homepage specified,
+     *	set it to startfile.  Otherwise, reset
+     *	LynxHome. - FM
      */
     if (!(homepage && *homepage)) {
 	StrAllocCopy(homepage, startfile);
@@ -1555,7 +1555,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Set up the inside/outside domain restriction flags. - FM
+     *	Set up the inside/outside domain restriction flags. - FM
      */
     if (inlocaldomain()) {
 #if !defined(HAVE_UTMP) || defined(VMS) /* not selective */
@@ -1582,14 +1582,14 @@ else {init_ctrl_break[0] = 1;}
 
 #ifdef SIGTSTP
     /*
-     *  Block Control-Z suspending if requested. - FM
+     *	Block Control-Z suspending if requested. - FM
      */
     if (no_suspend)
 	(void) signal(SIGTSTP,SIG_IGN);
 #endif /* SIGTSTP */
 
     /*
-     *  Check for a valid HEAD request. - FM
+     *	Check for a valid HEAD request. - FM
      */
     if (HEAD_request && LYCanDoHEAD(startfile) != TRUE) {
 	fprintf(stderr,
@@ -1610,7 +1610,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Check for a valid MIME headers request. - FM
+     *	Check for a valid MIME headers request. - FM
      */
     if (keep_mime_headers && LYCanDoHEAD(startfile) != TRUE) {
 	fprintf(stderr,
@@ -1631,7 +1631,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Check for a valid traversal request. - FM
+     *	Check for a valid traversal request. - FM
      */
     if (traversal && strncmp(startfile, "http", 4)) {
 	fprintf(stderr,
@@ -1652,21 +1652,21 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Set up our help and about file base paths. - FM
+     *	Set up our help and about file base paths. - FM
      */
     StrAllocCopy(helpfilepath, helpfile);
     if ((cp=strrchr(helpfilepath, '/')) != NULL)
 	*cp = '\0';
     /*
-     *  Remove code to merge the historical about_lynx
-     *  directory into lynx_help. - HN
+     *	Remove code to merge the historical about_lynx
+     *	directory into lynx_help. - HN
      */
     StrAllocCat(helpfilepath, "/");
 
 
     /*
-     *  Make sure our bookmark default strings
-     *  are all allocated and synchronized. - FM
+     *	Make sure our bookmark default strings
+     *	are all allocated and synchronized. - FM
      */
     if (!bookmark_page || *bookmark_page == '\0') {
 	StrAllocCopy(bookmark_page, "lynx_bookmarks");
@@ -1682,7 +1682,7 @@ else {init_ctrl_break[0] = 1;}
     }
 
     /*
-     *  Here's where we do all the work.
+     *	Here's where we do all the work.
      */
     if (dump_output_immediately) {
 	/*
@@ -1791,7 +1791,7 @@ PRIVATE void parse_arg ARGS3(
 #define nextarg ((cp=scan3D(&argv[0], i))!=NULL)
 
     /*
-     *  Check for a command line startfile. - FM
+     *	Check for a command line startfile. - FM
      */
     if (argv[0][0] != '-') {
 	StrAllocCopy(startfile, argv[0]);
@@ -1799,11 +1799,11 @@ PRIVATE void parse_arg ARGS3(
 	if (!strncasecomp(startfile, "lynxexec:", 9) ||
 	    !strncasecomp(startfile, "lynxprog:", 9)) {
 	    /*
-	     *  The original implementations of these schemes expected
-	     *  white space without hex escaping, and did not check
-	     *  for hex escaping, so we'll continue to support that,
-	     *  until that code is redone in conformance with SGML
-	     *  principles.  - FM
+	     *	The original implementations of these schemes expected
+	     *	white space without hex escaping, and did not check
+	     *	for hex escaping, so we'll continue to support that,
+	     *	until that code is redone in conformance with SGML
+	     *	principles.  - FM
 	     */
 	    HTUnEscapeSome(startfile, " \r\n\t");
 	    convert_to_spaces(startfile, TRUE);
@@ -1812,9 +1812,9 @@ PRIVATE void parse_arg ARGS3(
     }
 
     /*
-     *  Skip any lone "-" arguments, because we've loaded
-     *  the stdin input into an HTList structure for
-     *  special handling. - FM
+     *	Skip any lone "-" arguments, because we've loaded
+     *	the stdin input into an HTList structure for
+     *	special handling. - FM
      */
     if (strcmp(argv[0], "-") == 0) {
 	return;
@@ -2244,7 +2244,7 @@ PRIVATE void parse_arg ARGS3(
 	     HTAtom_for("www/download") : HTAtom_for("www/dump"));
 	LYcols=999;
 
-    } else if (strncmp(argv[0], "-minimal", 11) == 0) {
+    } else if (strncmp(argv[0], "-minimal", 8) == 0) {
 	if (minimal_comments)
 	    minimal_comments = FALSE;
 	else
@@ -2332,7 +2332,7 @@ PRIVATE void parse_arg ARGS3(
     } else if (strncmp(argv[0], "-nostatus", 9) == 0)	{
 	no_statusline = TRUE;
 
-    } else if (strncmp(argv[0], "-number_links", 9) == 0) {
+    } else if (strncmp(argv[0], "-number_links", 13) == 0) {
 	number_links = TRUE;
 
     } else {
@@ -2391,7 +2391,7 @@ PRIVATE void parse_arg ARGS3(
 	post_data = &form_post_data;
 
 	/*
-	 *  Build post data for later.  Stop reading when we see a line
+	 *  Build post data for later.	Stop reading when we see a line
 	 *  with "---" as its first three characters.
 	 */
 	while (fgets(buf, sizeof(buf), stdin) &&
@@ -2435,101 +2435,91 @@ PRIVATE void parse_arg ARGS3(
     } else if (strncmp(argv[0], "-restrictions", 13) == 0) {
 	if ((cp=strchr(argv[0],'=')) != NULL)
 	    parse_restrictions(cp+1);
-	else
-	    {
-		/* print help */
-		printf("\n\
-   USAGE: lynx -restrictions=[option][,option][,option]\n\
-   List of Options:\n\
-   all             restricts all options.\n");
-		printf("\
-   bookmark        disallow changing the location of the bookmark file.\n\
-   bookmark_exec   disallow execution links via the bookmark file\n");
+	else {
+		static CONST char *Usage[] = {
+ ""
+,"   USAGE: lynx -restrictions=[option][,option][,option]"
+,"   List of Options:"
+,"   all             restricts all options."
+,"   bookmark        disallow changing the location of the bookmark file."
+,"   bookmark_exec   disallow execution links via the bookmark file"
 #if defined(DIRED_SUPPORT) && defined(OK_PERMIT)
-		printf("\
-   change_exec_perms  disallow changing the eXecute permission on files\n\
-                   (but still allow it for directories) when local file\n\
-                   management is enabled.\n");
+,"   change_exec_perms  disallow changing the eXecute permission on files"
+,"                   (but still allow it for directories) when local file"
+,"                   management is enabled."
 #endif /* DIRED_SUPPORT && OK_PERMIT */
-		printf("\
-   default         same as commandline option -anonymous.  Disables\n\
-                   default services for anonymous users.  Currently set to,\n\
-                   all restricted except for: inside_telnet, outside_telnet,\n\
-                   inside_news, inside_ftp, outside_ftp, inside_rlogin,\n\
-                   outside_rlogin, goto, jump and mail.  Defaults\n\
-                   are settable within userdefs.h\n");
+,"   default         same as commandline option -anonymous.  Disables"
+,"                   default services for anonymous users.  Currently set to,"
+,"                   all restricted except for: inside_telnet, outside_telnet,"
+,"                   inside_news, inside_ftp, outside_ftp, inside_rlogin,"
+,"                   outside_rlogin, goto, jump and mail.  Defaults"
+,"                   are settable within userdefs.h"
 #ifdef DIRED_SUPPORT
-		printf("\
-   dired_support   disallow local file management\n");
+,"   dired_support   disallow local file management"
 #endif /* DIRED_SUPPORT */
-		printf("\
-   disk_save       disallow saving to disk in the download and print menus\n\
-   dotfiles        disallow access to, or creation of, hidden (dot) files\n\
-   download        disallow downloaders in the download menu\n\
-   editor          disallow editing\n\
-   exec            disable execution scripts\n\
-   exec_frozen     disallow the user from changing the execution link\n");
+,"   disk_save       disallow saving to disk in the download and print menus"
+,"   dotfiles        disallow access to, or creation of, hidden (dot) files"
+,"   download        disallow downloaders in the download menu"
+,"   editor          disallow editing"
+,"   exec            disable execution scripts"
+,"   exec_frozen     disallow the user from changing the execution link"
 #ifdef USE_EXTERNALS
-		printf("\
-   externals       disable passing URLs to external programs\n");
+,"   externals       disable passing URLs to external programs"
 #endif
-		printf("\
-   file_url        disallow using G)oto, served links or bookmarks for\n\
-                   file: URL's\n\
-   goto            disable the 'g' (goto) command\n");
+,"   file_url        disallow using G)oto, served links or bookmarks for"
+,"                   file: URL's"
+,"   goto            disable the 'g' (goto) command"
 #if !defined(HAVE_UTMP) || defined(VMS) /* not selective */
-		printf("\
-   inside_ftp      disallow ftps for people coming from inside your\n\
-                   domain (utmp required for selectivity)\n\
-   inside_news     disallow USENET news posting for people coming from\n\
-                   inside your domain (utmp required for selectivity)\n\
-   inside_rlogin   disallow rlogins for people coming from inside your\n\
-                   domain (utmp required for selectivity)\n\
-   inside_telnet   disallow telnets for people coming from inside your\n\
-                   domain (utmp required for selectivity)\n");
+,"   inside_ftp      disallow ftps for people coming from inside your"
+,"                   domain (utmp required for selectivity)"
+,"   inside_news     disallow USENET news posting for people coming from"
+,"                   inside your domain (utmp required for selectivity)"
+,"   inside_rlogin   disallow rlogins for people coming from inside your"
+,"                   domain (utmp required for selectivity)"
+,"   inside_telnet   disallow telnets for people coming from inside your"
+,"                   domain (utmp required for selectivity)"
 #else
-		printf("\
-   inside_ftp      disallow ftps for people coming from inside your domain\n\
-   inside_news     disallow USENET news posting for people coming from inside\n\
-                   your domain\n\
-   inside_rlogin   disallow rlogins for people coming from inside your domain\n\
-   inside_telnet   disallow telnets for people coming from inside your domain\n");
+,"   inside_ftp      disallow ftps for people coming from inside your domain"
+,"   inside_news     disallow USENET news posting for people coming from inside"
+,"                   your domain"
+,"   inside_rlogin   disallow rlogins for people coming from inside your domain"
+,"   inside_telnet   disallow telnets for people coming from inside your domain"
 #endif /* HAVE_UTMP || VMS */
-		printf("\
-   jump            disable the 'j' (jump) command\n\
-   mail            disallow mail\n\
-   multibook       disallow multiple bookmark files\n\
-   news_post       disallow USENET News posting.\n\
-   option_save     disallow saving options in .lynxrc\n");
+,"   jump            disable the 'j' (jump) command"
+,"   mail            disallow mail"
+,"   multibook       disallow multiple bookmark files"
+,"   news_post       disallow USENET News posting."
+,"   option_save     disallow saving options in .lynxrc"
 #if !defined(HAVE_UTMP) || defined(VMS) /* not selective */
-		printf("\
-   outside_ftp     disallow ftps for people coming from outside your\n\
-                   domain (utmp required for selectivity)\n\
-   outside_news    disallow USENET news posting for people coming from\n\
-                   outside your domain (utmp required for selectivity)\n\
-   outside_rlogin  disallow rlogins for people coming from outside your\n\
-                   domain (utmp required for selectivity)\n\
-   outside_telnet  disallow telnets for people coming from outside your\n\
-                   domain (utmp required for selectivity)\n");
+,"   outside_ftp     disallow ftps for people coming from outside your"
+,"                   domain (utmp required for selectivity)"
+,"   outside_news    disallow USENET news posting for people coming from"
+,"                   outside your domain (utmp required for selectivity)"
+,"   outside_rlogin  disallow rlogins for people coming from outside your"
+,"                   domain (utmp required for selectivity)"
+,"   outside_telnet  disallow telnets for people coming from outside your"
+,"                   domain (utmp required for selectivity)"
 #else
-		printf("\
-   outside_ftp     disallow ftps for people coming from outside your domain\n\
-   outside_news    disallow USENET news posting for people coming from outside\n\
-                   your domain\n\
-   outside_rlogin  disallow rlogins for people coming from outside your domain\n\
-   outside_telnet  disallow telnets for people coming from outside your domain\n");
+,"   outside_ftp     disallow ftps for people coming from outside your domain"
+,"   outside_news    disallow USENET news posting for people coming from outside"
+,"                   your domain"
+,"   outside_rlogin  disallow rlogins for people coming from outside your domain"
+,"   outside_telnet  disallow telnets for people coming from outside your domain"
 #endif /* !HAVE_UTMP || VMS */
-		printf("\
-   print           disallow most print options\n\
-   shell           disallow shell escapes, and lynxexec, lynxprog or lynxcgi\n\
-                   G)oto's\n\
-   suspend         disallow Control-Z suspends with escape to shell\n\
-   telnet_port     disallow specifying a port in telnet G)oto's\n\
-   useragent       disallow modifications of the User-Agent header\n");
+,"   print           disallow most print options"
+,"   shell           disallow shell escapes, and lynxexec, lynxprog or lynxcgi"
+,"                   G)oto's"
+,"   suspend         disallow Control-Z suspends with escape to shell"
+,"   telnet_port     disallow specifying a port in telnet G)oto's"
+,"   useragent       disallow modifications of the User-Agent header"
+		};
+		size_t n;
+		for (n = 0; n < sizeof(Usage)/sizeof(Usage[0]); n++)
+			printf("%s\n", Usage[n]);
 		exit(0);
 	    }
 
-    } else if (strncmp(argv[0], "-resubmit_posts", 14) == 0) {
+    } else if (strncmp(argv[0], "-resubmit_posts", 15) == 0) {
 	if (LYresubmit_posts)
 	    LYresubmit_posts = FALSE;
 	else
@@ -2615,12 +2605,19 @@ PRIVATE void parse_arg ARGS3(
     break;
 
     case 'u':
-    if (strncmp(argv[0], "-underscore", 15) == 0) {
+    if (strncmp(argv[0], "-underscore", 11) == 0) {
 	if (use_underscore)
 	    use_underscore = FALSE;
 	else
 	    use_underscore = TRUE;
 
+    } else if (strncmp(argv[0], "-useragent", 10) == 0) {
+      /*
+       *  Set alternate Lynx User-Agent header.
+       */
+      if (nextarg)
+	  StrAllocCopy(LYUserAgent, cp);
+
 #if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE)
     } else if (strncmp(argv[0], "-use_mouse", 9) == 0) {
 	LYUseMouse = TRUE;
@@ -2690,128 +2687,136 @@ Output_Help_List:
 #else
     printf("USAGE: %s [options] [file]\n",pgm);
 #endif /* VMS */
-    printf("Options are:\n");
-    printf("    -                receive the arguments from stdin (enclose\n");
-    printf("                     in double-quotes (\"-\") on VMS)\n");
-    printf("    -anonymous       used to specify the anonymous account\n");
-    printf("    -assume_charset=MIMEname  charset for documents that don't specify it\n");
-    printf("    -assume_local_charset=MIMEname  charset assumed for local files\n");
-    printf("    -assume_unrec_charset=MIMEname  use this instead of unrecognized charsets\n");
-    printf("    -auth=id:pw      authentication information for protected documents\n");
-    printf("    -base            prepend a request URL comment and BASE tag to text/html\n");
-    printf("                     outputs for -source dumps\n");
-    printf("    -book            use the bookmark page as the startfile\n");
-    printf("    -buried_news     toggles scanning of news articles for buried references\n");
-    printf("    -cache=NUMBER    NUMBER of documents cached in memory (default is %d)\n",DEFAULT_CACHE_SIZE);
-    printf("    -case            enable case sensitive user searching\n");
-    printf("    -cfg=FILENAME    specifies a lynx.cfg file other than the default\n");
-    printf("    -child           exit on left-arrow in startfile, and disable save to disk\n");
+    {
+	static CONST char *Options[] = {
+ "Options are:"
+,"    -                receive the arguments from stdin (enclose"
+,"                     in double-quotes (\"-\") on VMS)"
+,"    -anonymous       used to specify the anonymous account"
+,"    -assume_charset=MIMEname  charset for documents that don't specify it"
+,"    -assume_local_charset=MIMEname  charset assumed for local files"
+,"    -assume_unrec_charset=MIMEname  use this instead of unrecognized charsets"
+,"    -auth=id:pw      authentication information for protected documents"
+,"    -base            prepend a request URL comment and BASE tag to text/html"
+,"                     outputs for -source dumps"
+,"    -book            use the bookmark page as the startfile"
+,"    -buried_news     toggles scanning of news articles for buried references"
+,"    -cache=NUMBER    NUMBER of documents cached in memory"
+,"    -case            enable case sensitive user searching"
+,"    -cfg=FILENAME    specifies a lynx.cfg file other than the default"
+,"    -child           exit on left-arrow in startfile, and disable save to disk"
 #ifdef USE_SLANG
-    printf("    -color           force color mode on with standard bg colors\n");
-    printf("    -blink           force high intensity bg colors in color mode\n");
+,"    -color           force color mode on with standard bg colors"
+,"    -blink           force high intensity bg colors in color mode"
 #endif /* USE_SLANG */
-    printf("    -cookies         toggles handling of Set-Cookie headers\n");
+,"    -cookies         toggles handling of Set-Cookie headers"
 #ifndef VMS
-    printf("    -core            toggles forced core dumps on fatal errors\n");
+,"    -core            toggles forced core dumps on fatal errors"
 #endif /* !VMS */
-    printf("    -crawl           with -traversal, output each page to a file\n");
-    printf("                     with -dump, format output as with -traversal, but to stdout\n");
-    printf("    -display=DISPLAY set the display variable for X execed programs\n");
-    printf("    -dump            dump the first file to stdout and exit\n");
-    printf("    -editor=EDITOR   enable edit mode with specified editor\n");
-    printf("    -emacskeys       enable emacs-like key movement\n");
-    printf("    -enable_scrollback  toggles compatibility with comm programs' scrollback\n");
-    printf("                        keys (may be incompatible with some curses packages)\n");
-    printf("    -error_file=FILE write the HTTP status code here\n");
+,"    -crawl           with -traversal, output each page to a file"
+,"                     with -dump, format output as with -traversal, but to stdout"
+,"    -display=DISPLAY set the display variable for X execed programs"
+,"    -dump            dump the first file to stdout and exit"
+,"    -editor=EDITOR   enable edit mode with specified editor"
+,"    -emacskeys       enable emacs-like key movement"
+,"    -enable_scrollback  toggles compatibility with comm programs' scrollback"
+,"                        keys (may be incompatible with some curses packages)"
+,"    -error_file=FILE write the HTTP status code here"
 #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS)
 #ifndef NEVER_ALLOW_REMOTE_EXEC
-    printf("    -exec            enable local program execution\n");
+,"    -exec            enable local program execution"
 #endif /* !NEVER_ALLOW_REMOTE_EXEC */
-    printf("    -locexec         enable local program execution from local files only\n");
-    printf("    -noexec          disable local program execution (DEFAULT)\n");
+,"    -locexec         enable local program execution from local files only"
+,"    -noexec          disable local program execution (DEFAULT)"
 #endif /* EXEC_LINKS || EXEC_SCRIPTS */
-    printf("    -fileversions    include all versions of files in local VMS directory\n");
-    printf("                     listings\n");
-    printf("    -force_html      forces the first document to be interpreted as HTML\n");
-    printf("    -force_secure    toggles forcing of the secure flag for SSL cookies\n");
-    printf("    -from            toggle transmissions of From headers\n");
-    printf("    -ftp             disable ftp access\n");
-    printf("    -get_data        user data for get forms, read from stdin,\n");
-    printf("                     terminated by '---' on a line\n");
-    printf("    -head            send a HEAD request\n");
-    printf("    -help            print this usage message\n");
-    printf("    -hiddenlinks=[option]  hidden links: options are merge, listonly, or ignore\n");
-    printf("    -historical      toggles use of '>' or '-->' as a terminator for comments\n");
-    printf("    -homepage=URL    set homepage separate from start page\n");
-    printf("    -image_links     toggles inclusion of links for all images\n");
-    printf("    -index=URL       set the default index file to URL\n");
-    printf("    -ismap           toggles inclusion of ISMAP links when client-side\n");
-    printf("                     MAPs are present\n");
-    printf("    -link=NUMBER     starting count for lnk#.dat files produced by -crawl\n");
-    printf("    -localhost       disable URLs that point to remote hosts\n");
+,"    -fileversions    include all versions of files in local VMS directory"
+,"                     listings"
+,"    -force_html      forces the first document to be interpreted as HTML"
+,"    -force_secure    toggles forcing of the secure flag for SSL cookies"
+,"    -from            toggle transmissions of From headers"
+,"    -ftp             disable ftp access"
+,"    -get_data        user data for get forms, read from stdin,"
+,"                     terminated by '---' on a line"
+,"    -head            send a HEAD request"
+,"    -help            print this usage message"
+,"    -hiddenlinks=[option]  hidden links: options are merge, listonly, or ignore"
+,"    -historical      toggles use of '>' or '-->' as a terminator for comments"
+,"    -homepage=URL    set homepage separate from start page"
+,"    -image_links     toggles inclusion of links for all images"
+,"    -index=URL       set the default index file to URL"
+,"    -ismap           toggles inclusion of ISMAP links when client-side"
+,"                     MAPs are present"
+,"    -link=NUMBER     starting count for lnk#.dat files produced by -crawl"
+,"    -localhost       disable URLs that point to remote hosts"
 #if defined(USE_HASH)
-    printf("    -lss=FILENAME    specifies a lynx.css file other than the default\n");
+,"    -lss=FILENAME    specifies a lynx.css file other than the default"
 #endif
-    printf("    -mime_header     include mime headers and force source dump\n");
-    printf("    -minimal         toggles minimal versus valid comment parsing\n");
-    printf("    -newschunksize=NUMBER  number of articles in chunked news listings\n");
-    printf("    -newsmaxchunk=NUMBER   maximum news articles in listings before chunking\n");
-    printf("    -nobrowse        disable directory browsing\n");
-    printf("    -nocc            disable Cc: prompts for self copies of mailings\n");
-    printf("    -nofilereferer   disable transmissions of Referer headers for file URLs\n");
-    printf("    -nolist          disable the link list feature in dumps\n");
-    printf("    -nolog           disable mailing of error messages to document owners\n");
-    printf("    -nopause         disable forced pauses for statusline messages\n");
-    printf("    -noprint         disable print functions\n");
-    printf("    -noredir         don't follow Location: redirection\n");
-    printf("    -noreferer       disable transmissions of Referer headers\n");
+,"    -mime_header     include mime headers and force source dump"
+,"    -minimal         toggles minimal versus valid comment parsing"
+,"    -newschunksize=NUMBER  number of articles in chunked news listings"
+,"    -newsmaxchunk=NUMBER   maximum news articles in listings before chunking"
+,"    -nobrowse        disable directory browsing"
+,"    -nocc            disable Cc: prompts for self copies of mailings"
+,"    -nofilereferer   disable transmissions of Referer headers for file URLs"
+,"    -nolist          disable the link list feature in dumps"
+,"    -nolog           disable mailing of error messages to document owners"
+,"    -nopause         disable forced pauses for statusline messages"
+,"    -noprint         disable print functions"
+,"    -noredir         don't follow Location: redirection"
+,"    -noreferer       disable transmissions of Referer headers"
 #ifdef SOCKS
-    printf("    -nosocks         don't use SOCKS proxy for this session\n");
+,"    -nosocks         don't use SOCKS proxy for this session"
 #endif /* SOCKS */
-    printf("    -nostatus        disable the miscellaneous information messages\n");
-    printf("    -number_links    force numbering of links\n");
-    printf("    -pauth=id:pw     authentication information for protected proxy server\n");
-    printf("    -popup           toggles handling of single-choice SELECT options via\n");
-    printf("                     popup windows or as lists of radio buttons\n");
-    printf("    -post_data       user data for post forms, read from stdin,\n");
-    printf("                     terminated by '---' on a line\n");
-    printf("    -preparsed       show parsed text/html with -source and in source view\n");
-    printf("    -print           enable print functions (DEFAULT)\n");
-    printf("    -pseudo_inlines  toggles pseudo-ALTs for inlines with no ALT string\n");
-    printf("    -raw             toggles default setting of 8-bit character translations\n");
-    printf("                     or CJK mode for the startup character set\n");
-    printf("    -realm           restricts access to URLs in the starting realm\n");
-    printf("    -reload          flushes the cache on a proxy server\n");
-    printf("                     (only the first document affected)\n");
-    printf("    -restrictions=[options]  use -restrictions to see list\n");
-    printf("    -resubmit_posts  toggles forced resubmissions (no-cache) of forms with\n");
-    printf("                     method POST when the documents they returned are sought\n");
-    printf("                     with the PREV_DOC command or from the History List\n");
-    printf("    -rlogin          disable rlogins\n");
-    printf("    -selective       require .www_browsable files to browse directories\n");
-    printf("    -show_cursor     toggles hiding of the cursor in the lower right corner\n");
-    printf("    -soft_dquotes    toggles emulation of the old Netscape and Mosaic bug which\n");
-    printf("                     treated '>' as a co-terminator for double-quotes and tags\n");
-    printf("    -source          dump the source of the first file to stdout and exit\n");
-    printf("    -startfile_ok    allow non-http startfile and homepage with -validate\n");
+,"    -nostatus        disable the miscellaneous information messages"
+,"    -number_links    force numbering of links"
+,"    -pauth=id:pw     authentication information for protected proxy server"
+,"    -popup           toggles handling of single-choice SELECT options via"
+,"                     popup windows or as lists of radio buttons"
+,"    -post_data       user data for post forms, read from stdin,"
+,"                     terminated by '---' on a line"
+,"    -preparsed       show parsed text/html with -source and in source view"
+,"    -print           enable print functions (DEFAULT)"
+,"    -pseudo_inlines  toggles pseudo-ALTs for inlines with no ALT string"
+,"    -raw             toggles default setting of 8-bit character translations"
+,"                     or CJK mode for the startup character set"
+,"    -realm           restricts access to URLs in the starting realm"
+,"    -reload          flushes the cache on a proxy server"
+,"                     (only the first document affected)"
+,"    -restrictions=[options]  use -restrictions to see list"
+,"    -resubmit_posts  toggles forced resubmissions (no-cache) of forms with"
+,"                     method POST when the documents they returned are sought"
+,"                     with the PREV_DOC command or from the History List"
+,"    -rlogin          disable rlogins"
+,"    -selective       require .www_browsable files to browse directories"
+,"    -show_cursor     toggles hiding of the cursor in the lower right corner"
+,"    -soft_dquotes    toggles emulation of the old Netscape and Mosaic bug which"
+,"                     treated '>' as a co-terminator for double-quotes and tags"
+,"    -source          dump the source of the first file to stdout and exit"
+,"    -startfile_ok    allow non-http startfile and homepage with -validate"
 #ifndef VMS
 #ifdef SYSLOG_REQUESTED_URLS
-    printf("    -syslog=text     information for syslog call\n");
+,"    -syslog=text     information for syslog call"
 #endif /* SYSLOG_REQUESTED_URLS */
 #endif /* !VMS */
-    printf("    -telnet          disable telnets\n");
-    printf("    -term=TERM       set terminal type to TERM\n");
-    printf("    -tlog            toggles use of a Lynx Trace Log for the current session\n");
-    printf("    -trace           turns on Lynx trace mode\n");
-    printf("    -traversal       traverse all http links derived from startfile\n");
-    printf("    -underscore      toggles use of _underline_ format in dumps\n");
+,"    -telnet          disable telnets"
+,"    -term=TERM       set terminal type to TERM"
+,"    -tlog            toggles use of a Lynx Trace Log for the current session"
+,"    -trace           turns on Lynx trace mode"
+,"    -traversal       traverse all http links derived from startfile"
+,"    -underscore      toggles use of _underline_ format in dumps"
+,"    -useragent=Name  set alternate Lynx User-Agent header"
 #if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE)
-    printf("    -use_mouse       enable use of the mouse\n");
+,"    -use_mouse       enable use of the mouse"
 #endif
-    printf("    -validate        accept only http URLs (for validation)\n");
-    printf("    -version         print Lynx version information\n");
-    printf("    -vikeys          enable vi-like key movement\n");
-    printf("    -width=NUMBER    screen width for formatting of dumps (default is 80)\n");
+,"    -validate        accept only http URLs (for validation)"
+,"    -version         print Lynx version information"
+,"    -vikeys          enable vi-like key movement"
+,"    -width=NUMBER    screen width for formatting of dumps (default is 80)"
+	};
+	size_t n;
+	for (n = 0; n < sizeof(Options)/sizeof(Options[0]); n++)
+	    printf("%s\n", Options[n]);
+    }
     if (strncmp(argv[0], "-help", 5) != 0)
 	exit(-1);
     exit(0);
@@ -2825,7 +2830,7 @@ PRIVATE void FatalProblem ARGS1(
 	int,		sig)
 {
     /*
-     *  Ignore further interrupts. - mhc: 11/2/91
+     *	Ignore further interrupts. - mhc: 11/2/91
      */
 #ifndef NOSIGHUP
     (void) signal(SIGHUP, SIG_IGN);
@@ -2841,13 +2846,13 @@ PRIVATE void FatalProblem ARGS1(
     (void) signal(SIGILL, SIG_IGN);
 
     /*
-     *  Flush all messages. - FM
+     *	Flush all messages. - FM
      */
     fflush(stderr);
     fflush(stdout);
 
     /*
-     *  Deal with curses, if on, and clean up. - FM
+     *	Deal with curses, if on, and clean up. - FM
      */
     if (LYOutOfMemory && LYCursesON) {
 	sleep(AlertSecs);
@@ -2862,7 +2867,7 @@ PRIVATE void FatalProblem ARGS1(
     signal(SIGILL, SIG_DFL);
 
     /*
-     *  Issue appropriate messages and abort or exit. - FM
+     *	Issue appropriate messages and abort or exit. - FM
      */
     if (LYOutOfMemory == FALSE) {
 	fprintf (stderr, "\r\n\
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 9dfd785c..07faecb7 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -3,6 +3,7 @@
 #include "HTAccess.h"
 #include "HTParse.h"
 #include "HTList.h"
+#include "HTML.h"
 #include "HTFTP.h"
 #include "HTFile.h"
 #include "HTTP.h"
@@ -64,10 +65,13 @@ PRIVATE BOOL confirm_post_resub PARAMS((
     int 		if_imgmap,
     int 		if_file));
 PRIVATE int are_different PARAMS((document *doc1, document *doc2));
-PRIVATE int are_phys_different PARAMS((document *doc1, document *doc2));
 PUBLIC void HTGotoURLs_free NOPARAMS;
 PUBLIC void HTAddGotoURL PARAMS((char *url));
 
+#ifndef DONT_TRACK_INTERNAL_LINKS
+PRIVATE int are_phys_different PARAMS((document *doc1, document *doc2));
+#endif
+
 #define FASTTAB
 #ifdef FASTTAB
 PRIVATE int sametext ARGS2(
@@ -194,7 +198,7 @@ int mainloop NOARGS
  *  newdoc.title   contains the link name that the user last chose to get
  *		     into the current link (file).
  */
-    /* initalize some variables*/
+    /* initialize some variables*/
     newdoc.address = NULL;
     newdoc.title = NULL;
     newdoc.post_data = NULL;
@@ -1234,7 +1238,7 @@ try_again:
 	}
 
 	/*
-	 *  Refresh the screen if neccessary.
+	 *  Refresh the screen if necessary.
 	 */
 	if (refresh_screen) {
 #if defined(FANCY_CURSES) || defined (USE_SLANG)
@@ -1565,7 +1569,7 @@ new_keyboard_input:
 	    /*
 	     *	This is a special feature to traverse every http link
 	     *	derived from startfile and check for errors or create
-	     *	crawl ouput files.  Only URL's that begin with
+	     *	crawl output files.  Only URL's that begin with
 	     *	"traversal_host" are searched - this keeps the search
 	     *	from crossing to other servers (a feature, not a bug!).
 	     */
@@ -1843,7 +1847,7 @@ new_cmd:  /*
 		    if (nlinks > 0 && curdoc.link > -1) {
 			if (curdoc.link == newdoc.link) {
 			    /*
-			     *	It's the current link, and presumeably
+			     *	It's the current link, and presumably
 			     *	reflects a typo in the statusline entry,
 			     *	so issue a statusline message for the
 			     *	typo-prone users (like me 8-). - FM
@@ -3479,7 +3483,7 @@ check_goto_URL:
 
 	    } else if ((no_shell || no_goto_lynxexec
 #ifdef EXEC_LINKS
-	    		|| local_exec_on_local_files
+			|| local_exec_on_local_files
 #endif /* EXEC_LINKS */
 			) &&
 		       !strncmp(user_input_buffer, "lynxexec:",9)) {
@@ -3488,7 +3492,7 @@ check_goto_URL:
 
 	    } else if ((no_shell || no_goto_lynxprog
 #ifdef EXEC_LINKS
-	    		|| local_exec_on_local_files
+			|| local_exec_on_local_files
 #endif /* EXEC_LINKS */
 			) &&
 		       !strncmp(user_input_buffer, "lynxprog:",9)) {
@@ -3866,7 +3870,7 @@ check_goto_URL:
 		    /*
 		     *	Make the curdoc.address the newdoc.address so that
 		     *	getfile doesn't try to get the newdoc.address.
-		     *	Since we have already gotton it.
+		     *	Since we have already gotten it.
 		     */
 		    StrAllocCopy(curdoc.address, newdoc.address);
 		    StrAllocCopy(newdoc.post_data, curdoc.post_data);
@@ -3974,8 +3978,8 @@ check_goto_URL:
 		refresh_screen = TRUE;
 	    } else if ((case_sensitive && 0!=strcmp(prev_target,
 						    remember_old_target)) ||
-		       (!case_sensitive && 0!=strcasecomp(prev_target,
-							  remember_old_target))) {
+		      (!case_sensitive && 0!=strcasecomp8(prev_target,
+						    remember_old_target))) {
 		refresh_screen = TRUE;
 	    }
 	    FREE(remember_old_target);
@@ -4274,7 +4278,7 @@ check_goto_URL:
 		    break;
 		remove_bookmark_link(links[curdoc.link].anchor_number-1,
 				     curdoc.bookmark);
-	    } else {	/* behave like REFRESH for backward compatability */
+	    } else {	/* behave like REFRESH for backward compatibility */
 		refresh_screen = TRUE;
 		if (old_c != real_c) {
 		    old_c = real_c;
@@ -4813,7 +4817,7 @@ check_add_bookmark_to_self:
 		fflush(stderr);
 		if (LYTraceLogFP)
 		    /*
-		     *	Set stderr back to its orginal value
+		     *	Set stderr back to its original value
 		     *	during the shell escape. - FM
 		     */
 		    *stderr = LYOrigStderr;
@@ -5443,7 +5447,7 @@ check_add_bookmark_to_self:
 			if (!strncasecomp(ret, "lynxexec:", 9) ||
 			    !strncasecomp(ret, "lynxprog:", 9)) {
 			    /*
-			     *	The original implementions of these schemes
+			     *	The original implementations of these schemes
 			     *	expected white space without hex escaping,
 			     *	and did not check for hex escaping, so we'll
 			     *	continue to support that, until that code is
@@ -5662,6 +5666,7 @@ PRIVATE int are_different ARGS2(
 /* This determines whether two docs are _physically_ different,
  * meaning they are "from different files". - kw
  */
+#ifndef DONT_TRACK_INTERNAL_LINKS
 PRIVATE int are_phys_different ARGS2(
 	document *,	doc1,
 	document *,	doc2)
@@ -5742,6 +5747,7 @@ PRIVATE int are_phys_different ARGS2(
      */
     return(FALSE);
 }
+#endif
 
 /*
  *  Utility for freeing the list of goto URLs. - FM
diff --git a/src/LYNews.c b/src/LYNews.c
index 744a29d9..77824ebd 100644
--- a/src/LYNews.c
+++ b/src/LYNews.c
@@ -416,7 +416,7 @@ cleanup:
 }
 
 PRIVATE void terminate_message ARGS1(
-	int,	sig)
+	int,	sig GCC_UNUSED)
 {
     term_message = TRUE;
     /*
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 140cbccd..c63740a4 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1757,7 +1757,7 @@ PRIVATE int boolean_choice ARGS4(
 }
 
 PRIVATE void terminate_options ARGS1(
-	int,		sig)
+	int,		sig GCC_UNUSED)
 {
     term_options = TRUE;
     /*
diff --git a/src/LYPrint.c b/src/LYPrint.c
index f8d1c5ac..04051990 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -471,9 +471,9 @@ PUBLIC int printfile ARGS1(
 		     *	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).
+		     *	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 CHARSETs are found Lynx uses
 		     *	the first only, and it is opposite to BASE where the
@@ -490,8 +490,7 @@ PUBLIC int printfile ARGS1(
 			  strncasecomp(disp_charset, "x-", 2) == 0) {
 		     } else {
 			fprintf(outfile_fp,
-				"<META HTTP-EQUIV=\"Content-Type\" "
-				"CONTENT=\"text/html; charset=%s\">\n\n",
+				"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=%s\">\n\n",
 				disp_charset);
 			}
 		}
@@ -1319,20 +1318,20 @@ PUBLIC int print_options ARGS2(
     fprintf(fp0, "<head>\n<title>%s</title>\n</head>\n<body>\n",
 		 PRINT_OPTIONS_TITLE);
 
-    fprintf(fp0,"<h1>Printing Options (%s Version %s)</h1>\n",
+    fprintf(fp0,"<h1>Printing Options (%s Version %s)</h1><pre>\n",
 				       LYNX_NAME, LYNX_VERSION);
 
     pages = (lines_in_file+65)/66;
     sprintf(buffer,
-	    "There are %d lines, or approximately %d page%s, to print.<br>\n",
+	   "   There are %d lines, or approximately %d page%s, to print.\n",
 	    lines_in_file, pages, (pages > 1 ? "s" : ""));
     fputs(buffer,fp0);
 
     if (no_print || no_disk_save || child_lynx || no_mail)
-	fputs("Some print functions have been disabled!!!<br>\n", fp0);
+	fprintf(fp0, "   Some print functions have been disabled!!!\n");
 
-    fputs("You have the following print choices.<br>\n", fp0);
-    fputs("Please select one:<br>\n<pre>\n", fp0);
+    fprintf(fp0, "   You have the following print choices.\n");
+    fprintf(fp0, "   Please select one:\n\n");
 
     if (child_lynx == FALSE && no_disk_save == FALSE && no_print == FALSE)
 	fprintf(fp0,
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index d8509a00..736aeab4 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -343,13 +343,13 @@ PUBLIC int check_color ARGS2(
 {
     int i;
 
-    if (!strcasecmp(color, "default"))
+    if (!strcasecomp(color, "default"))
 	return the_default;
-    if (!strcasecmp(color, "nocolor"))
+    if (!strcasecomp(color, "nocolor"))
 	return NO_COLOR;
 
     for (i = 0; i < 16; i++) {
-	if (!strcasecmp(color, Color_Strings[i]))
+	if (!strcasecomp(color, Color_Strings[i]))
 	    return ColorCode(i);
     }
     return ERR_COLOR;
diff --git a/src/LYReadCFG.h b/src/LYReadCFG.h
index 7cf805c0..5e94f0d8 100644
--- a/src/LYReadCFG.h
+++ b/src/LYReadCFG.h
@@ -11,6 +11,32 @@
 #define NO_COLOR      -2
 #define ERR_COLOR     -3
 
+/* Note: the sense of colors that Lynx uses for defaults is the reverse of
+ * the standard for color-curses.
+ */
+#ifdef USE_DEFAULT_COLORS
+# ifdef USE_SLANG
+#  define DEFAULT_FG "default"
+#  define DEFAULT_BG "default"
+# else
+#  ifdef HAVE_USE_DEFAULT_COLORS
+#   define DEFAULT_FG DEFAULT_COLOR
+#   define DEFAULT_BG DEFAULT_COLOR
+#  else
+#   define DEFAULT_FG COLOR_BLACK
+#   define DEFAULT_BG COLOR_WHITE
+#  endif
+# endif
+#else
+# ifdef USE_SLANG
+#  define DEFAULT_FG "black"
+#  define DEFAULT_BG "white"
+# else
+#  define DEFAULT_FG COLOR_BLACK
+#  define DEFAULT_BG COLOR_WHITE
+# endif
+#endif /* USE_DEFAULT_COLORS */
+
 extern int default_fg;
 extern int default_bg;
 
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c
index 4ede9630..dfb2f211 100644
--- a/src/LYShowInfo.c
+++ b/src/LYShowInfo.c
@@ -81,9 +81,10 @@ PUBLIC int showinfo ARGS4(
 	(url_type == LYNXEXEC_URL_TYPE ||
 	 url_type == LYNXPROG_URL_TYPE)) {
 	char *last_slash = strrchr(links[doc->link].lname,'/');
-	if (last_slash-links[doc->link].lname ==
-	    	strlen(links[doc->link].lname)-1) {
-	    links[doc->link].lname[strlen(links[doc->link].lname)-1] = '\0';
+	int next_to_last = strlen(links[doc->link].lname) - 1;
+
+	if ((last_slash - links[doc->link].lname) == next_to_last) {
+	    links[doc->link].lname[next_to_last] = '\0';
 	}
     }
 
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 8a3903af..2f546f72 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -13,6 +13,7 @@
 #include "LYNews.h"
 #include "LYOptions.h"
 #include "LYCharSets.h"
+#include "HTString.h"
 
 #include <ctype.h>
 
@@ -463,7 +464,7 @@ re_read:
 	     }
 	   else
 #endif
-	     c = '\n'; /* kepad enter on pc ncsa telnet */
+	     c = '\n'; /* keypad enter on pc ncsa telnet */
 	   break;
 
 	case 'm':
@@ -982,7 +983,7 @@ PUBLIC void LYRefreshEdit ARGS1(
  *	+---------+=============+-----------+
  *	0	  DspStart		     length
  *
- *  Insertion point can be anywhere beween 0 and stringlength.
+ *  Insertion point can be anywhere between 0 and stringlength.
  *  Figure out new display starting point.
  *
  *   The first "if" below makes Lynx scroll several columns at a time when
@@ -1060,7 +1061,7 @@ PUBLIC void LYRefreshEdit ARGS1(
 PUBLIC int LYgetstr ARGS4(
 	char *, 	inputline,
 	int,		hidden,
-	int,		bufsize,
+	size_t, 	bufsize,
 	int,		recall)
 {
     int x, y, MaxStringSize;
@@ -1140,40 +1141,35 @@ again:
 }
 
 /*
- *  LYstrstr will find the first occurence of the string
+ *  LYstrstr will find the first occurrence of the string
  *  pointed to by tarptr in the string pointed to by chptr.
+ *  It returns NULL if string not found.
  *  It is a case insensitive search.
  */
 PUBLIC char * LYstrstr ARGS2(
 	char *, 	chptr,
 	char *, 	tarptr)
 {
-    register char *tmpchptr, *tmptarptr;
+    int len = strlen(tarptr);
 
     for(; *chptr != '\0'; chptr++) {
-	if(TOUPPER(*chptr) == TOUPPER(*tarptr)) {
-	    /* see if they line up */
-	    for(tmpchptr = chptr+1, tmptarptr = tarptr+1;
-		(TOUPPER(*tmpchptr) == TOUPPER(*tmptarptr) &&
-		 *tmptarptr != '\0' && *tmpchptr != '\0');
-		tmpchptr++, tmptarptr++)
-		   ; /* null body */
-	    if(*tmptarptr == '\0')
+	if (0 == UPPER8(*chptr, *tarptr)) {
+	    if (0 == strncasecomp8(chptr+1, tarptr+1, len-1))
 		return(chptr);
 	}
     } /* end for */
 
-    return(NULL);
+    return(NULL); /* string not found or initial chptr was empty */
 }
 
 /*
- *  LYno_attr_char_case_strstr will find the first occurence of the
+ *  LYno_attr_char_case_strstr will find the first occurrence of the
  *  string pointed to by tarptr in the string pointed to by chptr.
  *  It ignores the characters: LY_UNDERLINE_START_CHAR and
  *			       LY_UNDERLINE_END_CHAR
  *			       LY_BOLD_START_CHAR
  *			       LY_BOLD_END_CHAR
- *				LY_SOFT_HYPHEN
+ *			       LY_SOFT_HYPHEN
  *			       if present in chptr.
  *  It is a case insensitive search.
  */
@@ -1190,7 +1186,7 @@ PUBLIC char * LYno_attr_char_case_strstr ARGS2(
 	chptr++;
 
     for (; *chptr != '\0'; chptr++) {
-	if (TOUPPER(*chptr) == TOUPPER(*tarptr)) {
+	 if (0 == UPPER8(*chptr, *tarptr)) {
 	    /*
 	     *	See if they line up.
 	     */
@@ -1201,18 +1197,18 @@ PUBLIC char * LYno_attr_char_case_strstr ARGS2(
 		 return(chptr);
 
 	    while (1) {
-		 if (!IsSpecialAttrChar(*tmpchptr)) {
-		    if (TOUPPER(*tmpchptr) != TOUPPER(*tmptarptr))
+		if (!IsSpecialAttrChar(*tmpchptr)) {
+		    if (0 != UPPER8(*tmpchptr, *tmptarptr))
 			break;
 		    tmpchptr++;
 		    tmptarptr++;
-		 } else {
+		} else {
 		    tmpchptr++;
-		 }
-		 if (*tmptarptr == '\0')
-		     return(chptr);
-		 if (*tmpchptr == '\0')
-		     break;
+		}
+		if (*tmptarptr == '\0')
+		    return(chptr);
+		if (*tmpchptr == '\0')
+		    break;
 	    }
 	}
     } /* end for */
@@ -1221,7 +1217,7 @@ PUBLIC char * LYno_attr_char_case_strstr ARGS2(
 }
 
 /*
- *  LYno_attr_char_strstr will find the first occurence of the
+ *  LYno_attr_char_strstr will find the first occurrence of the
  *  string pointed to by tarptr in the string pointed to by chptr.
  *  It ignores the characters: LY_UNDERLINE_START_CHAR and
  *			       LY_UNDERLINE_END_CHAR
@@ -1275,10 +1271,10 @@ PUBLIC char * LYno_attr_char_strstr ARGS2(
 }
 
 /*
- * LYno_attr_mbcs_case_strstr will find the first occurence of the string
+ * LYno_attr_mbcs_case_strstr will find the first occurrence of the string
  * pointed to by tarptr in the string pointed to by chptr.
  * It takes account of MultiByte Character Sequences (UTF8).
- * The physical lenght of the displayed string up to the end of the target
+ * The physical length of the displayed string up to the end of the target
  * string is returned in *nendp if the search is successful.
  * It ignores the characters: LY_UNDERLINE_START_CHAR and
  *			      LY_UNDERLINE_END_CHAR
@@ -1317,7 +1313,7 @@ PUBLIC char * LYno_attr_mbcs_case_strstr ARGS5(
 	     *chptr == *tarptr &&
 	     *(chptr + 1) != '\0' &&
 	     !IsSpecialAttrChar(*(chptr + 1))) ||
-	    TOUPPER(*chptr) == TOUPPER(*tarptr)) {
+	    (0 == UPPER8(*chptr, *tarptr))) {
 	    int tarlen = 0;
 	    offset = len;
 	    len++;
@@ -1341,7 +1337,7 @@ PUBLIC char * LYno_attr_mbcs_case_strstr ARGS5(
 		 *tmpchptr != '\0' &&
 		 !IsSpecialAttrChar(*tmpchptr)) {
 		/*
-		 *  Check the CJK mutibyte. - FM
+		 *  Check the CJK multibyte. - FM
 		 */
 		if (*tmpchptr == *tmptarptr) {
 		    /*
@@ -1381,7 +1377,7 @@ PUBLIC char * LYno_attr_mbcs_case_strstr ARGS5(
 			} else {
 			break;
 			}
-		    } else if (TOUPPER(*tmpchptr) != TOUPPER(*tmptarptr)) {
+		    } else if (0 != UPPER8(*tmpchptr, *tmptarptr)) {
 			break;
 		    }
 
@@ -1419,7 +1415,7 @@ PUBLIC char * LYno_attr_mbcs_case_strstr ARGS5(
 }
 
 /*
- * LYno_attr_mbcs_strstr will find the first occurence of the string
+ * LYno_attr_mbcs_strstr will find the first occurrence of the string
  * pointed to by tarptr in the string pointed to by chptr.
  *  It takes account of CJK and MultiByte Character Sequences (UTF8).
  *  The physical lengths of the displayed string up to the start and
@@ -1481,7 +1477,7 @@ PUBLIC char * LYno_attr_mbcs_strstr ARGS5(
 		 *tmpchptr != '\0' &&
 		 !IsSpecialAttrChar(*tmpchptr)) {
 		/*
-		 *  Check the CJK mutibyte. - FM
+		 *  Check the CJK multibyte. - FM
 		 */
 		if (*tmpchptr == *tmptarptr) {
 		    /*
@@ -1605,3 +1601,76 @@ PUBLIC char * SNACat ARGS3(
     }
     return *dest;
 }
+
+
+#ifdef EXP_8BIT_TOUPPER
+
+/*
+**   UPPER8 ?
+**   it was "TOUPPER(a) - TOUPPER(b)" in its previous life...
+**
+**   It was realized that case-insensitive user search
+**   got information about upper/lower mapping from TOUPPER
+**   (precisely from "(TOUPPER(a) - TOUPPER(b))==0").
+**   This function depends on locale in its 8bit mapping
+**   and usually fails with DOS/WINDOWS display charsets
+**   as well as on non-UNIX systems.
+**
+**   We extend this function for 8bit letters
+**   using Lynx internal chartrans feature:
+**   we assume that upper/lower case letters
+**   have their "7bit approximation" images (in def7_uni.tbl)
+**   matched case-insensitive (7bit).
+**
+**   By this technique we cover *any* charset known for Lynx chartrans
+**   and need no extra information for it.  - LP
+**
+*/
+PUBLIC int UPPER8(int ch1, int ch2)
+{
+    /* Use exact match for speed, but mostly for stability	    */
+    /* while doing experiments with the remainder of this function. */
+    if (ch1==ch2)
+	return(0);  /* Exact match */
+
+    /* case-insensitive match for us-ascii */
+    if ((unsigned char)ch1 < 128 && (unsigned char)ch2 < 128)
+	return(TOUPPER(ch1) - TOUPPER(ch2));
+
+    /* compare "7bit approximation" for letters >127   */
+    if ((unsigned char)ch1 > 127 && (unsigned char)ch2 >127)
+    {
+	/* BTW, if we remove the check for >127 above	   */
+	/* we get even more "relaxed" insensitive match... */
+
+	CONST char *disp_charset;
+	int charset_in, charset_out, uck1, uck2;
+	char replace_buf1 [10], replace_buf2 [10];
+
+	disp_charset = LYCharSet_UC[current_char_set].MIMEname;
+	charset_in  = UCGetLYhndl_byMIME(disp_charset);
+	charset_out = UCGetLYhndl_byMIME("us-ascii");
+
+	uck1 = UCTransCharStr(replace_buf1, sizeof(replace_buf1), ch1,
+			      charset_in, charset_out, YES);
+	uck2 = UCTransCharStr(replace_buf2, sizeof(replace_buf2), ch2,
+			      charset_in, charset_out, YES);
+	/*
+	** Got both replacement strings (yippey).  - FM
+	*/
+	if (strcmp(replace_buf1, replace_buf2)!=0)  /* case-sensitive ! */
+	/*
+	** Two strings different.  We assume the different letters
+	** should not have the equal strings for "7bit approx",
+	** overwise differently accented letters may be vanished.
+	** Now we return case-INsensitive comparision of strings:
+	*/
+
+	if ((uck1 > 0) && (uck2 > 0))
+	    return (strcasecomp(replace_buf1, replace_buf2));
+    }
+
+    return(-10);  /* mismatch */
+}
+
+#endif /* EXP_8BIT_TOUPPER */
diff --git a/src/LYStrings.h b/src/LYStrings.h
index ccf1c4b0..3162ab78 100644
--- a/src/LYStrings.h
+++ b/src/LYStrings.h
@@ -3,6 +3,17 @@
 
 #include <string.h>
 
+#if !defined(EXP_8BIT_TOUPPER) && !defined(LOCALE) && !defined(__DJGPP__)
+#define EXP_8BIT_TOUPPER 1
+#endif
+
+#ifdef EXP_8BIT_TOUPPER
+extern int UPPER8  PARAMS((
+	int		ch1,
+	int		ch2));
+#else
+#define UPPER8(a,b) (TOUPPER(a) - TOUPPER(b))
+#endif
 extern int get_mouse_link NOPARAMS;
 extern char * LYstrncpy PARAMS((
 	char *		dst,
@@ -13,7 +24,7 @@ extern int LYgetch NOPARAMS;
 extern int LYgetstr PARAMS((
 	char *		inputline,
 	int		hidden,
-	int		bufsize,
+	size_t		bufsize,
 	int		recall));
 extern char * LYstrstr PARAMS((
 	char *		chptr,
diff --git a/src/LYStyle.c b/src/LYStyle.c
index 082f0a6b..73a55874 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -65,7 +65,7 @@ PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*
 
     for (i = 0; i <7; i++)
     {
-	if (!strcasecmp(Mono_Strings[i], mono))
+	if (!strcasecomp(Mono_Strings[i], mono))
 	{
 	    mA = ncursesMono[i];
 	}
@@ -186,37 +186,37 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n", buffer);
     /*
     * We use some pseudo-elements, so catch these first
     */
-    if (!strncasecmp(element, "alink", 5)) /* active link */
+    if (!strncasecomp(element, "alink", 5)) /* active link */
     {
 	parse_attributes(mono,fg,bg,DSTYLE_ALINK,"alink");
     }
-    else if (!strcasecmp(element, "a")) /* normal link */
+    else if (!strcasecomp(element, "a")) /* normal link */
     {
 	parse_attributes(mono,fg,bg, DSTYLE_LINK,"a");
 	parse_attributes(mono,fg,bg, HTML_A,"a");
     }
-    else if (!strncasecmp(element, "status", 4)) /* status bar */
+    else if (!strncasecomp(element, "status", 4)) /* status bar */
     {
 	parse_attributes(mono,fg,bg, DSTYLE_STATUS,"status");
     }
-    else if (!strncasecmp(element, "label", 6)) /* [INLINE]'s */
+    else if (!strncasecomp(element, "label", 6)) /* [INLINE]'s */
     {
 	parse_attributes(mono,fg,bg,DSTYLE_OPTION,"label");
     }
-    else if (!strncasecmp(element, "value", 5)) /* [INLINE]'s */
+    else if (!strncasecomp(element, "value", 5)) /* [INLINE]'s */
     {
 	parse_attributes(mono,fg,bg,DSTYLE_VALUE,"value");
     }
-    else if (!strncasecmp(element, "high", 4)) /* [INLINE]'s */
+    else if (!strncasecomp(element, "high", 4)) /* [INLINE]'s */
     {
 	parse_attributes(mono,fg,bg,DSTYLE_HIGH,"high");
     }
-    else if (!strcmp(element, "normal")) /* added - kw */
+    else if (!strcasecomp(element, "normal")) /* added - kw */
     {
 	parse_attributes(mono,fg,bg,DSTYLE_NORMAL,"html");
     }
     /* this may vanish */
-    else if (!strncasecmp(element, "candy", 5)) /* [INLINE]'s */
+    else if (!strncasecomp(element, "candy", 5)) /* [INLINE]'s */
     {
 	parse_attributes(mono,fg,bg,DSTYLE_CANDY,"candy");
     }
@@ -229,7 +229,7 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n", buffer);
 	int i;
 	for (i = 0; i <HTML_ELEMENTS; i++)
 	{
-	    if (!strcasecmp (HTML_dtd.tags[i].name, element))
+	    if (!strcasecomp (HTML_dtd.tags[i].name, element))
 	    {
 		if (TRACE)
 		    fprintf(stderr, "PARSECSS:applying style <%s,%s,%s> for HTML_%s\n",mono,fg,bg,HTML_dtd.tags[i].name);
diff --git a/src/LYUtils.c b/src/LYUtils.c
index dd9538ba..c60ce6ed 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1972,7 +1972,7 @@ PUBLIC void toggle_novice_line NOARGS
 }
 
 PUBLIC void noviceline ARGS1(
-	int,		more_flag)
+	int,		more_flag GCC_UNUSED)
 {
 
     if (dump_output_immediately)
@@ -2908,7 +2908,7 @@ PUBLIC BOOLEAN inlocaldomain NOARGS
 #endif	/* TERMIO_AND_TERMIOS */
 
 PUBLIC void size_change ARGS1(
-	int,		sig)
+	int,		sig GCC_UNUSED)
 {
     int old_lines = LYlines;
     int old_cols = LYcols;
@@ -4937,6 +4937,7 @@ PUBLIC CONST char * Home_Dir NOARGS
 		StrAllocCopy(HomeDir, cp);
 	    }
 #else
+#if HAVE_UTMP
 	    /*
 	     *	One could use getlogin() and getpwnam() here instead.
 	     */
@@ -4944,7 +4945,9 @@ PUBLIC CONST char * Home_Dir NOARGS
 
 	    if (pw && pw->pw_dir) {
 		StrAllocCopy(HomeDir, pw->pw_dir);
-	    } else {
+	    } else
+#endif
+	    {
 		/*
 		 *  Use /tmp; it should be writable.
 		 */
@@ -4973,7 +4976,7 @@ PUBLIC CONST char * Home_Dir NOARGS
  */
 PUBLIC BOOLEAN LYPathOffHomeOK ARGS2(
 	char *, 	fbuffer,
-	int,		fbuffer_size)
+	size_t, 	fbuffer_size)
 {
     char *file = NULL;
     char *cp, *cp1;
@@ -5146,7 +5149,7 @@ PUBLIC BOOLEAN LYPathOffHomeOK ARGS2(
  */
 PUBLIC void LYAddPathToHome ARGS3(
 	char *, 	fbuffer,
-	int,		fbuffer_size,
+	size_t, 	fbuffer_size,
 	char *, 	fname)
 {
     char *home = NULL;
@@ -5399,7 +5402,19 @@ PUBLIC time_t LYmktime ARGS2(
 	LYstrncpy(temp, start, 4);
     } else if ((s - start) == 2) {
 	now = time(NULL);
-	LYstrncpy(temp, ((char *)ctime(&now) + 20), 2);
+	/*
+	 * Assume that received 2-digit dates >= 70 are 19xx; others
+	 * are 20xx.  Only matters when dealing with broken software
+	 * (HTTP server or web page) which is not Y2K compliant.  The
+	 * line is drawn on a best-guess basis; it is impossible for
+	 * this to be completely accurate because it depends on what
+	 * the broken sender software intends.	(This totally breaks
+	 * in 2100 -- setting up the next crisis...) - BL
+	 */
+	if (atoi(start) >= 70)
+	    LYstrncpy(temp, "19", 2);
+	else
+	    LYstrncpy(temp, "20", 2);
 	strncat(temp, start, 2);
 	temp[4] = '\0';
     } else {
diff --git a/src/LYUtils.h b/src/LYUtils.h
index 9b8a8b35..cfccb4be 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -51,9 +51,9 @@ extern void Define_VMSLogical PARAMS((
 	char *LogicalName, char *LogicalValue));
 #endif /* VMS */
 extern CONST char *Home_Dir NOPARAMS;
-extern BOOLEAN LYPathOffHomeOK PARAMS((char *fbuffer, int fbuffer_size));
+extern BOOLEAN LYPathOffHomeOK PARAMS((char *fbuffer, size_t fbuffer_size));
 extern void LYAddPathToHome PARAMS((
-	char *fbuffer, int fbuffer_size, char *fname));
+	char *fbuffer, size_t fbuffer_size, char *fname));
 extern time_t LYmktime PARAMS((char *string, BOOL absolute));
 #if ! HAVE_PUTENV
 extern int putenv PARAMS((CONST char *string));
diff --git a/src/UCAuto.c b/src/UCAuto.c
index f131da9a..e0c95f4d 100644
--- a/src/UCAuto.c
+++ b/src/UCAuto.c
@@ -351,8 +351,8 @@ PUBLIC void UCChangeTerminalCodepage ARGS2(
  *  This is the thing that actually gets called from display_page().
  */
 PUBLIC void UCChangeTerminalCodepage ARGS2(
-	int,		newcs,
-	LYUCcharset *,	p)
+	int,		newcs GCC_UNUSED,
+	LYUCcharset *,	p GCC_UNUSED)
 {
     if (TRACE) {
 	fprintf(stderr,
diff --git a/src/UCdomap.c b/src/UCdomap.c
index 84ab6ed3..c5b3cd83 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -308,7 +308,7 @@ PRIVATE void UCreset_allocated_LYCharSets NOPARAMS;
 PRIVATE void UCfree_allocated_LYCharSets NOPARAMS;
 PRIVATE char ** UC_setup_LYCharSets_repl PARAMS((
 	int		UC_charset_in_hndl,
-	int		lowest8));
+	unsigned	lowest8));
 PRIVATE int UC_Register_with_LYCharSets PARAMS((
 	int		s,
 	CONST char *	UC_MIMEcharset,
@@ -1678,7 +1678,7 @@ PRIVATE void UCfree_allocated_LYCharSets NOARGS
 
 PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
 	int,		UC_charset_in_hndl,
-	int,		lowest8)
+	unsigned,	lowest8)
 {
     char **ISO_Latin1 = LYCharSets[0];
     char **p;
@@ -1687,7 +1687,8 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2(
     char **tp;
     char *s7;
     char *s8;
-    int i, j, changed;
+    size_t i;
+    int j, changed;
     u16 k;
     u8 *ti;
 
diff --git a/src/chrtrans/README.tables b/src/chrtrans/README.tables
index e2815707..be6dac6a 100644
--- a/src/chrtrans/README.tables
+++ b/src/chrtrans/README.tables
@@ -6,7 +6,7 @@ for some of the RFC 1345 Mnemonic codes are out of date, a cleanup and
 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 
+added to entities.h), this set is just to test whether the system works 
 in principle (and also how it behaves with incomplete data...)
 
 See the file README.format for a brief explanation of what's in the
diff --git a/src/chrtrans/UCkd.h b/src/chrtrans/UCkd.h
index 1497f298..1e55716e 100644
--- a/src/chrtrans/UCkd.h
+++ b/src/chrtrans/UCkd.h
@@ -56,6 +56,7 @@ struct unimapdesc_str {
 #define UC_MAXLEN_LYNXCSNAME 40
 #define UC_LEN_LYNXCSNAME 20
 
+#undef  EX_OK			/* may be defined in system headers */
 #define EX_OK		0	/* successful termination */
 #define EX_USAGE	64	/* command line usage error */
 #define EX_DATAERR	65	/* data format error */
diff --git a/src/chrtrans/cp1252_uni.tbl b/src/chrtrans/cp1252_uni.tbl
index d1ce324d..d8adb2fa 100644
--- a/src/chrtrans/cp1252_uni.tbl
+++ b/src/chrtrans/cp1252_uni.tbl
@@ -25,38 +25,38 @@ OWinLatin1 (cp1252)
 #
 #    The entries are in cp1252_WinLatin1 order
 #
-0x00    U+0000  #Null
-0x01    U+0001  #START OF HEADING
-0x02    U+0002  #START OF TEXT
-0x03    U+0003  #END OF TEXT
-0x04    U+0004  #END OF TRANSMISSION
-0x05    U+0005  #ENQUIRY
-0x06    U+0006  #ACKNOWLEDGE
-0x07    U+0007  #BELL
-0x08    U+0008  #BACKSPACE
-0x09    U+0009  #HORIZONTAL TABULATION
-0x0a    U+000a  #LINE FEED
-0x0b    U+000b  #VERTICAL TABULATION
-0x0c    U+000c  #FORM FEED
-0x0d    U+000d  #CARRIAGE RETURN
-0x0e    U+000e  #SHIFT OUT
-0x0f    U+000f  #SHIFT IN
-0x10    U+0010  #DATA LINK ESCAPE
-0x11    U+0011  #DEVICE CONTROL ONE
-0x12    U+0012  #DEVICE CONTROL TWO
-0x13    U+0013  #DEVICE CONTROL THREE
-0x14    U+0014  #DEVICE CONTROL FOUR
-0x15    U+0015  #NEGATIVE ACKNOWLEDGE
-0x16    U+0016  #SYNCHRONOUS IDLE
-0x17    U+0017  #END OF TRANSMISSION BLOCK
-0x18    U+0018  #CANCEL
-0x19    U+0019  #END OF MEDIUM
-0x1a    U+001a  #SUBSTITUTE
-0x1b    U+001b  #ESCAPE
-0x1c    U+001c  #FILE SEPARATOR
-0x1d    U+001d  #GROUP SEPARATOR
-0x1e    U+001e  #RECORD SEPARATOR
-0x1f    U+001f  #UNIT SEPARATOR
+#0x00    U+0000  #Null
+#0x01    U+0001  #START OF HEADING
+#0x02    U+0002  #START OF TEXT
+#0x03    U+0003  #END OF TEXT
+#0x04    U+0004  #END OF TRANSMISSION
+#0x05    U+0005  #ENQUIRY
+#0x06    U+0006  #ACKNOWLEDGE
+#0x07    U+0007  #BELL
+#0x08    U+0008  #BACKSPACE
+#0x09    U+0009  #HORIZONTAL TABULATION
+#0x0a    U+000a  #LINE FEED
+#0x0b    U+000b  #VERTICAL TABULATION
+#0x0c    U+000c  #FORM FEED
+#0x0d    U+000d  #CARRIAGE RETURN
+#0x0e    U+000e  #SHIFT OUT
+#0x0f    U+000f  #SHIFT IN
+#0x10    U+0010  #DATA LINK ESCAPE
+#0x11    U+0011  #DEVICE CONTROL ONE
+#0x12    U+0012  #DEVICE CONTROL TWO
+#0x13    U+0013  #DEVICE CONTROL THREE
+#0x14    U+0014  #DEVICE CONTROL FOUR
+#0x15    U+0015  #NEGATIVE ACKNOWLEDGE
+#0x16    U+0016  #SYNCHRONOUS IDLE
+#0x17    U+0017  #END OF TRANSMISSION BLOCK
+#0x18    U+0018  #CANCEL
+#0x19    U+0019  #END OF MEDIUM
+#0x1a    U+001a  #SUBSTITUTE
+#0x1b    U+001b  #ESCAPE
+#0x1c    U+001c  #FILE SEPARATOR
+#0x1d    U+001d  #GROUP SEPARATOR
+#0x1e    U+001e  #RECORD SEPARATOR
+#0x1f    U+001f  #UNIT SEPARATOR
 0x20    U+0020  #SPACE
 0x21    U+0021  #EXCLAMATION MARK
 0x22    U+0022  #QUOTATION MARK
@@ -153,8 +153,8 @@ OWinLatin1 (cp1252)
 0x7d    U+007d  #RIGHT CURLY BRACKET
 0x7e    U+007e  #TILDE
 0x7f    U+007f  #DELETE
-# 0x80    U+0080  #NOT USED
-# 0x81    U+0081  #NOT USED
+#0x80    U+0080  #NOT USED
+#0x81    U+0081  #NOT USED
 0x82    U+201a  #SINGLE LOW-9 QUOTATION MARK
 0x83    U+0192  #LATIN SMALL LETTER F WITH HOOK
 0x84    U+201e  #DOUBLE LOW-9 QUOTATION MARK
@@ -166,10 +166,10 @@ OWinLatin1 (cp1252)
 0x8a    U+0160  #LATIN CAPITAL LETTER S WITH CARON
 0x8b    U+2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
 0x8c    U+0152  #LATIN CAPITAL LIGATURE OE
-0x8d    U+008d  #NOT USED
-0x8e    U+008e  #NOT USED
-0x8f    U+008f  #NOT USED
-0x90    U+0090  #NOT USED
+#0x8d    U+008d  #NOT USED
+#0x8e    U+008e  #NOT USED
+#0x8f    U+008f  #NOT USED
+#0x90    U+0090  #NOT USED
 0x91    U+2018  #LEFT SINGLE QUOTATION MARK
 0x92    U+2019  #RIGHT SINGLE QUOTATION MARK
 0x93    U+201c  #LEFT DOUBLE QUOTATION MARK
@@ -182,8 +182,8 @@ OWinLatin1 (cp1252)
 0x9a    U+0161  #LATIN SMALL LETTER S WITH CARON
 0x9b    U+203a  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
 0x9c    U+0153  #LATIN SMALL LIGATURE OE
-0x9d    U+009d  #NOT USED
-0x9e    U+009e  #NOT USED
+#0x9d    U+009d  #NOT USED
+#0x9e    U+009e  #NOT USED
 0x9f    U+0178  #LATIN CAPITAL LETTER Y WITH DIAERESIS
 0xa0    U+00a0  #NO-BREAK SPACE
 0xa1    U+00a1  #INVERTED EXCLAMATION MARK
diff --git a/src/chrtrans/def7_uni.tbl b/src/chrtrans/def7_uni.tbl
index 880e932e..0c86d234 100644
--- a/src/chrtrans/def7_uni.tbl
+++ b/src/chrtrans/def7_uni.tbl
@@ -2168,9 +2168,10 @@ U+001f:US
 U+007f:DT
 U+0080:PA
 U+0081:HO
-# 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)
+# Most of these characters (82-9F) may be inflicted on us
+# by MS FrontPages which uses Unicode notation such as &#153;
+# but there are no assigned letters in Unicode 128-159 range.
+# It is assumed in the code that those codepoints are from windows-1252.
 #U+0082:BH
 #U+0083:NH
 #U+0084:IN
diff --git a/src/chrtrans/makefile.in b/src/chrtrans/makefile.in
index 0a64fd44..c778a324 100644
--- a/src/chrtrans/makefile.in
+++ b/src/chrtrans/makefile.in
@@ -4,8 +4,9 @@
 # This may not yet work for the general case.
 # Only some dependencies included.
 #
-#
-SHELL = /bin/sh
+SHELL		= /bin/sh
+
+x		= @PROG_EXT@
 
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -76,8 +77,8 @@ default: $(FONTMAP_INC)
 
 tables: $(TABLES)
 
-makeuctb: makeuctb.o
-	$(CC) $(CC_OPTS) -o makeuctb makeuctb.o
+makeuctb$x: makeuctb.o
+	$(CC) $(CC_OPTS) -o $@ makeuctb.o
 
 makeuctb.o: $(srcdir)/UCkd.h $(srcdir)/makeuctb.c
 
@@ -96,44 +97,44 @@ makeuctb.o: $(srcdir)/UCkd.h $(srcdir)/makeuctb.c
 
 # table files listed here once again to get the make dependencies
 # right, in case makeuctb was recompiled.
-cp1250_uni.h:		$(srcdir)/cp1250_uni.tbl	makeuctb
-cp1251_uni.h:		$(srcdir)/cp1251_uni.tbl	makeuctb
-cp1252_uni.h:		$(srcdir)/cp1252_uni.tbl	makeuctb
-cp1253_uni.h:		$(srcdir)/cp1253_uni.tbl	makeuctb
-cp1255_uni.h:		$(srcdir)/cp1255_uni.tbl	makeuctb
-cp1256_uni.h:		$(srcdir)/cp1256_uni.tbl	makeuctb
-cp1257_uni.h:		$(srcdir)/cp1257_uni.tbl	makeuctb
-cp437_uni.h:		$(srcdir)/cp437_uni.tbl		makeuctb
-cp737_uni.h:		$(srcdir)/cp737_uni.tbl		makeuctb
-cp850_uni.h:		$(srcdir)/cp850_uni.tbl		makeuctb
-cp852_uni.h:		$(srcdir)/cp852_uni.tbl		makeuctb
-cp862_uni.h:		$(srcdir)/cp862_uni.tbl		makeuctb
-cp864_uni.h:		$(srcdir)/cp864_uni.tbl		makeuctb
-cp866_uni.h:		$(srcdir)/cp866_uni.tbl		makeuctb
-cp869_uni.h:		$(srcdir)/cp869_uni.tbl		makeuctb
-def7_uni.h:		$(srcdir)/def7_uni.tbl		makeuctb
-dmcs_uni.h:		$(srcdir)/dmcs_uni.tbl		makeuctb
-iso01_uni.h:		$(srcdir)/iso01_uni.tbl		makeuctb
-iso02_uni.h:		$(srcdir)/iso02_uni.tbl		makeuctb
-iso03_uni.h:		$(srcdir)/iso03_uni.tbl		makeuctb
-iso04_uni.h:		$(srcdir)/iso04_uni.tbl		makeuctb
-iso05_uni.h:		$(srcdir)/iso05_uni.tbl		makeuctb
-iso06_uni.h:		$(srcdir)/iso06_uni.tbl		makeuctb
-iso07_uni.h:		$(srcdir)/iso07_uni.tbl		makeuctb
-iso08_uni.h:		$(srcdir)/iso08_uni.tbl		makeuctb
-iso09_uni.h:		$(srcdir)/iso09_uni.tbl		makeuctb
-iso10_uni.h:		$(srcdir)/iso10_uni.tbl		makeuctb
-koi8r_uni.h:		$(srcdir)/koi8r_uni.tbl		makeuctb
-mac_uni.h:		$(srcdir)/mac_uni.tbl		makeuctb
-mnem_suni.h:		$(srcdir)/mnem_suni.tbl		makeuctb
-mnem2_suni.h:		$(srcdir)/mnem2_suni.tbl	makeuctb
-next_uni.h:		$(srcdir)/next_uni.tbl		makeuctb
-rfc_suni.h:		$(srcdir)/rfc_suni.tbl		makeuctb
-utf8_uni.h:		$(srcdir)/utf8_uni.tbl		makeuctb
-viscii_uni.h:		$(srcdir)/viscii_uni.tbl	makeuctb
+cp1250_uni.h:		$(srcdir)/cp1250_uni.tbl	makeuctb$x
+cp1251_uni.h:		$(srcdir)/cp1251_uni.tbl	makeuctb$x
+cp1252_uni.h:		$(srcdir)/cp1252_uni.tbl	makeuctb$x
+cp1253_uni.h:		$(srcdir)/cp1253_uni.tbl	makeuctb$x
+cp1255_uni.h:		$(srcdir)/cp1255_uni.tbl	makeuctb$x
+cp1256_uni.h:		$(srcdir)/cp1256_uni.tbl	makeuctb$x
+cp1257_uni.h:		$(srcdir)/cp1257_uni.tbl	makeuctb$x
+cp437_uni.h:		$(srcdir)/cp437_uni.tbl		makeuctb$x
+cp737_uni.h:		$(srcdir)/cp737_uni.tbl		makeuctb$x
+cp850_uni.h:		$(srcdir)/cp850_uni.tbl		makeuctb$x
+cp852_uni.h:		$(srcdir)/cp852_uni.tbl		makeuctb$x
+cp862_uni.h:		$(srcdir)/cp862_uni.tbl		makeuctb$x
+cp864_uni.h:		$(srcdir)/cp864_uni.tbl		makeuctb$x
+cp866_uni.h:		$(srcdir)/cp866_uni.tbl		makeuctb$x
+cp869_uni.h:		$(srcdir)/cp869_uni.tbl		makeuctb$x
+def7_uni.h:		$(srcdir)/def7_uni.tbl		makeuctb$x
+dmcs_uni.h:		$(srcdir)/dmcs_uni.tbl		makeuctb$x
+iso01_uni.h:		$(srcdir)/iso01_uni.tbl		makeuctb$x
+iso02_uni.h:		$(srcdir)/iso02_uni.tbl		makeuctb$x
+iso03_uni.h:		$(srcdir)/iso03_uni.tbl		makeuctb$x
+iso04_uni.h:		$(srcdir)/iso04_uni.tbl		makeuctb$x
+iso05_uni.h:		$(srcdir)/iso05_uni.tbl		makeuctb$x
+iso06_uni.h:		$(srcdir)/iso06_uni.tbl		makeuctb$x
+iso07_uni.h:		$(srcdir)/iso07_uni.tbl		makeuctb$x
+iso08_uni.h:		$(srcdir)/iso08_uni.tbl		makeuctb$x
+iso09_uni.h:		$(srcdir)/iso09_uni.tbl		makeuctb$x
+iso10_uni.h:		$(srcdir)/iso10_uni.tbl		makeuctb$x
+koi8r_uni.h:		$(srcdir)/koi8r_uni.tbl		makeuctb$x
+mac_uni.h:		$(srcdir)/mac_uni.tbl		makeuctb$x
+mnem_suni.h:		$(srcdir)/mnem_suni.tbl		makeuctb$x
+mnem2_suni.h:		$(srcdir)/mnem2_suni.tbl	makeuctb$x
+next_uni.h:		$(srcdir)/next_uni.tbl		makeuctb$x
+rfc_suni.h:		$(srcdir)/rfc_suni.tbl		makeuctb$x
+utf8_uni.h:		$(srcdir)/utf8_uni.tbl		makeuctb$x
+viscii_uni.h:		$(srcdir)/viscii_uni.tbl	makeuctb$x
 
 clean:
-	rm -f makeuctb *.o *uni.h *uni2.h
+	rm -f makeuctb$x *.o *uni.h *uni2.h
 
 distclean: clean
 	-rm -rf obsolete
diff --git a/src/chrtrans/makeuctb.c b/src/chrtrans/makeuctb.c
index f1417cb7..3e0c81c5 100644
--- a/src/chrtrans/makeuctb.c
+++ b/src/chrtrans/makeuctb.c
@@ -60,7 +60,7 @@ PRIVATE void usage ARGS1(
 }
 
 /* copied from HTString.c, not everybody has strncasecmp */
-PUBLIC int strncasecomp ARGS3(
+PRIVATE int strncasecomp ARGS3(
 	CONST char*,	a,
 	CONST char *,	b,
 	int,		n)
diff --git a/src/makefile.dos b/src/makefile.dos
index df12b6cb..91ace376 100644
--- a/src/makefile.dos
+++ b/src/makefile.dos
@@ -9,7 +9,7 @@ LYLeaks.o LYexit.o LYJump.o LYList.o LYCgi.o LYTraversal.o \
 LYEditmap.o LYCharSets.o LYCharUtils.o LYMap.o LYCookie.o LYExtern.o \

 LYStyle.o LYHash.o

 

-CFLAGS= $(MCFLAGS) -I.. $(SLANGINC)

+CFLAGS= $(MCFLAGS) -I. -I.. $(SLANGINC)

 

 CC = gcc

 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

diff --git a/src/makefile.in b/src/makefile.in
index e016a999..749c7a0a 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -2,6 +2,8 @@
 
 SHELL = /bin/sh
 
+x		= @PROG_EXT@
+
 @SET_MAKE@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -32,8 +34,10 @@ WWWLIB		= ../WWW/Library/unix/libwww.a
 CPP_OPTS	= $(DEFS) $(CPPFLAGS) \
 		-I. \
 		-I.. \
+		-Ichrtrans \
 		-I$(srcdir)/chrtrans \
 		-I$(top_srcdir) \
+		-I$(top_srcdir)/src \
 		-I$(top_srcdir)/$(WWWINC) \
 		$(SITE_DEFS)
 CC_OPTS		= $(CPP_OPTS) $(CFLAGS)
@@ -54,7 +58,7 @@ LYStyle.o LYHash.o $(CHARTRANS_OBJS) @LIBOBJS@
 
 C_SRC	= $(OBJS:.o=.c)
 
-all: lynx
+all: lynx$x
 
 .SUFFIXES : .i
 
@@ -66,11 +70,11 @@ all: lynx
 @RULE_CC@
 	@ECHO_CC@$(CPP) -C $(CPP_OPTS) $*.c >$@
 
-lynx:   message do_chartrans_stuff $(OBJS) $(WWWLIB)
+lynx$x:   message do_chartrans_stuff $(OBJS) $(WWWLIB)
 	@echo "Linking and creating Lynx executable"
-	$(CC) $(CC_OPTS) $(LDFLAGS) -o lynx  $(OBJS) $(WWWLIB) $(LIBS)
+	$(CC) $(CC_OPTS) $(LDFLAGS) -o $@  $(OBJS) $(WWWLIB) $(LIBS)
 	@echo "Copying Lynx executable into top-level directory"
-	cp lynx ..
+	cp $@ ..
 	@echo "Welcome to Lynx!"
 
 message:
@@ -87,7 +91,7 @@ lint:
 	$(LINT) $(LINTOPTS) $(CPP_OPTS) *.c  > ../lint.out
 
 clean:
-	rm -f lynx core *.[ob] *.bak
+	rm -f lynx$x core *.[ob] *.bak
 	cd chrtrans && $(MAKE) clean
 
 distclean: clean