 MANIFEST             |  132 ++--
 Makefile             |   20 
 README               |    6 
 aclocal.m4           |  412 +++++++++++--
 amiga/smakefile      |   22 
 configure            | 1511 ++++++++++++++++++++++++++++++---------------------
 configure.in         |   28 
 doc/CHANGES          |   77 ++
 doc/INSTALL          |    2 
 doc/TODO             |    2 
 doc/tin.1            |   91 +--
 include/autoconf.hin |    9 
 include/extern.h     |    2 
 include/proto.h      |    4 
 include/tin.h        |   63 +-
 include/version.h    |    2 
 makefile.in          |    2 
 pcre/ChangeLog       |   15 
 pcre/internal.h      |    4 
 pcre/maketables.c    |    2 
 pcre/pcre.3          |    2 
 pcre/pcre.c          |   28 
 pcre/pcre.h          |   12 
 pcre/pcreposix.3     |    2 
 pcre/pcreposix.c     |    4 
 pcre/pcreposix.h     |   12 
 pcre/pgrep.1         |    2 
 pcre/study.c         |    2 
 pcre/testinput       |    3 
 pcre/testinput2      |    4 
 pcre/testoutput      |    6 
 pcre/testoutput2     |    8 
 src/Makefile.in      |    4 
 src/active.c         |    4 
 src/art.c            |   17 
 src/attrib.c         |    9 
 src/auth.c           |   11 
 src/charset.c        |   10 
 src/color.c          |    8 
 src/config.c         |   25 
 src/curses.c         |   16 
 src/debug.c          |    6 
 src/descrip.mms      |    6 
 src/envarg.c         |    8 
 src/feed.c           |    8 
 src/filter.c         |   53 +
 src/getline.c        |    6 
 src/group.c          |    4 
 src/hashstr.c        |    8 
 src/header.c         |   12 
 src/help.c           |    4 
 src/inews.c          |    4 
 src/init.c           |   14 
 src/joinpath.c       |    4 
 src/lang.c           |    9 
 src/list.c           |    8 
 src/mail.c           |    8 
 src/main.c           |    4 
 src/makecfg.c        |    2 
 src/memory.c         |   11 
 src/misc.c           |  180 +++---
 src/newsrc.c         |    4 
 src/nntplib.c        |    9 
 src/nrctbl.c         |    4 
 src/open.c           |   12 
 src/page.c           |   10 
 src/parsdate.y       |    6 
 src/pgp.c            |    4 
 src/post.c           |   30 -
 src/prompt.c         |    4 
 src/read.c           |   26 
 src/refs.c           |    4 
 src/regex.c          |    6 
 src/rfc1521.c        |    2 
 src/rfc1522.c        |    4 
 src/save.c           |    6 
 src/screen.c         |  132 ----
 src/search.c         |    8 
 src/select.c         |   10 
 src/sigfile.c        |   21 
 src/signal.c         |   22 
 src/strftime.c       |    8 
 src/string.c         |   86 ++
 src/tcurses.c        |    4 
 src/thread.c         |   19 
 src/trace.c          |    4 
 src/xref.c           |   61 +-
 87 files changed, 2132 insertions, 1328 deletions

diff -Nur tin-980202/MANIFEST tin-980226/MANIFEST
--- tin-980202/MANIFEST	Mon Feb  2 15:40:44 1998
+++ tin-980226/MANIFEST	Thu Feb 26 16:39:07 1998
@@ -1,22 +1,22 @@
-MANIFEST for tin-pre-1.4-980202 (Mon Feb  2 15:40:43 CET 1998)
+MANIFEST for tin-pre-1.4-980226 (Thu Feb 26 16:39:06 CET 1998)
 ----------------------------------------------------
-   8557 ./Makefile
+   8543 ./Makefile
    4037 ./MANIFEST
-   1185 ./README
+   1188 ./README
    2208 ./README.VMS
-  45106 ./aclocal.m4
+  52600 ./aclocal.m4
     673 ./conf-tin
   20446 ./config.guess
   19236 ./config.sub
- 211286 ./configure
-  18477 ./configure.in
+ 218555 ./configure
+  18841 ./configure.in
    4765 ./install.sh
   11864 ./makefile.in
     661 ./mkdirs.sh
- 118396 ./doc/CHANGES
+ 121043 ./doc/CHANGES
    1469 ./doc/DEBUG_REFS
   16433 ./doc/INSTALL
-  15969 ./doc/TODO
+  15939 ./doc/TODO
    2881 ./doc/WHATSNEW
   12686 ./doc/auth.txt
    8383 ./doc/filtering
@@ -25,79 +25,79 @@
   34970 ./doc/minimal-netkeeping
    1615 ./doc/umlaute.txt
    3341 ./doc/tin.defaults
-  87658 ./doc/tin.1
+  87703 ./doc/tin.1
    1011 ./tools/metamutt
     896 ./tools/tinpp
    1661 ./tools/expand_aliases.tgz
    1193 ./include/bugrep.h
    8208 ./include/config.h
-  53918 ./include/extern.h
+  54047 ./include/extern.h
   13261 ./include/menukeys.h
    5089 ./include/nntplib.h
-  23708 ./include/proto.h
+  23808 ./include/proto.h
    2220 ./include/stpwatch.h
    2551 ./include/tcurses.h
-  49568 ./include/tin.h
+  49295 ./include/tin.h
    3392 ./include/tnntp.h
     971 ./include/trace.h
     991 ./include/version.h
   21217 ./src/active.c
-  37824 ./src/art.c
-  23464 ./src/attrib.c
-   9742 ./src/auth.c
-   8931 ./src/charset.c
-   7893 ./src/color.c
-  56098 ./src/config.c
-  20892 ./src/curses.c
-  11825 ./src/debug.c
-   2300 ./src/envarg.c
-  18832 ./src/feed.c
-  43851 ./src/filter.c
-  11249 ./src/getline.c
+  37804 ./src/art.c
+  23450 ./src/attrib.c
+   9716 ./src/auth.c
+   8925 ./src/charset.c
+   7874 ./src/color.c
+  56265 ./src/config.c
+  20886 ./src/curses.c
+  11824 ./src/debug.c
+   2305 ./src/envarg.c
+  18837 ./src/feed.c
+  44075 ./src/filter.c
+  11253 ./src/getline.c
   42218 ./src/group.c
-   2997 ./src/hashstr.c
-   7508 ./src/header.c
+   3003 ./src/hashstr.c
+   7490 ./src/header.c
   10468 ./src/help.c
    6817 ./src/inews.c
-  37193 ./src/init.c
+  37305 ./src/init.c
    1388 ./src/joinpath.c
-  85556 ./src/lang.c
-   2933 ./src/list.c
-  10131 ./src/mail.c
+  85695 ./src/lang.c
+   2938 ./src/list.c
+  10136 ./src/mail.c
   21829 ./src/main.c
    8674 ./src/makecfg.c
-   8467 ./src/memory.c
-  53032 ./src/misc.c
+   8468 ./src/memory.c
+  54245 ./src/misc.c
   34770 ./src/newsrc.c
-  23010 ./src/nntplib.c
+  23068 ./src/nntplib.c
    5771 ./src/nrctbl.c
-  22296 ./src/open.c
-  39314 ./src/page.c
-  24108 ./src/parsdate.y
+  22356 ./src/open.c
+  39319 ./src/page.c
+  24113 ./src/parsdate.y
    7753 ./src/pgp.c
-  89851 ./src/post.c
+  90377 ./src/post.c
   10108 ./src/prompt.c
-   7979 ./src/read.c
-  23373 ./src/refs.c
-   1776 ./src/regex.c
-  11877 ./src/rfc1521.c
-  22279 ./src/rfc1522.c
-  33159 ./src/save.c
-   7374 ./src/screen.c
-  11937 ./src/search.c
-  35453 ./src/select.c
-   5733 ./src/sigfile.c
-   9268 ./src/signal.c
-   5652 ./src/strftime.c
-   8955 ./src/string.c
+   8031 ./src/read.c
+  23377 ./src/refs.c
+   1783 ./src/regex.c
+  11879 ./src/rfc1521.c
+  22281 ./src/rfc1522.c
+  33156 ./src/save.c
+   5169 ./src/screen.c
+  11974 ./src/search.c
+  35490 ./src/select.c
+   5999 ./src/sigfile.c
+   9521 ./src/signal.c
+   5658 ./src/strftime.c
+   9901 ./src/string.c
    6159 ./src/tcurses.c
-  29088 ./src/thread.c
+  29065 ./src/thread.c
    1038 ./src/trace.c
    4336 ./src/wildmat.c
-   4911 ./src/xref.c
+   6080 ./src/xref.c
    4987 ./amiga/README
    5086 ./amiga/tin.readme
-  10650 ./amiga/smakefile
+   9999 ./amiga/smakefile
    4987 ./amiga/actived.c
   17223 ./amiga/amiga.c
    6373 ./amiga/amigatcp.c
@@ -125,7 +125,7 @@
    1705 ./vms/vmsfile.c
    5652 ./vms/vmspwd.c
     389 ./vms/vmstimval.h
-  10194 ./pcre/ChangeLog
+  10521 ./pcre/ChangeLog
    2020 ./pcre/Makefile.in
    2243 ./pcre/Makefile.orig
    7165 ./pcre/Performance
@@ -135,25 +135,25 @@
   45325 ./pcre/pcre.3
    5063 ./pcre/pcreposix.3
    4557 ./pcre/maketables.c
- 103422 ./pcre/pcre.c
-   7553 ./pcre/pcreposix.c
+ 103700 ./pcre/pcre.c
+   7563 ./pcre/pcreposix.c
    4756 ./pcre/pgrep.c
    9003 ./pcre/study.c
   11016 ./pcre/internal.h
-   1625 ./pcre/pcre.h
-   2039 ./pcre/pcreposix.h
+   1739 ./pcre/pcre.h
+   2154 ./pcre/pcreposix.h
   19543 ./pcre/pcretest.c
    2988 ./pcre/perltest
-  46538 ./pcre/testinput
-   3714 ./pcre/testinput2
-  54973 ./pcre/testoutput
-  12137 ./pcre/testoutput2
-   9025 ./include/autoconf.hin
-  11955 ./src/Makefile.in
+  48592 ./pcre/testinput
+   3745 ./pcre/testinput2
+  57771 ./pcre/testoutput
+  12322 ./pcre/testoutput2
+   9091 ./include/autoconf.hin
+  11951 ./src/Makefile.in
    4278 ./src/l1_next.tab
    4278 ./src/next_l1.tab
    4413 ./src/tincfg.tbl
-   8787 ./src/descrip.mms
+   8747 ./src/descrip.mms
    1677 ./pcre/pcre.mms
    7092 ./old/msmail.c
    4443 ./old/nntpvms.c
@@ -165,4 +165,4 @@
    2225 ./old/os_2.h
    3753 ./old/win32.h
     786 ./old/win32tcp.h
-2581436 total
+2607433 total
diff -Nur tin-980202/Makefile tin-980226/Makefile
--- tin-980202/Makefile	Mon Feb  2 13:41:35 1998
+++ tin-980226/Makefile	Thu Feb 26 16:09:33 1998
@@ -1,15 +1,15 @@
 # Top level Makefile for tin
 # - for configuration options read the doc/INSTALL file.
 #
-# Updated   : 31.12.1997
+# Updated: 1998-02-15
 #
 
-PROJECT		= tin
-EXE		= tin
-MANEXT		= 1
-LVER		= 1.4
-PVER		= 980202
-VER		= pre-$(LVER)-$(PVER)
+PROJECT	= tin
+EXE	= tin
+MANEXT	= 1
+LVER	= 1.4
+PVER	= 980226
+VER	= pre-$(LVER)-$(PVER)
 
 # directory structure
 TOPDIR	= .
@@ -187,7 +187,7 @@
 	$(PCREDIR)/testoutput \
 	$(PCREDIR)/testoutput2
 
-OLD    = \
+OLD	= \
 	$(OLDDIR)/msmail.c \
 	$(OLDDIR)/nntpvms.c \
 	$(OLDDIR)/nntpw32.c \
@@ -315,9 +315,9 @@
 # I know it's ugly, but it works
 #
 name:
-	@DATE=`date +%y%m%d`;  if test `pwd | cut -d '-' -f 2` != $$DATE ; then \
+	@DATE=`date +%y%m%d`; if test `pwd | cut -d '-' -f 2` != $$DATE ; then \
 	$(MV) ../`basename \`pwd\`` ../tin-$$DATE ; \
-	$(SED) "s,^PVER[[:space:]]*=[[:print:]]*,PVER		= $$DATE," ./Makefile > ./Makefile.tmp \
+	$(SED) "s,^PVER[[:space:]]*=[[:print:]]*,PVER	= $$DATE," ./Makefile > ./Makefile.tmp \
 	&& $(MV) ./Makefile.tmp ./Makefile ; \
 	$(SED) "s,RELEASEDATE[[:space:]]*\"[[:print:]]*\",RELEASEDATE	\"$$DATE\"," $(INCDIR)/version.h > $(INCDIR)/version.h.tmp \
 	&& $(MV) $(INCDIR)/version.h.tmp $(INCDIR)/version.h ; \
diff -Nur tin-980202/README tin-980226/README
--- tin-980202/README	Sat Jan 17 23:09:17 1998
+++ tin-980226/README	Mon Feb  9 02:30:04 1998
@@ -6,8 +6,8 @@
 Quick Install:
 
 configure to your local setup (have a look at):
-	configure --help
-	conf-tin
+	./configure --help
+	./conf-tin
 
 check your local setup in:
 	include/autoconf.h
@@ -28,7 +28,7 @@
 
 The latest release is available at:
 <ftp://ftp.tin.org/pub/news/clients/tin/current/>
-or it's mirrors.
+or its mirrors.
 
 If you have additional questions or like to be informed about the
 latest new features/version you may subscribe to the (developers)
diff -Nur tin-980202/aclocal.m4 tin-980226/aclocal.m4
--- tin-980202/aclocal.m4	Fri Dec 26 03:40:46 1997
+++ tin-980226/aclocal.m4	Sat Feb 21 19:56:44 1998
@@ -2,10 +2,10 @@
 dnl Module    : aclocal.m4
 dnl Author    : Thomas E. Dickey <dickey@clark.net>
 dnl Created   : 24.08.95
-dnl Updated   : 04.12.97
+dnl Updated   : 20.02.98
 dnl Notes     :
 dnl
-dnl Copyright 1996,1997 by Thomas Dickey
+dnl Copyright 1996,1997,1998 by Thomas Dickey
 dnl             You may  freely  copy or  redistribute  this software,
 dnl             so  long as there is no profit made from its use, sale
 dnl             trade or  reproduction.  You may not change this copy-
@@ -242,6 +242,34 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl Check if curses supports color.  (Note that while SVr3 curses supports
+dnl color, it does this differently from SVr4 curses; more work would be needed
+dnl to accommodate SVr3).
+dnl 
+AC_DEFUN([CF_COLOR_CURSES],
+[
+AC_MSG_CHECKING(if curses supports color attributes)
+AC_CACHE_VAL(cf_cv_color_curses,[
+	AC_TRY_LINK([
+#include <$cf_cv_ncurses_header>
+],
+	[chtype x = COLOR_BLUE;
+	 has_colors();
+	 start_color();
+#ifndef NCURSES_BROKEN
+	 wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */
+#endif
+	],
+	[cf_cv_color_curses=yes],
+	[cf_cv_color_curses=no])
+	])
+AC_MSG_RESULT($cf_cv_color_curses)
+if test $cf_cv_color_curses = yes ; then
+	AC_DEFINE(COLOR_CURSES)
+	test ".$cf_cv_ncurses_broken" != .yes && AC_DEFINE(HAVE_GETBKGD)
+fi
+])
+dnl ---------------------------------------------------------------------------
 dnl Check if the application can dump core (for debugging).
 AC_DEFUN([CF_COREFILE],
 [
@@ -335,40 +363,173 @@
 		# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
 		LIBS="-lHcurses $LIBS"
 		CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
+		ac_cv_func_initscr=yes
 		],[
 	AC_CHECK_LIB(cur_color,initscr,[
 		LIBS="-lcur_color $LIBS"
 		CFLAGS="-I/usr/include/curses_colr $CFLAGS"
+		ac_cv_func_initscr=yes
 		])])
 	;;
 esac
+
+if test ".$With5lib" != ".no" ; then
 if test -d /usr/5lib ; then
 	# SunOS 3.x or 4.x
 	CPPFLAGS="$CPPFLAGS -I/usr/5include"
 	LIBS="$LIBS -L/usr/5lib"
-# FIXME: check if we need/use -R option
-# elif test -d /usr/ccs/lib ; then
-# 	# Solaris 5.x
-# 	LIBS="$LIBS -L/usr/ccs/lib -R/usr/ccs/lib"
+fi
+fi
+
+if test ".$ac_cv_func_initscr" != .yes ; then
+	cf_save_LIBS="$LIBS"
+	cf_term_lib=""
+	cf_curs_lib=""
+
+	# Check for library containing tgoto.  Do this before curses library
+	# because it may be needed to link the test-case for initscr.
+	AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
+		for cf_term_lib in termcap termlib unknown
+		do
+			AC_CHECK_LIB($cf_term_lib,tgoto,[break])
+		done
+	])
+
+	# Check for library containing initscr
+	test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+	for cf_curs_lib in curses ncurses xcurses cursesX jcurses unknown
+	do
+		AC_CHECK_LIB($cf_curs_lib,initscr,[break])
+	done
+	test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
+
+	LIBS="-l$cf_curs_lib $cf_save_LIBS"
+	if test "$cf_term_lib" = unknown ; then
+		AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
+		AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+			[initscr()],
+			[cf_result=yes],
+			[cf_result=no])
+		AC_MSG_RESULT($cf_result)
+		test $cf_result = no && AC_ERROR(Cannot link curses library)
+	elif test "$cf_term_lib" != predefined ; then
+		AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
+		AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+			[initscr(); tgoto((char *)0, 0, 0);],
+			[cf_result=no],
+			[
+			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+			AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+				[initscr()],
+				[cf_result=yes],
+				[cf_result=error])
+			])
+		AC_MSG_RESULT($cf_result)
+	fi
 fi
 
-cf_save_LIBS="$LIBS"
-AC_CHECK_FUNC(tgoto,[
-	AC_CHECK_LIB(curses,initscr,,[
-		AC_ERROR(cannot link curses)])
-],[
-AC_CHECK_LIB(termcap, tgoto,[
-	LIBS="-ltermcap $cf_save_LIBS"
-	AC_CHECK_LIB(curses,initscr,,[
-		AC_CHECK_LIB(cursesX,initscr,,[
-			AC_CHECK_LIB(jcurses,initscr,,[
-				AC_ERROR(cannot link curses)])])])
-	],[
-	AC_CHECK_LIB(curses,initscr,,[
-		AC_ERROR(cannot link curses)])])
-])
 ])])
 dnl ---------------------------------------------------------------------------
+dnl Check if we should include <curses.h> to pick up prototypes for termcap
+dnl functions.  On terminfo systems, these are normally declared in <curses.h>,
+dnl but may be in <term.h>.  We check for termcap.h as an alternate, but it
+dnl isn't standard (usually associated with GNU termcap).
+dnl
+dnl The 'tgoto()' function is declared in both terminfo and termcap.
+dnl
+dnl See CF_TYPE_OUTCHAR for more details.
+AC_DEFUN([CF_CURSES_TERMCAP],
+[
+AC_REQUIRE([CF_CURSES_TERM_H])
+AC_MSG_CHECKING(if we should include curses.h or termcap.h)
+AC_CACHE_VAL(cf_cv_need_curses_h,[
+cf_save_CFLAGS="$CFLAGS"
+cf_cv_need_curses_h=no
+
+for cf_t_opts in "" "NEED_TERMCAP_H"
+do
+for cf_c_opts in "" "NEED_CURSES_H"
+do
+
+    CFLAGS="$cf_save_CFLAGS $CHECK_DECL_FLAG"
+    test -n "$cf_c_opts" && CFLAGS="$CFLAGS -D$cf_c_opts"
+    test -n "$cf_t_opts" && CFLAGS="$CFLAGS -D$cf_t_opts"
+
+    AC_TRY_LINK([/* $cf_c_opts $cf_t_opts */
+$CHECK_DECL_HDRS],
+	[char *x = (char *)tgoto("")],
+	[test "$cf_cv_need_curses_h" = no && {
+	     cf_cv_need_curses_h=maybe
+	     cf_ok_c_opts=$cf_c_opts
+	     cf_ok_t_opts=$cf_t_opts
+	}],
+	[echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&AC_FD_CC
+	AC_TRY_LINK([
+$CHECK_DECL_HDRS],
+	[char *x = (char *)tgoto("",0,0)],
+	[cf_cv_need_curses_h=yes
+	 cf_ok_c_opts=$cf_c_opts
+	 cf_ok_t_opts=$cf_t_opts])])
+
+	CFLAGS="$cf_save_CFLAGS"
+	test "$cf_cv_need_curses_h" = yes && break
+done
+	test "$cf_cv_need_curses_h" = yes && break
+done
+
+if test "$cf_cv_need_curses_h" != no ; then
+	echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T:$cf_ok_t_opts)" >&AC_FD_CC
+	if test -n "$cf_ok_c_opts" ; then
+		if test -n "$cf_ok_t_opts" ; then
+			cf_cv_need_curses_h=both
+		else
+			cf_cv_need_curses_h=curses.h
+		fi
+	elif test -n "$cf_ok_t_opts" ; then
+		cf_cv_need_curses_h=termcap.h
+	elif test "$cf_cv_have_term_h" = yes ; then
+		cf_cv_need_curses_h=term.h
+	else 
+		cf_cv_need_curses_h=no
+	fi
+fi
+])
+AC_MSG_RESULT($cf_cv_need_curses_h)
+
+case $cf_cv_need_curses_h in
+both) #(vi
+	AC_DEFINE_UNQUOTED(NEED_CURSES_H)
+	AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
+	;;
+curses.h) #(vi
+	AC_DEFINE_UNQUOTED(NEED_CURSES_H)
+	;;
+termcap.h) #(vi
+	AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
+	;;
+esac
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl SVr4 curses should have term.h as well (where it puts the definitions of
+dnl the low-level interface).  This may not be true in old/broken implementations,
+dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
+dnl running with Solaris 2.5.1).
+AC_DEFUN([CF_CURSES_TERM_H],
+[
+AC_MSG_CHECKING([for term.h])
+AC_CACHE_VAL(cf_cv_have_term_h,[
+	AC_TRY_COMPILE([
+#include <curses.h>
+#include <term.h>],
+	[WINDOW *x],
+	[cf_cv_have_term_h=yes],
+	[cf_cv_have_term_h=no])
+	])
+AC_MSG_RESULT($cf_cv_have_term_h)
+test $cf_cv_have_term_h = yes && AC_DEFINE(HAVE_TERM_H)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl Check if 'errno' is declared in <errno.h>
 AC_DEFUN([CF_ERRNO],
 [
@@ -415,6 +576,11 @@
 if test $cf_cv_have_lib_$1 = no ; then
 	AC_ERROR(Cannot link $1 library)
 fi
+case $host_os in #(vi
+linux*) # Suse Linux does not follow /usr/lib convention
+	$1="[$]$1 /lib"
+	;;
+esac
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl Check if 'fork()' is available, and working.  Amiga (and possibly other
@@ -737,7 +903,7 @@
 
 LIBS="$cf_ncurses_LIBS $LIBS"
 CF_FIND_LIBRARY(ncurses,
-	[#include <$cf_cv_ncurses_header>],
+	[#include <${cf_cv_ncurses_header-curses.h}>],
 	[initscr()],
 	initscr)
 
@@ -750,7 +916,7 @@
 			LIBS="$q"
 		fi
 	done
-	AC_TRY_LINK([#include <$cf_cv_ncurses_header>],
+	AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
 		[initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
 		[AC_MSG_RESULT(yes)],
 		[AC_MSG_RESULT(no)
@@ -765,7 +931,7 @@
 	cf_cv_ncurses_version=no
 	cf_tempfile=out$$
 	AC_TRY_RUN([
-#include <$cf_cv_ncurses_header>
+#include <${cf_cv_ncurses_header-curses.h}>
 int main()
 {
 	FILE *fp = fopen("$cf_tempfile", "w");
@@ -790,7 +956,7 @@
 	# This will not work if the preprocessor splits the line after the
 	# Autoconf token.  The 'unproto' program does that.
 	cat > conftest.$ac_ext <<EOF
-#include <$cf_cv_ncurses_header>
+#include <${cf_cv_ncurses_header-curses.h}>
 #undef Autoconf
 #ifdef NCURSES_VERSION
 Autoconf NCURSES_VERSION
@@ -854,6 +1020,80 @@
 test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl Look for the default editor (vi)
+AC_DEFUN([CF_PATH_EDITOR],
+[
+AC_MSG_CHECKING(for default editor)
+AC_ARG_WITH(editor,
+    [  --with-editor=PROG      specify editor (default: vi)],
+    [DEFAULT_EDITOR=$withval],[
+if test -z "$DEFAULT_EDITOR" ; then
+    if test -n "$EDITOR" ; then
+    	DEFAULT_EDITOR="$EDITOR"
+    elif test -n "$VISUAL" ; then
+    	DEFAULT_EDITOR="$VISUAL"
+    else
+	AC_PATH_PROG(DEFAULT_EDITOR,vi,vi,$PATH:/usr/bin:/usr/ucb)
+    fi
+fi
+])
+AC_MSG_RESULT($DEFAULT_EDITOR)
+AC_DEFINE_UNQUOTED(DEFAULT_EDITOR,"$DEFAULT_EDITOR")
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl Look for the directory that contains incoming mail.  I would check for an
+dnl actual mail-file, to verify this, but that is not always easy to arrange.
+AC_DEFUN([CF_PATH_MAILBOX],
+[
+AC_MSG_CHECKING(for incoming-mail directory)
+AC_ARG_WITH(mailbox,
+    [  --with-mailbox=DIR      directory for incoming mailboxes],
+    [DEFAULT_MAILBOX=$withval],[
+if test -z "$DEFAULT_MAILBOX" ; then
+for cf_dir in \
+	/var/spool/mail \
+	/usr/spool/mail \
+	/var/mail \
+	/usr/mail \
+	/mail
+    do
+    	if test -d $cf_dir ; then
+	    DEFAULT_MAILBOX=$cf_dir
+	    break
+	fi
+    done
+fi
+])
+if test -n "$DEFAULT_MAILBOX" ; then
+	AC_DEFINE_UNQUOTED(DEFAULT_MAILBOX,"$DEFAULT_MAILBOX")
+else
+	DEFAULT_MAILBOX=none
+fi
+AC_MSG_RESULT($DEFAULT_MAILBOX)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl Look for the program that sends outgoing mail.
+AC_DEFUN([CF_PATH_MAILER],
+[
+AC_PATH_PROG(DEFAULT_MAILER,sendmail,,$PATH:/usr/sbin:/usr/lib)
+AC_ARG_WITH(mailer,
+     [  --with-mailer=PROG      specify default mailer-program],
+     [DEFAULT_MAILER=$withval],[
+if test -z "$DEFAULT_MAILER" ; then
+AC_PATH_PROG(DEFAULT_MAILER,mailx,,$PATH:/usr/bin)
+fi
+if test -z "$DEFAULT_MAILER" ; then
+AC_PATH_PROG(DEFAULT_MAILER,mail,,$PATH:/usr/bin)
+fi
+if test -n "$DEFAULT_MAILER" ; then
+	AC_DEFINE_UNQUOTED(DEFAULT_MAILER,"$DEFAULT_MAILER")
+else
+	DEFAULT_MAILER=none
+fi
+AC_MSG_RESULT($DEFAULT_MAILER)
+])
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl See if sum can take -r
 AC_DEFUN([CF_PROG_SUM_R],
 [
@@ -953,44 +1193,6 @@
 	[[$]$3])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl Check if there is a conflict between <sys/select.h> and <sys/time.h>.
-dnl This is known to be a problem with SCO.
-AC_DEFUN([CF_SYS_SELECT_TIMEVAL],
-[
-AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h)
-AC_CACHE_VAL(cf_cv_sys_select_timeval,[
-for cf_opts in no yes
-do
-AC_TRY_COMPILE([
-#define yes 1
-#define no 0
-#if $cf_opts
-#define timeval fake_timeval
-#endif
-#ifdef TIME_WITH_SYS_TIME
-#	include <sys/time.h>
-#	include <time.h>
-#else
-#	ifdef HAVE_SYS_TIME_H
-#		include <sys/time.h>
-#	else
-#		include <time.h>
-#	endif
-#endif
-#undef timeval
-#ifdef HAVE_SYS_SELECT_H
-#	include <sys/select.h>
-#endif
-],[struct timeval foo],
-	[cf_cv_sys_select_timeval=$cf_opts
-	 break],
-	[cf_cv_sys_select_timeval=no])
-done
-])
-AC_MSG_RESULT($cf_cv_sys_select_timeval)
-test $cf_cv_sys_select_timeval = yes && AC_DEFINE(NEED_TIMEVAL_FIX)
-])
-dnl ---------------------------------------------------------------------------
 dnl Check for the functions that set effective/real uid/gid.  This has to
 dnl follow the AC_CHECK_FUNCS call.
 AC_DEFUN([CF_SET_GID_UID],
@@ -1183,6 +1385,45 @@
 	AC_ERROR("Please remove config.cache and try again.")
 fi])
 dnl ---------------------------------------------------------------------------
+dnl Check if there is a conflict between <sys/select.h> and <sys/time.h>.
+dnl This is known to be a problem with SCO.
+AC_DEFUN([CF_SYS_SELECT_TIMEVAL],
+[
+AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h)
+AC_CACHE_VAL(cf_cv_sys_select_timeval,[
+for cf_opts in no yes
+do
+AC_TRY_COMPILE([
+#define yes 1
+#define no 0
+#if $cf_opts
+#define timeval fake_timeval
+#endif
+#include <sys/types.h>
+#ifdef TIME_WITH_SYS_TIME
+#	include <sys/time.h>
+#	include <time.h>
+#else
+#	ifdef HAVE_SYS_TIME_H
+#		include <sys/time.h>
+#	else
+#		include <time.h>
+#	endif
+#endif
+#undef timeval
+#ifdef HAVE_SYS_SELECT_H
+#	include <sys/select.h>
+#endif
+],[struct timeval foo],
+	[cf_cv_sys_select_timeval=$cf_opts
+	 break],
+	[cf_cv_sys_select_timeval=no])
+done
+])
+AC_MSG_RESULT($cf_cv_sys_select_timeval)
+test $cf_cv_sys_select_timeval = yes && AC_DEFINE(NEED_TIMEVAL_FIX)
+])
+dnl ---------------------------------------------------------------------------
 dnl See if we can link with the termios functions tcsetattr/tcgetattr
 AC_DEFUN([CF_TERMIOS],
 [
@@ -1288,29 +1529,42 @@
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl Check for return and param type of 3rd -- OutChar() -- param of tputs().
+dnl
+dnl For this check, and for CF_CURSES_TERMCAP, the $CHECK_DECL_HDRS variable
+dnl must point to a header file containing this (or equivalent):
+dnl
+dnl	#ifdef NEED_CURSES_H
+dnl	# if HAVE_NCURSES_H
+dnl	#  include <ncurses.h>
+dnl	# else
+dnl	#  include <curses.h>
+dnl	# endif
+dnl	#endif
+dnl	#if HAVE_TERM_H
+dnl	# include <term.h>
+dnl	#endif
+dnl	#if NEED_TERMCAP_H
+dnl	# include <termcap.h>
+dnl	#endif
+dnl
 AC_DEFUN([CF_TYPE_OUTCHAR],
-[AC_MSG_CHECKING([declaration of tputs 3rd param])
+[
+AC_REQUIRE([CF_CURSES_TERMCAP])
+
+AC_MSG_CHECKING([declaration of tputs 3rd param])
 AC_CACHE_VAL(cf_cv_type_outchar,[
+
 cf_cv_type_outchar="int OutChar(int)"
 cf_cv_found=no
+cf_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
+
 for P in int void; do
 for Q in int void; do
 for R in int char; do
 for S in "" const; do
-	AC_TRY_COMPILE([
-#ifdef USE_TERMINFO
-#include <curses.h>
-#if HAVE_TERM_H
-#include <term.h>
-#endif
-#else
-#ifdef NEED_CURSES_H	/* FIXME: need a test */
-#include <curses.h>
-#endif
-#if HAVE_TERMCAP_H
-#include <termcap.h>
-#endif
-#endif ],
+
+	AC_TRY_COMPILE([$CHECK_DECL_HDRS],
 	[extern $Q OutChar($R);
 	extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
 	tputs("", 1, OutChar)],
@@ -1336,6 +1590,8 @@
 	AC_DEFINE(OUTC_ARGS,char c)
 	;;
 esac
+
+CFLAGS="$cf_save_CFLAGS"
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl
diff -Nur tin-980202/amiga/smakefile tin-980226/amiga/smakefile
--- tin-980202/amiga/smakefile	Fri Dec 26 03:40:48 1997
+++ tin-980226/amiga/smakefile	Thu Feb 19 19:27:31 1998
@@ -1,5 +1,5 @@
 #
-# $VER: tin_makefile 2.2a (14.12.97)
+# $VER: tin_makefile 2.2b (19.02.97)
 #
 # This is especially for use with the SAS/C developing system
 # version 6.55 and above
@@ -105,16 +105,12 @@
         $(INCDIR)/config.h \
         $(INCDIR)/extern.h \
         $(INCDIR)/menukeys.h \
-        $(INCDIR)/msmail.h \
         $(INCDIR)/nntplib.h \
-        $(INCDIR)/os_2.h \
         $(REDIR)/pcre.h \
         $(INCDIR)/proto.h \
         $(INCDIR)/stpwatch.h \
         $(INCDIR)/tin.h \
         $(INCDIR)/version.h \
-        $(INCDIR)/win32.h \
-        $(INCDIR)/win32tcp.h
 #/*vb*/  $(INCDIR)/conf.h \
 
 #
@@ -152,13 +148,10 @@
         $(OBJDIR)/main.o \
         $(OBJDIR)/memory.o \
         $(OBJDIR)/misc.o \
-        $(OBJDIR)/msmail.o \
         $(OBJDIR)/newsrc.o\
         $(OBJDIR)/nntplib.o \
-        $(OBJDIR)/nntpw32.o \
         $(OBJDIR)/nrctbl.o \
         $(OBJDIR)/open.o \
-        $(OBJDIR)/os_2.o \
         $(OBJDIR)/page.o \
         $(OBJDIR)/parsdate.o \
         $(OBJDIR)/pcre.o \
@@ -168,8 +161,8 @@
         $(OBJDIR)/read.o \
         $(OBJDIR)/refs.o \
         $(OBJDIR)/regex.o \
-        $(OBJDIR)/rfc1521.o\
-        $(OBJDIR)/rfc1522.o\
+        $(OBJDIR)/rfc1521.o \
+        $(OBJDIR)/rfc1522.o \
         $(OBJDIR)/save.o \
         $(OBJDIR)/screen.o \
         $(OBJDIR)/search.o \
@@ -180,10 +173,7 @@
         $(OBJDIR)/string.o \
         $(OBJDIR)/study.o \
         $(OBJDIR)/thread.o \
-        $(OBJDIR)/vms.o \
         $(OBJDIR)/wildmat.o \
-        $(OBJDIR)/win32.o \
-        $(OBJDIR)/win32tcp.o \
         $(OBJDIR)/xref.o \
 # (obw)  $(OBJDIR)/_tzset.o \
 #        $(OBJDIR)/parsdate.c \
@@ -277,13 +267,10 @@
 $(OBJDIR)/maketables.o:         $(REDIR)/maketables.c $(GSTFILE)
 $(OBJDIR)/memory.o:             $(SRCDIR)/memory.c $(GSTFILE)
 $(OBJDIR)/misc.o:               $(SRCDIR)/misc.c $(GSTFILE)
-$(OBJDIR)/msmail.o:             $(SRCDIR)/msmail.c $(GSTFILE)
 $(OBJDIR)/newsrc.o:             $(SRCDIR)/newsrc.c $(GSTFILE)
 $(OBJDIR)/nntplib.o:            $(SRCDIR)/nntplib.c $(GSTFILE)
-$(OBJDIR)/nntpw32.o:            $(SRCDIR)/nntpw32.c $(GSTFILE)
 $(OBJDIR)/nrctbl.o:             $(SRCDIR)/nrctbl.c $(GSTFILE)
 $(OBJDIR)/open.o:               $(SRCDIR)/open.c $(GSTFILE)
-$(OBJDIR)/os_2.o:               $(SRCDIR)/os_2.c $(GSTFILE)
 $(OBJDIR)/page.o:               $(SRCDIR)/page.c $(GSTFILE)
 #$(OBJDIR)/parsdate.o:           $(AMIDIR)/parsdate.c $(GSTFILE)
 $(OBJDIR)/parsdate.o:           $(SRCDIR)/parsdate.c $(GSTFILE)
@@ -307,8 +294,5 @@
 $(OBJDIR)/string.o:             $(SRCDIR)/string.c $(GSTFILE)
 $(OBJDIR)/study.o:              $(REDIR)/study.c $(GSTFILE)
 $(OBJDIR)/thread.o:             $(SRCDIR)/thread.c $(GSTFILE)
-$(OBJDIR)/vms.o:                $(SRCDIR)/vms.c $(GSTFILE)
 $(OBJDIR)/wildmat.o:            $(SRCDIR)/wildmat.c $(GSTFILE)
-$(OBJDIR)/win32.o:              $(SRCDIR)/win32.c $(GSTFILE)
-$(OBJDIR)/win32tcp.o:           $(SRCDIR)/win32tcp.c $(GSTFILE)
 $(OBJDIR)/xref.o:               $(SRCDIR)/xref.c $(GSTFILE)
diff -Nur tin-980202/configure tin-980226/configure
--- tin-980202/configure	Sat Jan 31 06:27:59 1998
+++ tin-980226/configure	Sat Feb 21 19:57:03 1998
@@ -23,6 +23,12 @@
 ac_help="$ac_help
   --with-sum              (default: from system path)"
 ac_help="$ac_help
+  --with-editor=PROG      specify editor (default: vi)"
+ac_help="$ac_help
+  --with-mailer=PROG      specify default mailer-program"
+ac_help="$ac_help
+  --with-mailbox=DIR      directory for incoming mailboxes"
+ac_help="$ac_help
   --disable-nntp          disable reading via NNTP (default: on)"
 ac_help="$ac_help
   --enable-nntp-only      enable reading via NNTP only (default: off)"
@@ -633,7 +639,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:637: checking host system type" >&5
+echo "configure:643: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -717,7 +723,7 @@
 			# Extract the first word of "xlc", so it can be a program name with args.
 set dummy xlc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:721: checking for $ac_word" >&5
+echo "configure:727: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XLC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -760,7 +766,7 @@
 # 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:764: checking for $ac_word" >&5
+echo "configure:770: 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
@@ -789,7 +795,7 @@
   # 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:793: checking for $ac_word" >&5
+echo "configure:799: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -837,7 +843,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:841: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:847: 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.
@@ -847,11 +853,11 @@
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 851 "configure"
+#line 857 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:861: \"$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
@@ -871,12 +877,12 @@
   { 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:875: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:881: 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:880: checking whether we are using GNU C" >&5
+echo "configure:886: 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
@@ -885,7 +891,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:889: \"$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:895: \"$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
@@ -900,7 +906,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:904: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:910: 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
@@ -928,7 +934,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:932: checking how to run the C preprocessor" >&5
+echo "configure:938: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -943,13 +949,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 947 "configure"
+#line 953 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -960,13 +966,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 964 "configure"
+#line 970 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -990,13 +996,13 @@
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:994: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1000: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 1000 "configure"
+#line 1006 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
@@ -1014,7 +1020,7 @@
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 1018 "configure"
+#line 1024 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
@@ -1036,7 +1042,7 @@
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1040: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1046: 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
@@ -1073,7 +1079,7 @@
 # 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:1077: checking for a BSD compatible install" >&5
+echo "configure:1083: 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
@@ -1125,7 +1131,7 @@
 # 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:1129: checking for $ac_word" >&5
+echo "configure:1135: 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
@@ -1176,14 +1182,14 @@
   do
     rm -f y.tab.ch
     echo $ac_n "checking for $cf_prog""... $ac_c" 1>&6
-echo "configure:1180: checking for $cf_prog" >&5
+echo "configure:1186: checking for $cf_prog" >&5
     cf_command="$cf_prog conftest.y"
     cf_result=no
-    if { (eval echo configure:1183: \"$cf_command\") 1>&5; (eval $cf_command) 2>&5; } && test -s y.tab.c ; then
+    if { (eval echo configure:1189: \"$cf_command\") 1>&5; (eval $cf_command) 2>&5; } && test -s y.tab.c ; then
       mv y.tab.c conftest.c
       rm -f y.tab.h
       if test "$cf_prog" = 'bison -y' ; then
-        if { (eval echo configure:1187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest ; then
+        if { (eval echo configure:1193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest ; then
           cf_result=yes
         fi
       else
@@ -1207,7 +1213,7 @@
 # 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:1211: checking for $ac_word" >&5
+echo "configure:1217: 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
@@ -1237,7 +1243,7 @@
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1241: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:1247: 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
@@ -1255,7 +1261,7 @@
 do
 	CFLAGS="$cf_save_CFLAGS $cf_arg"
 	cat > conftest.$ac_ext <<EOF
-#line 1259 "configure"
+#line 1265 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -1271,7 +1277,7 @@
 	struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:1275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -1320,7 +1326,7 @@
   *)
    # user supplied option-value for "--with-ispell=path"
    echo $ac_n "checking for ispell""... $ac_c" 1>&6
-echo "configure:1324: checking for ispell" >&5
+echo "configure:1330: checking for ispell" >&5
    ac_cv_path_PATH_ISPELL="$withval"
    cat >> confdefs.h <<\EOF
 #define HAVE_ISPELL 1
@@ -1334,7 +1340,7 @@
   # Extract the first word of "ispell", so it can be a program name with args.
 set dummy ispell; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1338: checking for $ac_word" >&5
+echo "configure:1344: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_ISPELL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1387,7 +1393,7 @@
   *)
    # user supplied option-value for "--with-metamail=path"
    echo $ac_n "checking for metamail""... $ac_c" 1>&6
-echo "configure:1391: checking for metamail" >&5
+echo "configure:1397: checking for metamail" >&5
    ac_cv_path_PATH_METAMAIL="$withval"
    cat >> confdefs.h <<\EOF
 #define HAVE_METAMAIL 1
@@ -1401,7 +1407,7 @@
   # Extract the first word of "metamail", so it can be a program name with args.
 set dummy metamail; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1405: checking for $ac_word" >&5
+echo "configure:1411: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_METAMAIL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1454,7 +1460,7 @@
   *)
    # user supplied option-value for "--with-pgp=path"
    echo $ac_n "checking for pgp""... $ac_c" 1>&6
-echo "configure:1458: checking for pgp" >&5
+echo "configure:1464: checking for pgp" >&5
    ac_cv_path_PATH_PGP="$withval"
    cat >> confdefs.h <<\EOF
 #define HAVE_PGP 1
@@ -1468,7 +1474,7 @@
   # Extract the first word of "pgp", so it can be a program name with args.
 set dummy pgp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1472: checking for $ac_word" >&5
+echo "configure:1478: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_PGP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1521,7 +1527,7 @@
   *)
    # user supplied option-value for "--with-sum=path"
    echo $ac_n "checking for sum""... $ac_c" 1>&6
-echo "configure:1525: checking for sum" >&5
+echo "configure:1531: checking for sum" >&5
    ac_cv_path_PATH_SUM="$withval"
    cat >> confdefs.h <<\EOF
 #define HAVE_SUM 1
@@ -1535,7 +1541,7 @@
   # Extract the first word of "sum", so it can be a program name with args.
 set dummy sum; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1539: checking for $ac_word" >&5
+echo "configure:1545: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_SUM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1578,12 +1584,12 @@
 if test $ac_cv_path_PATH_SUM
 then
 echo $ac_n "checking if $ac_cv_path_PATH_SUM takes -r""... $ac_c" 1>&6
-echo "configure:1582: checking if $ac_cv_path_PATH_SUM takes -r" >&5
+echo "configure:1588: checking if $ac_cv_path_PATH_SUM takes -r" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_sum_r'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if { ac_try='$ac_cv_path_PATH_SUM -r config.log 1>&5'; { (eval echo configure:1587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+if { ac_try='$ac_cv_path_PATH_SUM -r config.log 1>&5'; { (eval echo configure:1593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
 then
 	ac_cv_prog_sum_r=yes
 else
@@ -1611,9 +1617,221 @@
 fi
 
 
+
+echo $ac_n "checking for default editor""... $ac_c" 1>&6
+echo "configure:1623: checking for default editor" >&5
+# Check whether --with-editor or --without-editor was given.
+if test "${with_editor+set}" = set; then
+  withval="$with_editor"
+  DEFAULT_EDITOR=$withval
+else
+  
+if test -z "$DEFAULT_EDITOR" ; then
+    if test -n "$EDITOR" ; then
+    	DEFAULT_EDITOR="$EDITOR"
+    elif test -n "$VISUAL" ; then
+    	DEFAULT_EDITOR="$VISUAL"
+    else
+	# Extract the first word of "vi", so it can be a program name with args.
+set dummy vi; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1639: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_DEFAULT_EDITOR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$DEFAULT_EDITOR" in
+  /*)
+  ac_cv_path_DEFAULT_EDITOR="$DEFAULT_EDITOR" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/bin:/usr/ucb$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_DEFAULT_EDITOR="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_DEFAULT_EDITOR" && ac_cv_path_DEFAULT_EDITOR="vi"
+  ;;
+esac
+fi
+DEFAULT_EDITOR="$ac_cv_path_DEFAULT_EDITOR"
+if test -n "$DEFAULT_EDITOR"; then
+  echo "$ac_t""$DEFAULT_EDITOR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+fi
+
+fi
+
+echo "$ac_t""$DEFAULT_EDITOR" 1>&6
+cat >> confdefs.h <<EOF
+#define DEFAULT_EDITOR "$DEFAULT_EDITOR"
+EOF
+
+
+
+# Extract the first word of "sendmail", so it can be a program name with args.
+set dummy sendmail; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1683: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_DEFAULT_MAILER'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$DEFAULT_MAILER" in
+  /*)
+  ac_cv_path_DEFAULT_MAILER="$DEFAULT_MAILER" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/sbin:/usr/lib$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_DEFAULT_MAILER="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+DEFAULT_MAILER="$ac_cv_path_DEFAULT_MAILER"
+if test -n "$DEFAULT_MAILER"; then
+  echo "$ac_t""$DEFAULT_MAILER" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+# Check whether --with-mailer or --without-mailer was given.
+if test "${with_mailer+set}" = set; then
+  withval="$with_mailer"
+  DEFAULT_MAILER=$withval
+else
+  
+if test -z "$DEFAULT_MAILER" ; then
+# Extract the first word of "mailx", so it can be a program name with args.
+set dummy mailx; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1721: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_DEFAULT_MAILER'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$DEFAULT_MAILER" in
+  /*)
+  ac_cv_path_DEFAULT_MAILER="$DEFAULT_MAILER" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/bin$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_DEFAULT_MAILER="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+DEFAULT_MAILER="$ac_cv_path_DEFAULT_MAILER"
+if test -n "$DEFAULT_MAILER"; then
+  echo "$ac_t""$DEFAULT_MAILER" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$DEFAULT_MAILER" ; then
+# Extract the first word of "mail", so it can be a program name with args.
+set dummy mail; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1754: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_DEFAULT_MAILER'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$DEFAULT_MAILER" in
+  /*)
+  ac_cv_path_DEFAULT_MAILER="$DEFAULT_MAILER" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/bin$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_DEFAULT_MAILER="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+DEFAULT_MAILER="$ac_cv_path_DEFAULT_MAILER"
+if test -n "$DEFAULT_MAILER"; then
+  echo "$ac_t""$DEFAULT_MAILER" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -n "$DEFAULT_MAILER" ; then
+	cat >> confdefs.h <<EOF
+#define DEFAULT_MAILER "$DEFAULT_MAILER"
+EOF
+
+else
+	DEFAULT_MAILER=none
+fi
+echo "$ac_t""$DEFAULT_MAILER" 1>&6
+
+fi
+
+
+
+echo $ac_n "checking for incoming-mail directory""... $ac_c" 1>&6
+echo "configure:1798: checking for incoming-mail directory" >&5
+# Check whether --with-mailbox or --without-mailbox was given.
+if test "${with_mailbox+set}" = set; then
+  withval="$with_mailbox"
+  DEFAULT_MAILBOX=$withval
+else
+  
+if test -z "$DEFAULT_MAILBOX" ; then
+for cf_dir in \
+	/var/spool/mail \
+	/usr/spool/mail \
+	/var/mail \
+	/usr/mail \
+	/mail
+    do
+    	if test -d $cf_dir ; then
+	    DEFAULT_MAILBOX=$cf_dir
+	    break
+	fi
+    done
+fi
+
+fi
+
+if test -n "$DEFAULT_MAILBOX" ; then
+	cat >> confdefs.h <<EOF
+#define DEFAULT_MAILBOX "$DEFAULT_MAILBOX"
+EOF
+
+else
+	DEFAULT_MAILBOX=none
+fi
+echo "$ac_t""$DEFAULT_MAILBOX" 1>&6
+
+
 ### check for this early, since it'll override several options
 echo $ac_n "checking if NNTP-support will be used""... $ac_c" 1>&6
-echo "configure:1617: checking if NNTP-support will be used" >&5
+echo "configure:1835: checking if NNTP-support will be used" >&5
 # Check whether --enable-nntp or --disable-nntp was given.
 if test "${enable_nntp+set}" = set; then
   enableval="$enable_nntp"
@@ -1634,7 +1852,7 @@
 USE_SPOOLDIR=yes
 if test "$USE_NNTP" = "yes" ; then
 echo $ac_n "checking whether to be NNTP_ONLY""... $ac_c" 1>&6
-echo "configure:1638: checking whether to be NNTP_ONLY" >&5
+echo "configure:1856: checking whether to be NNTP_ONLY" >&5
 # Check whether --enable-nntp-only or --disable-nntp-only was given.
 if test "${enable_nntp_only+set}" = set; then
   enableval="$enable_nntp_only"
@@ -1665,7 +1883,7 @@
 
 ###	use option --enable-debug to compile-in test/development code
 echo $ac_n "checking if you want to compile-in debug support""... $ac_c" 1>&6
-echo "configure:1669: checking if you want to compile-in debug support" >&5
+echo "configure:1887: checking if you want to compile-in debug support" >&5
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
@@ -1690,7 +1908,7 @@
 
 ###	use option --disable-echo to suppress full display compiling commands
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:1694: checking if you want to see long compiling messages" >&5
+echo "configure:1912: 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
   enableval="$enable_echo"
@@ -1715,7 +1933,7 @@
 
 ### use option --enable-prototypes to turn on optional prototypes
 echo $ac_n "checking if you want to compile with fallback prototypes""... $ac_c" 1>&6
-echo "configure:1719: checking if you want to compile with fallback prototypes" >&5
+echo "configure:1937: checking if you want to compile with fallback prototypes" >&5
 # Check whether --enable-prototypes or --disable-prototypes was given.
 if test "${enable_prototypes+set}" = set; then
   enableval="$enable_prototypes"
@@ -1738,7 +1956,7 @@
 if test -n "$GCC"
 then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:1742: checking if you want to turn on gcc warnings" >&5
+echo "configure:1960: 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
   enableval="$enable_warnings"
@@ -1762,11 +1980,11 @@
 if test -n "$GCC"
 then
 		cat > conftest.$ac_ext <<EOF
-#line 1766 "configure"
+#line 1984 "configure"
 int main(int argc, char *argv[]) { return argv[argc-1] == 0; }
 EOF
 		echo "checking for gcc warning options" 1>&6
-echo "configure:1770: checking for gcc warning options" >&5
+echo "configure:1988: checking for gcc warning options" >&5
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-W -Wall"
 	cf_warn_CONST=""
@@ -1784,7 +2002,7 @@
 		Wstrict-prototypes $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo configure:1788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+		if { (eval echo configure:2006: \"$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"
@@ -1802,7 +2020,7 @@
 if test "$USE_SPOOLDIR" = "yes"; then
 	## options for directories
 	echo $ac_n "checking for news-library path""... $ac_c" 1>&6
-echo "configure:1806: checking for news-library path" >&5
+echo "configure:2024: checking for news-library path" >&5
 	# Check whether --with-libdir or --without-libdir was given.
 if test "${with_libdir+set}" = set; then
   withval="$with_libdir"
@@ -1833,7 +2051,7 @@
 	echo "$ac_t""$NEWSLIBDIR" 1>&6
 
 	echo $ac_n "checking for news spool-directory path""... $ac_c" 1>&6
-echo "configure:1837: checking for news spool-directory path" >&5
+echo "configure:2055: checking for news spool-directory path" >&5
 	# Check whether --with-spooldir or --without-spooldir was given.
 if test "${with_spooldir+set}" = set; then
   withval="$with_spooldir"
@@ -1864,7 +2082,7 @@
 	echo "$ac_t""$SPOOLDIR" 1>&6
 
 	echo $ac_n "checking for news overview-directory path""... $ac_c" 1>&6
-echo "configure:1868: checking for news overview-directory path" >&5
+echo "configure:2086: checking for news overview-directory path" >&5
 	# Check whether --with-nov-dir or --without-nov-dir was given.
 if test "${with_nov_dir+set}" = set; then
   withval="$with_nov_dir"
@@ -1895,7 +2113,7 @@
 	echo "$ac_t""$NOVROOTDIR" 1>&6
 
 	echo $ac_n "checking for overview filename""... $ac_c" 1>&6
-echo "configure:1899: checking for overview filename" >&5
+echo "configure:2117: checking for overview filename" >&5
 	# Check whether --with-nov-fname or --without-nov-fname was given.
 if test "${with_nov_fname+set}" = set; then
   withval="$with_nov_fname"
@@ -1927,7 +2145,7 @@
 fi
 
 echo $ac_n "checking for directory containing \"inews\"""... $ac_c" 1>&6
-echo "configure:1931: checking for directory containing \"inews\"" >&5
+echo "configure:2149: checking for directory containing \"inews\"" >&5
 # Check whether --with-inews-dir or --without-inews-dir was given.
 if test "${with_inews_dir+set}" = set; then
   withval="$with_inews_dir"
@@ -1961,7 +2179,7 @@
 if test "$USE_SPOOLDIR" = "yes"; then
 	## options for libraries
 	echo $ac_n "checking for optional INN-NNTP library""... $ac_c" 1>&6
-echo "configure:1965: checking for optional INN-NNTP library" >&5
+echo "configure:2183: checking for optional INN-NNTP library" >&5
 	# Check whether --with-inn-nntplib or --without-inn-nntplib was given.
 if test "${with_inn_nntplib+set}" = set; then
   withval="$with_inn_nntplib"
@@ -1991,7 +2209,7 @@
 ### Look for network libraries first, since some functions (such as gethostname)
 ### are used in a lot of places.
 echo $ac_n "checking if you want socks5 library""... $ac_c" 1>&6
-echo "configure:1995: checking if you want socks5 library" >&5
+echo "configure:2213: checking if you want socks5 library" >&5
 if eval "test \"`echo '$''{'cf_cv_use_libsocks5'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2012,14 +2230,14 @@
 if test $cf_cv_use_libsocks5 = yes ; then
 	
 echo $ac_n "checking if we can link against socks5 library""... $ac_c" 1>&6
-echo "configure:2016: checking if we can link against socks5 library" >&5
+echo "configure:2234: checking if we can link against socks5 library" >&5
 if eval "test \"`echo '$''{'cf_cv_lib_socks5'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 LIBS="$LIBS -lsocks5"
 cat > conftest.$ac_ext <<EOF
-#line 2023 "configure"
+#line 2241 "configure"
 #include "confdefs.h"
 
 #define SOCKS
@@ -2034,7 +2252,7 @@
 	getpeername(0, (struct sockaddr *)0, (int *)0);
 ; return 0; }
 EOF
-if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_lib_socks5=yes
 else
@@ -2061,7 +2279,7 @@
 	
 cf_test_netlibs=no
 echo $ac_n "checking for network libraries""... $ac_c" 1>&6
-echo "configure:2065: checking for network libraries" >&5
+echo "configure:2283: checking for network libraries" >&5
 if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2072,12 +2290,12 @@
 for ac_func in gethostname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2076: checking for $ac_func" >&5
+echo "configure:2294: 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 2081 "configure"
+#line 2299 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2100,7 +2318,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2123,7 +2341,7 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:2127: checking for gethostname in -lnsl" >&5
+echo "configure:2345: 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
@@ -2131,7 +2349,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2135 "configure"
+#line 2353 "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
@@ -2142,7 +2360,7 @@
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2364: \"$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
@@ -2175,7 +2393,7 @@
 	
 		
 echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:2179: checking for gethostname in -lsocket" >&5
+echo "configure:2397: 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
@@ -2183,7 +2401,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2187 "configure"
+#line 2405 "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
@@ -2194,7 +2412,7 @@
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2416: \"$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
@@ -2238,21 +2456,21 @@
 # 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:2242: checking for -linet" >&5
+echo "configure:2460: 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 2249 "configure"
+#line 2467 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_inet=yes
 else
@@ -2275,12 +2493,12 @@
 for ac_func in socket
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2279: checking for $ac_func" >&5
+echo "configure:2497: 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 2284 "configure"
+#line 2502 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2303,7 +2521,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2326,7 +2544,7 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2330: checking for socket in -lsocket" >&5
+echo "configure:2548: 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
@@ -2334,7 +2552,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2338 "configure"
+#line 2556 "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
@@ -2345,7 +2563,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2567: \"$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
@@ -2378,7 +2596,7 @@
 	
 		
 echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
-echo "configure:2382: checking for socket in -lbsd" >&5
+echo "configure:2600: 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
@@ -2386,7 +2604,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2390 "configure"
+#line 2608 "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
@@ -2397,7 +2615,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2619: \"$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
@@ -2442,12 +2660,12 @@
 for ac_func in gethostbyname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2446: checking for $ac_func" >&5
+echo "configure:2664: 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 2451 "configure"
+#line 2669 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2470,7 +2688,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2493,7 +2711,7 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2497: checking for gethostbyname in -lnsl" >&5
+echo "configure:2715: 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
@@ -2501,7 +2719,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2505 "configure"
+#line 2723 "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
@@ -2512,7 +2730,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:2516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2734: \"$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
@@ -2553,12 +2771,12 @@
 for ac_func in strcasecmp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2557: checking for $ac_func" >&5
+echo "configure:2775: 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 2562 "configure"
+#line 2780 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2581,7 +2799,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2604,7 +2822,7 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:2608: checking for strcasecmp in -lresolv" >&5
+echo "configure:2826: 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
@@ -2612,7 +2830,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2616 "configure"
+#line 2834 "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
@@ -2623,7 +2841,7 @@
 strcasecmp()
 ; return 0; }
 EOF
-if { (eval echo configure:2627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2845: \"$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
@@ -2671,7 +2889,7 @@
 ### Look for ncurses in the usual places, accommodating compilers that don't
 ### search /usr/local by default.
 echo $ac_n "checking if you want ncurses library""... $ac_c" 1>&6
-echo "configure:2675: checking if you want ncurses library" >&5
+echo "configure:2893: checking if you want ncurses library" >&5
 found_ncurses=no
 # Check whether --with-ncurses or --without-ncurses was given.
 if test "${with_ncurses+set}" = set; then
@@ -2685,13 +2903,13 @@
 if test $found_ncurses != no ; then
 	 
 echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6
-echo "configure:2689: checking for ncurses header file" >&5
+echo "configure:2907: 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 2695 "configure"
+#line 2913 "configure"
 #include "confdefs.h"
 #include <curses.h>
 int main() {
@@ -2708,7 +2926,7 @@
 	
 ; return 0; }
 EOF
-if { (eval echo configure:2712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_header=predefined
 else
@@ -2794,7 +3012,7 @@
 	;;
 esac
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:2798: checking for ncurses version" >&5
+echo "configure:3016: 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
@@ -2807,7 +3025,7 @@
 	# This will not work if the preprocessor splits the line after the
 	# Autoconf token.  The 'unproto' program does that.
 	cat > conftest.$ac_ext <<EOF
-#include <$cf_cv_ncurses_header>
+#include <${cf_cv_ncurses_header-curses.h}>
 #undef Autoconf
 #ifdef NCURSES_VERSION
 Autoconf NCURSES_VERSION
@@ -2819,7 +3037,7 @@
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:2823: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:3041: \"$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"
@@ -2828,10 +3046,10 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 2832 "configure"
+#line 3050 "configure"
 #include "confdefs.h"
 
-#include <$cf_cv_ncurses_header>
+#include <${cf_cv_ncurses_header-curses.h}>
 int main()
 {
 	FILE *fp = fopen("$cf_tempfile", "w");
@@ -2851,7 +3069,7 @@
 	exit(0);
 }
 EOF
-if { (eval echo configure:2855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3073: \"$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`
@@ -2876,7 +3094,7 @@
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:2880: checking for Gpm_Open in -lgpm" >&5
+echo "configure:3098: 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
@@ -2884,7 +3102,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2888 "configure"
+#line 3106 "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
@@ -2895,7 +3113,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:2899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3117: \"$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
@@ -2911,7 +3129,7 @@
 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:2915: checking for initscr in -lgpm" >&5
+echo "configure:3133: 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
@@ -2919,7 +3137,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2923 "configure"
+#line 3141 "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
@@ -2930,7 +3148,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3152: \"$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
@@ -2961,7 +3179,7 @@
 	# 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:2965: checking for tgoto in -lmytinfo" >&5
+echo "configure:3183: 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
@@ -2969,7 +3187,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2973 "configure"
+#line 3191 "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
@@ -2980,7 +3198,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:2984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3202: \"$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
@@ -3008,12 +3226,12 @@
 	cf_cv_have_lib_ncurses=no
 	cf_libdir=""
 	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:3012: checking for initscr" >&5
+echo "configure:3230: 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 3017 "configure"
+#line 3235 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -3036,7 +3254,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -3056,17 +3274,17 @@
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:3060: checking for initscr in -lncurses" >&5
+echo "configure:3278: checking for initscr in -lncurses" >&5
 		LIBS="-lncurses $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 3063 "configure"
+#line 3281 "configure"
 #include "confdefs.h"
-#include <$cf_cv_ncurses_header>
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; 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:3288: \"$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
@@ -3093,17 +3311,17 @@
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6
-echo "configure:3097: checking for -lncurses in $cf_libdir" >&5
+echo "configure:3315: checking for -lncurses in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 3100 "configure"
+#line 3318 "configure"
 #include "confdefs.h"
-#include <$cf_cv_ncurses_header>
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3325: \"$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
@@ -3126,11 +3344,16 @@
 if test $cf_cv_have_lib_ncurses = no ; then
 	{ echo "configure: error: Cannot link ncurses library" 1>&2; exit 1; }
 fi
+case $host_os in #(vi
+linux*) # Suse Linux does not follow /usr/lib convention
+	ncurses="$ncurses /lib"
+	;;
+esac
 
 
 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:3134: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
+echo "configure:3357: 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'$//'`
@@ -3139,14 +3362,14 @@
 		fi
 	done
 	cat > conftest.$ac_ext <<EOF
-#line 3143 "configure"
+#line 3366 "configure"
 #include "confdefs.h"
-#include <$cf_cv_ncurses_header>
+#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:3150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -3162,7 +3385,7 @@
 fi
 
 echo $ac_n "checking if you want curses""... $ac_c" 1>&6
-echo "configure:3166: checking if you want curses" >&5
+echo "configure:3389: checking if you want curses" >&5
 # Check whether --enable-curses or --disable-curses was given.
 if test "${enable_curses+set}" = set; then
   enableval="$enable_curses"
@@ -3182,14 +3405,14 @@
 
 ## debugging libraries (do this after other libraries)
 echo $ac_n "checking if you want dbmalloc library""... $ac_c" 1>&6
-echo "configure:3186: checking if you want dbmalloc library" >&5
+echo "configure:3409: checking if you want dbmalloc library" >&5
 debug_malloc=none
 # Check whether --with-dbmalloc or --without-dbmalloc was given.
 if test "${with_dbmalloc+set}" = set; then
   withval="$with_dbmalloc"
   echo "$ac_t""yes" 1>&6
 	 echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
-echo "configure:3193: checking for debug_malloc in -ldbmalloc" >&5
+echo "configure:3416: checking for debug_malloc in -ldbmalloc" >&5
 ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3197,7 +3420,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldbmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3201 "configure"
+#line 3424 "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
@@ -3208,7 +3431,7 @@
 debug_malloc()
 ; return 0; }
 EOF
-if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3435: \"$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
@@ -3225,17 +3448,17 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "dbmalloc.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dbmalloc.h""... $ac_c" 1>&6
-echo "configure:3229: checking for dbmalloc.h" >&5
+echo "configure:3452: checking for dbmalloc.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 3234 "configure"
+#line 3457 "configure"
 #include "confdefs.h"
 #include <dbmalloc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3266,13 +3489,13 @@
 
 
 echo $ac_n "checking if you want dmalloc library""... $ac_c" 1>&6
-echo "configure:3270: checking if you want dmalloc library" >&5
+echo "configure:3493: checking if you want dmalloc library" >&5
 # Check whether --with-dmalloc or --without-dmalloc was given.
 if test "${with_dmalloc+set}" = set; then
   withval="$with_dmalloc"
   echo "$ac_t""yes" 1>&6
 	 echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
-echo "configure:3276: checking for dmalloc_debug in -ldmalloc" >&5
+echo "configure:3499: checking for dmalloc_debug in -ldmalloc" >&5
 ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3280,7 +3503,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3284 "configure"
+#line 3507 "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
@@ -3291,7 +3514,7 @@
 dmalloc_debug()
 ; return 0; }
 EOF
-if { (eval echo configure:3295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3518: \"$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
@@ -3308,17 +3531,17 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "dmalloc.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dmalloc.h""... $ac_c" 1>&6
-echo "configure:3312: checking for dmalloc.h" >&5
+echo "configure:3535: checking for dmalloc.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 3317 "configure"
+#line 3540 "configure"
 #include "confdefs.h"
 #include <dmalloc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3349,7 +3572,7 @@
 
 
 echo $ac_n "checking if you want debugging-trace""... $ac_c" 1>&6
-echo "configure:3353: checking if you want debugging-trace" >&5
+echo "configure:3576: checking if you want debugging-trace" >&5
 # Check whether --with-trace or --without-trace was given.
 if test "${with_trace+set}" = set; then
   withval="$with_trace"
@@ -3367,7 +3590,7 @@
 
 ## options for miscellaneous definitions
 echo $ac_n "checking for domain-name""... $ac_c" 1>&6
-echo "configure:3371: checking for domain-name" >&5
+echo "configure:3594: checking for domain-name" >&5
 # Check whether --with-domain-name or --without-domain-name was given.
 if test "${with_domain_name+set}" = set; then
   withval="$with_domain_name"
@@ -3384,7 +3607,7 @@
 
 if test "$USE_NNTP" = "yes" ; then
 echo $ac_n "checking for NNTP default-server""... $ac_c" 1>&6
-echo "configure:3388: checking for NNTP default-server" >&5
+echo "configure:3611: checking for NNTP default-server" >&5
 # Check whether --with-nntp-default-server or --without-nntp-default-server was given.
 if test "${with_nntp_default_server+set}" = set; then
   withval="$with_nntp_default_server"
@@ -3436,7 +3659,7 @@
 
 ## optional features
 echo $ac_n "checking whether to use MH style mail handling""... $ac_c" 1>&6
-echo "configure:3440: checking whether to use MH style mail handling" >&5
+echo "configure:3663: checking whether to use MH style mail handling" >&5
 # Check whether --enable-mh-mail-handling or --disable-mh-mail-handling was given.
 if test "${enable_mh_mail_handling+set}" = set; then
   enableval="$enable_mh_mail_handling"
@@ -3454,7 +3677,7 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking whether to enable 8-bit keycodes""... $ac_c" 1>&6
-echo "configure:3458: checking whether to enable 8-bit keycodes" >&5
+echo "configure:3681: checking whether to enable 8-bit keycodes" >&5
 # Check whether --enable-8bit-keys or --disable-8bit-keys was given.
 if test "${enable_8bit_keys+set}" = set; then
   enableval="$enable_8bit_keys"
@@ -3479,32 +3702,23 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking whether to enable ANSI-color""... $ac_c" 1>&6
-echo "configure:3483: checking whether to enable ANSI-color" >&5
+echo "configure:3706: checking whether to enable ANSI-color" >&5
 # Check whether --enable-color or --disable-color was given.
 if test "${enable_color+set}" = set; then
   enableval="$enable_color"
   test "$enableval" != no && enableval=yes
   if test "$enableval" != "yes" ; then
     : 
-  else
-    cat >> confdefs.h <<\EOF
-#define HAVE_COLOR 1
-EOF
-
   fi
 else
-  enableval=yes 
-  cat >> confdefs.h <<\EOF
-#define HAVE_COLOR 1
-EOF
-
-  
+  enableval=yes   
 fi
 
-echo "$ac_t""$enableval" 1>&6
+use_color=$enableval
+echo "$ac_t""$use_color" 1>&6
 
 echo $ac_n "checking whether to enable posting-etiquette""... $ac_c" 1>&6
-echo "configure:3508: checking whether to enable posting-etiquette" >&5
+echo "configure:3722: checking whether to enable posting-etiquette" >&5
 # Check whether --enable-etiquette or --disable-etiquette was given.
 if test "${enable_etiquette+set}" = set; then
   enableval="$enable_etiquette"
@@ -3523,7 +3737,7 @@
 
 
 echo $ac_n "checking whether to strictly observe RFC1522 and break long lines""... $ac_c" 1>&6
-echo "configure:3527: checking whether to strictly observe RFC1522 and break long lines" >&5
+echo "configure:3741: checking whether to strictly observe RFC1522 and break long lines" >&5
 # Check whether --enable-break-long-lines or --disable-break-long-lines was given.
 if test "${enable_break_long_lines+set}" = set; then
   enableval="$enable_break_long_lines"
@@ -3541,7 +3755,7 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking whether to force MM_CHARSET obeyance when decoding mime""... $ac_c" 1>&6
-echo "configure:3545: checking whether to force MM_CHARSET obeyance when decoding mime" >&5
+echo "configure:3759: checking whether to force MM_CHARSET obeyance when decoding mime" >&5
 # Check whether --enable-mime-strict-charset or --disable-mime-strict-charset was given.
 if test "${enable_mime_strict_charset+set}" = set; then
   enableval="$enable_mime_strict_charset"
@@ -3566,7 +3780,7 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking for MIME character-set""... $ac_c" 1>&6
-echo "configure:3570: checking for MIME character-set" >&5
+echo "configure:3784: checking for MIME character-set" >&5
 # Check whether --with-mime-default-charset or --without-mime-default-charset was given.
 if test "${with_mime_default_charset+set}" = set; then
   withval="$with_mime_default_charset"
@@ -3588,7 +3802,7 @@
 echo "$ac_t""$MM_CHARSET" 1>&6
 
 echo $ac_n "checking for default ISO/ASCII table""... $ac_c" 1>&6
-echo "configure:3592: checking for default ISO/ASCII table" >&5
+echo "configure:3806: checking for default ISO/ASCII table" >&5
 # Check whether --with-iso-to-ascii or --without-iso-to-ascii was given.
 if test "${with_iso_to_ascii+set}" = set; then
   withval="$with_iso_to_ascii"
@@ -3610,7 +3824,7 @@
 echo "$ac_t""$DEFAULT_ISO2ASC" 1>&6
 
 echo $ac_n "checking whether to enable forged cancels""... $ac_c" 1>&6
-echo "configure:3614: checking whether to enable forged cancels" >&5
+echo "configure:3828: checking whether to enable forged cancels" >&5
 # Check whether --enable-forgery or --disable-forgery was given.
 if test "${enable_forgery+set}" = set; then
   enableval="$enable_forgery"
@@ -3628,7 +3842,7 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking whether to enable locale support""... $ac_c" 1>&6
-echo "configure:3632: checking whether to enable locale support" >&5
+echo "configure:3846: checking whether to enable locale support" >&5
 # Check whether --enable-locale or --disable-locale was given.
 if test "${enable_locale+set}" = set; then
   enableval="$enable_locale"
@@ -3646,7 +3860,7 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking whether to enable piping support""... $ac_c" 1>&6
-echo "configure:3650: checking whether to enable piping support" >&5
+echo "configure:3864: checking whether to enable piping support" >&5
 # Check whether --enable-piping or --disable-piping was given.
 if test "${enable_piping+set}" = set; then
   enableval="$enable_piping"
@@ -3664,7 +3878,7 @@
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking whether to unique tmp-files by appending .pid""... $ac_c" 1>&6
-echo "configure:3668: checking whether to unique tmp-files by appending .pid" >&5
+echo "configure:3882: checking whether to unique tmp-files by appending .pid" >&5
 # Check whether --enable-append-pid or --disable-append-pid was given.
 if test "${enable_append_pid+set}" = set; then
   enableval="$enable_append_pid"
@@ -3690,7 +3904,7 @@
 
 ### checks for the location of the system-wide default setting file
 echo $ac_n "checking for directory containing tin.defaults file""... $ac_c" 1>&6
-echo "configure:3694: checking for directory containing tin.defaults file" >&5
+echo "configure:3908: checking for directory containing tin.defaults file" >&5
 # Check whether --with-defaults-dir or --without-defaults-dir was given.
 if test "${with_defaults_dir+set}" = set; then
   withval="$with_defaults_dir"
@@ -3726,7 +3940,7 @@
 
 ###	checks for operator characteristics (should be the last option)
 echo $ac_n "checking whether to make a coffee while compiling""... $ac_c" 1>&6
-echo "configure:3730: checking whether to make a coffee while compiling" >&5
+echo "configure:3944: checking whether to make a coffee while compiling" >&5
 # Check whether --with-coffee or --without-coffee was given.
 if test "${with_coffee+set}" = set; then
   withval="$with_coffee"
@@ -3750,7 +3964,7 @@
 ###	checks for compiler characteristics
 
 echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6
-echo "configure:3754: checking for makeflags variable" >&5
+echo "configure:3968: checking for makeflags variable" >&5
 if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3783,12 +3997,12 @@
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3787: checking for working const" >&5
+echo "configure:4001: 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 3792 "configure"
+#line 4006 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3837,7 +4051,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3858,21 +4072,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3862: checking for inline" >&5
+echo "configure:4076: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 3869 "configure"
+#line 4083 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3899,13 +4113,13 @@
 
 
 echo $ac_n "checking for ansi token expansion/substitution""... $ac_c" 1>&6
-echo "configure:3903: checking for ansi token expansion/substitution" >&5
+echo "configure:4117: checking for ansi token expansion/substitution" >&5
 if eval "test \"`echo '$''{'cf_cv_cpp_expands'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 3909 "configure"
+#line 4123 "configure"
 #include "confdefs.h"
 
 #define string(n) #n
@@ -3913,7 +4127,7 @@
 char *s = string(token)
 ; return 0; }
 EOF
-if { (eval echo configure:3917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_cpp_expands=yes
 else
@@ -3934,13 +4148,13 @@
 
 
 echo $ac_n "checking for ansi token concatenation""... $ac_c" 1>&6
-echo "configure:3938: checking for ansi token concatenation" >&5
+echo "configure:4152: checking for ansi token concatenation" >&5
 if eval "test \"`echo '$''{'cf_cv_cpp_concats'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 3944 "configure"
+#line 4158 "configure"
 #include "confdefs.h"
 
 #define concat(a,b) a ## b
@@ -3948,7 +4162,7 @@
 char *firstlast = "y", *s = concat(first,last)
 ; return 0; }
 EOF
-if { (eval echo configure:3952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_cpp_concats=yes
 else
@@ -3969,20 +4183,20 @@
 
 
 echo $ac_n "checking if nested parameters work""... $ac_c" 1>&6
-echo "configure:3973: checking if nested parameters work" >&5
+echo "configure:4187: checking if nested parameters work" >&5
 if eval "test \"`echo '$''{'cf_cv_nested_params'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 3979 "configure"
+#line 4193 "configure"
 #include "confdefs.h"
 
 int main() {
 extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig)
 ; return 0; }
 EOF
-if { (eval echo configure:3986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_nested_params=yes
 else
@@ -4008,19 +4222,19 @@
   # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:4012: checking for working alloca.h" >&5
+echo "configure:4226: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4017 "configure"
+#line 4231 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -4041,12 +4255,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4045: checking for alloca" >&5
+echo "configure:4259: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4050 "configure"
+#line 4264 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -4069,7 +4283,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -4101,12 +4315,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4105: checking whether alloca needs Cray hooks" >&5
+echo "configure:4319: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4110 "configure"
+#line 4324 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -4131,12 +4345,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4135: checking for $ac_func" >&5
+echo "configure:4349: 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 4140 "configure"
+#line 4354 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4159,7 +4373,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4186,7 +4400,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4190: checking stack direction for C alloca" >&5
+echo "configure:4404: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4194,7 +4408,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 4198 "configure"
+#line 4412 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -4213,7 +4427,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -4243,12 +4457,12 @@
 
 ###	Checks for header files.
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4247: checking for ANSI C header files" >&5
+echo "configure:4461: 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 4252 "configure"
+#line 4466 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4256,7 +4470,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4273,7 +4487,7 @@
 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 4277 "configure"
+#line 4491 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4291,7 +4505,7 @@
 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 4295 "configure"
+#line 4509 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4312,7 +4526,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4316 "configure"
+#line 4530 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4323,7 +4537,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4351,12 +4565,12 @@
 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:4355: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4569: 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 4360 "configure"
+#line 4574 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4364,7 +4578,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4389,7 +4603,7 @@
 # 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:4393: checking for opendir in -ldir" >&5
+echo "configure:4607: 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
@@ -4397,7 +4611,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4401 "configure"
+#line 4615 "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
@@ -4408,7 +4622,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4626: \"$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
@@ -4430,7 +4644,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4434: checking for opendir in -lx" >&5
+echo "configure:4648: 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
@@ -4438,7 +4652,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4442 "configure"
+#line 4656 "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
@@ -4449,7 +4663,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4667: \"$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
@@ -4472,12 +4686,12 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4476: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4690: 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 4481 "configure"
+#line 4695 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4486,7 +4700,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4507,12 +4721,12 @@
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4511: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:4725: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4516 "configure"
+#line 4730 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4528,7 +4742,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -4592,17 +4806,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4596: checking for $ac_hdr" >&5
+echo "configure:4810: 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 4601 "configure"
+#line 4815 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4632,7 +4846,7 @@
 ###	Checks that depend on existence-checks for headers
 
 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
-echo "configure:4636: checking declaration of size-change" >&5
+echo "configure:4850: 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
@@ -4646,7 +4860,7 @@
     CFLAGS="$cf_save_CFLAGS"
     test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
     cat > conftest.$ac_ext <<EOF
-#line 4650 "configure"
+#line 4864 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if HAVE_TERMIOS_H
@@ -4685,7 +4899,7 @@
 	
 ; return 0; }
 EOF
-if { (eval echo configure:4689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sizechange=yes
 else
@@ -4717,7 +4931,7 @@
 
 
 echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6
-echo "configure:4721: checking if sys/time.h conflicts with sys/select.h" >&5
+echo "configure:4935: checking if sys/time.h conflicts with sys/select.h" >&5
 if eval "test \"`echo '$''{'cf_cv_sys_select_timeval'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4725,7 +4939,7 @@
 for cf_opts in no yes
 do
 cat > conftest.$ac_ext <<EOF
-#line 4729 "configure"
+#line 4943 "configure"
 #include "confdefs.h"
 
 #define yes 1
@@ -4733,6 +4947,7 @@
 #if $cf_opts
 #define timeval fake_timeval
 #endif
+#include <sys/types.h>
 #ifdef TIME_WITH_SYS_TIME
 #	include <sys/time.h>
 #	include <time.h>
@@ -4752,7 +4967,7 @@
 struct timeval foo
 ; return 0; }
 EOF
-if { (eval echo configure:4756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sys_select_timeval=$cf_opts
 	 break
@@ -4776,12 +4991,12 @@
 
 ###	Checks for Datatypes.
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:4780: checking for mode_t" >&5
+echo "configure:4995: 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 4785 "configure"
+#line 5000 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4809,12 +5024,12 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:4813: checking for off_t" >&5
+echo "configure:5028: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4818 "configure"
+#line 5033 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4842,12 +5057,12 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4846: checking for pid_t" >&5
+echo "configure:5061: 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 4851 "configure"
+#line 5066 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4875,12 +5090,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:4879: checking for size_t" >&5
+echo "configure:5094: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4884 "configure"
+#line 5099 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4908,12 +5123,12 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:4912: checking for uid_t in sys/types.h" >&5
+echo "configure:5127: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4917 "configure"
+#line 5132 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -4942,12 +5157,12 @@
 fi
 
 echo $ac_n "checking for time_t""... $ac_c" 1>&6
-echo "configure:4946: checking for time_t" >&5
+echo "configure:5161: checking for time_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4951 "configure"
+#line 5166 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4975,12 +5190,12 @@
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4979: checking return type of signal handlers" >&5
+echo "configure:5194: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4984 "configure"
+#line 5199 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -4997,7 +5212,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:5001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -5021,12 +5236,12 @@
 	if test $found_ncurses != yes ; then
 		
 echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:5025: checking for initscr" >&5
+echo "configure:5240: 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 5030 "configure"
+#line 5245 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -5049,7 +5264,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -5070,7 +5285,7 @@
 case $host_os in #(vi
 freebsd*) #(vi
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:5074: checking for tgoto in -lmytinfo" >&5
+echo "configure:5289: 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
@@ -5078,7 +5293,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5082 "configure"
+#line 5297 "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
@@ -5089,7 +5304,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5308: \"$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
@@ -5112,7 +5327,7 @@
 	;;
 *hp-hpux10.*)
 	echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:5116: checking for initscr in -lHcurses" >&5
+echo "configure:5331: 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
@@ -5120,7 +5335,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5124 "configure"
+#line 5339 "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
@@ -5131,7 +5346,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5350: \"$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
@@ -5150,12 +5365,13 @@
 		# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
 		LIBS="-lHcurses $LIBS"
 		CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
+		ac_cv_func_initscr=yes
 		
 else
   echo "$ac_t""no" 1>&6
 
 	echo $ac_n "checking for initscr in -lcur_color""... $ac_c" 1>&6
-echo "configure:5159: checking for initscr in -lcur_color" >&5
+echo "configure:5375: 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
@@ -5163,7 +5379,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_color  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5167 "configure"
+#line 5383 "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
@@ -5174,7 +5390,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5394: \"$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
@@ -5192,6 +5408,7 @@
   
 		LIBS="-lcur_color $LIBS"
 		CFLAGS="-I/usr/include/curses_colr $CFLAGS"
+		ac_cv_func_initscr=yes
 		
 else
   echo "$ac_t""no" 1>&6
@@ -5201,24 +5418,29 @@
 
 	;;
 esac
+
+if test ".$With5lib" != ".no" ; then
 if test -d /usr/5lib ; then
 	# SunOS 3.x or 4.x
 	CPPFLAGS="$CPPFLAGS -I/usr/5include"
 	LIBS="$LIBS -L/usr/5lib"
-# FIXME: check if we need/use -R option
-# elif test -d /usr/ccs/lib ; then
-# 	# Solaris 5.x
-# 	LIBS="$LIBS -L/usr/ccs/lib -R/usr/ccs/lib"
+fi
 fi
 
-cf_save_LIBS="$LIBS"
-echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:5217: checking for tgoto" >&5
+if test ".$ac_cv_func_initscr" != .yes ; then
+	cf_save_LIBS="$LIBS"
+	cf_term_lib=""
+	cf_curs_lib=""
+
+	# 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:5439: 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 5222 "configure"
+#line 5444 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
@@ -5241,7 +5463,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
@@ -5255,28 +5477,33 @@
 
 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:5261: checking for initscr in -lcurses" >&5
-ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
+  cf_term_lib=predefined
+else
+  echo "$ac_t""no" 1>&6
+
+		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:5488: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lcurses  $LIBS"
+LIBS="-l$cf_term_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5269 "configure"
+#line 5496 "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
     builtin and then its argument prototype would still apply.  */
-char initscr();
+char tgoto();
 
 int main() {
-initscr()
+tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5507: \"$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
@@ -5291,71 +5518,30 @@
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lcurses $LIBS"
-
+  break
 else
   echo "$ac_t""no" 1>&6
-
-		{ echo "configure: error: cannot link curses" 1>&2; exit 1; }
 fi
 
-
-else
-  echo "$ac_t""no" 1>&6
-
-echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:5314: 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
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ltermcap  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5322 "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
-    builtin and then its argument prototype would still apply.  */
-char tgoto();
-
-int main() {
-tgoto()
-; return 0; }
-EOF
-if { (eval echo configure:5333: \"$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
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+		done
+	
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-	LIBS="-ltermcap $cf_save_LIBS"
-	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:5351: checking for initscr in -lcurses" >&5
-ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
+
+	# Check for library containing initscr
+	test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+	for cf_curs_lib in curses ncurses xcurses cursesX jcurses unknown
+	do
+		echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
+echo "configure:5537: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lcurses  $LIBS"
+LIBS="-l$cf_curs_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5359 "configure"
+#line 5545 "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
@@ -5366,7 +5552,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5556: \"$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
@@ -5381,172 +5567,81 @@
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lcurses $LIBS"
-
+  break
 else
   echo "$ac_t""no" 1>&6
+fi
 
-		echo $ac_n "checking for initscr in -lcursesX""... $ac_c" 1>&6
-echo "configure:5397: checking for initscr in -lcursesX" >&5
-ac_lib_var=`echo cursesX'_'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
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lcursesX  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5405 "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
-    builtin and then its argument prototype would still apply.  */
-char initscr();
+	done
+	test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
 
+	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:5582: checking if we can link with $cf_curs_lib library" >&5
+		cat > conftest.$ac_ext <<EOF
+#line 5584 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cf_result=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo cursesX | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lcursesX $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-
-			echo $ac_n "checking for initscr in -ljcurses""... $ac_c" 1>&6
-echo "configure:5443: checking for initscr in -ljcurses" >&5
-ac_lib_var=`echo jcurses'_'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
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ljcurses  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5451 "configure"
+		echo "$ac_t""$cf_result" 1>&6
+		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:5605: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+		cat > conftest.$ac_ext <<EOF
+#line 5607 "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
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
-initscr()
+initscr(); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:5462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_result=no
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo jcurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-ljcurses $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-
-				{ echo "configure: error: cannot link curses" 1>&2; exit 1; }
-fi
-
-fi
-
-fi
-
-	
-else
-  echo "$ac_t""no" 1>&6
-
-	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:5500: 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
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lcurses  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5508 "configure"
+  
+			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+			cat > conftest.$ac_ext <<EOF
+#line 5624 "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
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cf_result=error
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lcurses $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-
-		{ echo "configure: error: cannot link curses" 1>&2; exit 1; }
-fi
-
+			
 fi
-
-
+rm -f conftest*
+		echo "$ac_t""$cf_result" 1>&6
+	fi
 fi
 
 
@@ -5557,7 +5652,7 @@
 	found_tcap=no
 	if test $found_ncurses = yes ; then
 		echo $ac_n "checking for tgoto in -lncurses""... $ac_c" 1>&6
-echo "configure:5561: checking for tgoto in -lncurses" >&5
+echo "configure:5656: 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
@@ -5565,7 +5660,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5569 "configure"
+#line 5664 "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
@@ -5576,7 +5671,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5675: \"$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
@@ -5604,7 +5699,7 @@
 			# 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:5608: checking for tgoto in -lmytinfo" >&5
+echo "configure:5703: 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
@@ -5612,7 +5707,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5616 "configure"
+#line 5711 "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
@@ -5623,7 +5718,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5722: \"$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
@@ -5648,7 +5743,7 @@
 	fi
 	if test $found_tcap != yes ; then
 		echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>&6
-echo "configure:5652: checking for tgoto in -ltermlib" >&5
+echo "configure:5747: 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
@@ -5656,7 +5751,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5660 "configure"
+#line 5755 "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
@@ -5667,7 +5762,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5766: \"$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
@@ -5691,7 +5786,7 @@
 	if test "$found_tcap" != yes; then
 		# allow curses library for broken AIX system.
 		echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:5695: checking for initscr in -lcurses" >&5
+echo "configure:5790: 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
@@ -5699,7 +5794,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5703 "configure"
+#line 5798 "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
@@ -5710,7 +5805,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5809: \"$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
@@ -5731,7 +5826,7 @@
 fi
 
 		echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:5735: checking for tgoto in -ltermcap" >&5
+echo "configure:5830: 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
@@ -5739,7 +5834,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5743 "configure"
+#line 5838 "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
@@ -5750,7 +5845,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5849: \"$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
@@ -5773,7 +5868,7 @@
 	fi
 	if test "$found_tcap" != yes; then
 		echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:5777: checking for tgoto in -ltermcap" >&5
+echo "configure:5872: 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
@@ -5781,7 +5876,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5785 "configure"
+#line 5880 "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
@@ -5792,7 +5887,7 @@
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5891: \"$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
@@ -5819,11 +5914,11 @@
 	# terminfo-based termcap interfaces may be prototyped in <curses.h>,
 	# which may/may not be compatible with <termcap.h>
 	echo $ac_n "checking if we should include termcap.h""... $ac_c" 1>&6
-echo "configure:5823: checking if we should include termcap.h" >&5
+echo "configure:5918: checking if we should include termcap.h" >&5
 	cf_save_CFLAGS="$CFLAGS"
 	CFLAGS="$CFLAGS -I$srcdir/include"
 	cat > conftest.$ac_ext <<EOF
-#line 5827 "configure"
+#line 5922 "configure"
 #include "confdefs.h"
 
 #define HAVE_TERMCAP_H 1
@@ -5832,7 +5927,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -5849,42 +5944,189 @@
 EOF
 
 fi
+
+echo $ac_n "checking for term.h""... $ac_c" 1>&6
+echo "configure:5950: checking for term.h" >&5
+if eval "test \"`echo '$''{'cf_cv_have_term_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+	cat > conftest.$ac_ext <<EOF
+#line 5956 "configure"
+#include "confdefs.h"
+
+#include <curses.h>
+#include <term.h>
+int main() {
+WINDOW *x
+; return 0; }
+EOF
+if { (eval echo configure:5965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_have_term_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_have_term_h=no
+fi
+rm -f conftest*
+	
+fi
+
+echo "$ac_t""$cf_cv_have_term_h" 1>&6
+test $cf_cv_have_term_h = yes && cat >> confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+
+
+
+echo $ac_n "checking if we should include curses.h or termcap.h""... $ac_c" 1>&6
+echo "configure:5987: checking if we should include curses.h or termcap.h" >&5
+if eval "test \"`echo '$''{'cf_cv_need_curses_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cf_save_CFLAGS="$CFLAGS"
+cf_cv_need_curses_h=no
+
+for cf_t_opts in "" "NEED_TERMCAP_H"
+do
+for cf_c_opts in "" "NEED_CURSES_H"
+do
+
+    CFLAGS="$cf_save_CFLAGS $CHECK_DECL_FLAG"
+    test -n "$cf_c_opts" && CFLAGS="$CFLAGS -D$cf_c_opts"
+    test -n "$cf_t_opts" && CFLAGS="$CFLAGS -D$cf_t_opts"
+
+    cat > conftest.$ac_ext <<EOF
+#line 6005 "configure"
+#include "confdefs.h"
+/* $cf_c_opts $cf_t_opts */
+$CHECK_DECL_HDRS
+int main() {
+char *x = (char *)tgoto("")
+; return 0; }
+EOF
+if { (eval echo configure:6013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  test "$cf_cv_need_curses_h" = no && {
+	     cf_cv_need_curses_h=maybe
+	     cf_ok_c_opts=$cf_c_opts
+	     cf_ok_t_opts=$cf_t_opts
+	}
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&5
+	cat > conftest.$ac_ext <<EOF
+#line 6026 "configure"
+#include "confdefs.h"
+
+$CHECK_DECL_HDRS
+int main() {
+char *x = (char *)tgoto("",0,0)
+; return 0; }
+EOF
+if { (eval echo configure:6034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  cf_cv_need_curses_h=yes
+	 cf_ok_c_opts=$cf_c_opts
+	 cf_ok_t_opts=$cf_t_opts
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+
+	CFLAGS="$cf_save_CFLAGS"
+	test "$cf_cv_need_curses_h" = yes && break
+done
+	test "$cf_cv_need_curses_h" = yes && break
+done
+
+if test "$cf_cv_need_curses_h" != no ; then
+	echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T:$cf_ok_t_opts)" >&5
+	if test -n "$cf_ok_c_opts" ; then
+		if test -n "$cf_ok_t_opts" ; then
+			cf_cv_need_curses_h=both
+		else
+			cf_cv_need_curses_h=curses.h
+		fi
+	elif test -n "$cf_ok_t_opts" ; then
+		cf_cv_need_curses_h=termcap.h
+	elif test "$cf_cv_have_term_h" = yes ; then
+		cf_cv_need_curses_h=term.h
+	else 
+		cf_cv_need_curses_h=no
+	fi
+fi
+
+fi
+
+echo "$ac_t""$cf_cv_need_curses_h" 1>&6
+
+case $cf_cv_need_curses_h in
+both) #(vi
+	cat >> confdefs.h <<EOF
+#define NEED_CURSES_H 1
+EOF
+
+	cat >> confdefs.h <<EOF
+#define NEED_TERMCAP_H 1
+EOF
+
+	;;
+curses.h) #(vi
+	cat >> confdefs.h <<EOF
+#define NEED_CURSES_H 1
+EOF
+
+	;;
+termcap.h) #(vi
+	cat >> confdefs.h <<EOF
+#define NEED_TERMCAP_H 1
+EOF
+
+	;;
+esac
+
+
+
+
+
 echo $ac_n "checking declaration of tputs 3rd param""... $ac_c" 1>&6
-echo "configure:5854: checking declaration of tputs 3rd param" >&5
+echo "configure:6104: checking declaration of tputs 3rd param" >&5
 if eval "test \"`echo '$''{'cf_cv_type_outchar'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
+
 cf_cv_type_outchar="int OutChar(int)"
 cf_cv_found=no
+cf_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
+
 for P in int void; do
 for Q in int void; do
 for R in int char; do
 for S in "" const; do
+
 	cat > conftest.$ac_ext <<EOF
-#line 5866 "configure"
+#line 6121 "configure"
 #include "confdefs.h"
-
-#ifdef USE_TERMINFO
-#include <curses.h>
-#if HAVE_TERM_H
-#include <term.h>
-#endif
-#else
-#ifdef NEED_CURSES_H	/* FIXME: need a test */
-#include <curses.h>
-#endif
-#if HAVE_TERMCAP_H
-#include <termcap.h>
-#endif
-#endif 
+$CHECK_DECL_HDRS
 int main() {
 extern $Q OutChar($R);
 	extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
 	tputs("", 1, OutChar)
 ; return 0; }
 EOF
-if { (eval echo configure:5888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_type_outchar="$Q OutChar($R)"
 	 cf_cv_found=yes
@@ -5922,18 +6164,20 @@
 	;;
 esac
 
+CFLAGS="$cf_save_CFLAGS"
+
 
 ###	Checks for external-data
 
 
 echo $ac_n "checking declaration of errno""... $ac_c" 1>&6
-echo "configure:5931: checking declaration of errno" >&5
+echo "configure:6175: 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 5937 "configure"
+#line 6181 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5943,7 +6187,7 @@
 long x = (long) errno
 ; return 0; }
 EOF
-if { (eval echo configure:5947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'errno'=yes'
 else
@@ -5973,9 +6217,9 @@
 EOF
 
     echo $ac_n "checking existence of errno""... $ac_c" 1>&6
-echo "configure:5977: checking existence of errno" >&5
+echo "configure:6221: checking existence of errno" >&5
         cat > conftest.$ac_ext <<EOF
-#line 5979 "configure"
+#line 6223 "configure"
 #include "confdefs.h"
 
 #undef errno
@@ -5985,7 +6229,7 @@
 errno = 2
 ; return 0; }
 EOF
-if { (eval echo configure:5989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_have_'errno'=yes'
 else
@@ -6018,13 +6262,13 @@
 do
     
 echo $ac_n "checking declaration of $cf_name""... $ac_c" 1>&6
-echo "configure:6022: checking declaration of $cf_name" >&5
+echo "configure:6266: 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 6028 "configure"
+#line 6272 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6034,7 +6278,7 @@
 long x = (long) $cf_name
 ; return 0; }
 EOF
-if { (eval echo configure:6038: \"$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*
   eval 'cf_cv_dcl_'$cf_name'=yes'
 else
@@ -6064,9 +6308,9 @@
 EOF
 
     echo $ac_n "checking existence of $cf_name""... $ac_c" 1>&6
-echo "configure:6068: checking existence of $cf_name" >&5
+echo "configure:6312: checking existence of $cf_name" >&5
         cat > conftest.$ac_ext <<EOF
-#line 6070 "configure"
+#line 6314 "configure"
 #include "confdefs.h"
 
 #undef $cf_name
@@ -6076,7 +6320,7 @@
 $cf_name = 2
 ; return 0; }
 EOF
-if { (eval echo configure:6080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_have_'$cf_name'=yes'
 else
@@ -6150,12 +6394,12 @@
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6154: checking for $ac_func" >&5
+echo "configure:6398: 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 6159 "configure"
+#line 6403 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6178,7 +6422,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6204,7 +6448,7 @@
 
 
 echo $ac_n "checking for fork""... $ac_c" 1>&6
-echo "configure:6208: checking for fork" >&5
+echo "configure:6452: checking for fork" >&5
 if eval "test \"`echo '$''{'cf_cv_func_fork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6213,7 +6457,7 @@
   cf_cv_func_fork=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6217 "configure"
+#line 6461 "configure"
 #include "confdefs.h"
 
 int main()
@@ -6223,7 +6467,7 @@
 	exit(0);
 }
 EOF
-if { (eval echo configure:6227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_func_fork=yes
 else
@@ -6247,7 +6491,7 @@
 if test ".$ac_cv_func_memmove" != .yes ; then
 	if test ".$ac_cv_func_bcopy" = ".yes" ; then
 		echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6
-echo "configure:6251: checking if bcopy does overlapping moves" >&5
+echo "configure:6495: checking if bcopy does overlapping moves" >&5
 		if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6256,7 +6500,7 @@
   cf_cv_good_bcopy=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6260 "configure"
+#line 6504 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -6269,7 +6513,7 @@
 }
 		
 EOF
-if { (eval echo configure:6273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_good_bcopy=yes
 else
@@ -6303,9 +6547,9 @@
 
 
 echo $ac_n "checking if select expects int * arguments""... $ac_c" 1>&6
-echo "configure:6307: checking if select expects int * arguments" >&5
+echo "configure:6551: checking if select expects int * arguments" >&5
 cat > conftest.$ac_ext <<EOF
-#line 6309 "configure"
+#line 6553 "configure"
 #include "confdefs.h"
 #include <time.h>
 EOF
@@ -6324,7 +6568,7 @@
 
 
 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:6328: checking whether setpgrp takes no argument" >&5
+echo "configure:6572: checking whether setpgrp takes no argument" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6332,7 +6576,7 @@
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 6336 "configure"
+#line 6580 "configure"
 #include "confdefs.h"
 
 /*
@@ -6348,7 +6592,7 @@
 }
 
 EOF
-if { (eval echo configure:6352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_setpgrp_void=no
 else
@@ -6382,12 +6626,12 @@
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6386: checking for $ac_func" >&5
+echo "configure:6630: 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 6391 "configure"
+#line 6635 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6410,7 +6654,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6437,9 +6681,9 @@
 
 if test $ac_cv_func_sigaction = yes; then
 echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6
-echo "configure:6441: checking whether sigaction needs _POSIX_SOURCE" >&5
+echo "configure:6685: checking whether sigaction needs _POSIX_SOURCE" >&5
 cat > conftest.$ac_ext <<EOF
-#line 6443 "configure"
+#line 6687 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -6447,7 +6691,7 @@
 struct sigaction act;
 ; return 0; }
 EOF
-if { (eval echo configure:6451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   sigact_bad=no
 else
@@ -6465,7 +6709,7 @@
 
 
 echo $ac_n "checking for setuid-like functions""... $ac_c" 1>&6
-echo "configure:6469: checking for setuid-like functions" >&5
+echo "configure:6713: checking for setuid-like functions" >&5
 if eval "test \"`echo '$''{'cf_cv_setuid_funcs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6486,13 +6730,13 @@
 
 
 echo $ac_n "checking for type sigaction_t""... $ac_c" 1>&6
-echo "configure:6490: checking for type sigaction_t" >&5
+echo "configure:6734: checking for type sigaction_t" >&5
 if eval "test \"`echo '$''{'cf_cv_type_sigaction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6496 "configure"
+#line 6740 "configure"
 #include "confdefs.h"
 
 #include <signal.h>
@@ -6500,7 +6744,7 @@
 sigaction_t x
 ; return 0; }
 EOF
-if { (eval echo configure:6504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_type_sigaction=yes
 else
@@ -6520,13 +6764,13 @@
 
 
 echo $ac_n "checking for nonconflicting termios.h""... $ac_c" 1>&6
-echo "configure:6524: checking for nonconflicting termios.h" >&5
+echo "configure:6768: checking for nonconflicting termios.h" >&5
 if eval "test \"`echo '$''{'cf_cv_use_termios_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6530 "configure"
+#line 6774 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_IOCTL_H
@@ -6548,7 +6792,7 @@
 	(void) tcgetattr (0, &save_tty)
 ; return 0; }
 EOF
-if { (eval echo configure:6552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_use_termios_h=yes
 else
@@ -6579,13 +6823,13 @@
 
 
 echo $ac_n "checking for tm.tm_gmtoff""... $ac_c" 1>&6
-echo "configure:6583: checking for tm.tm_gmtoff" >&5
+echo "configure:6827: checking for tm.tm_gmtoff" >&5
 if eval "test \"`echo '$''{'cf_cv_tm_gmtoff'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6589 "configure"
+#line 6833 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -6605,7 +6849,7 @@
 	long bar = foo.tm_gmtoff
 ; return 0; }
 EOF
-if { (eval echo configure:6609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_tm_gmtoff=yes
 else
@@ -6625,7 +6869,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:6629: checking for long file names" >&5
+echo "configure:6873: checking for long file names" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6670,7 +6914,7 @@
 
 
 echo $ac_n "checking declaration of signal arguments""... $ac_c" 1>&6
-echo "configure:6674: checking declaration of signal arguments" >&5
+echo "configure:6918: checking declaration of signal arguments" >&5
 if eval "test \"`echo '$''{'cf_cv_sig_args'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6679,7 +6923,7 @@
 for cf_test in "int sig" "int sig, ..."
 do
 	cat > conftest.$ac_ext <<EOF
-#line 6683 "configure"
+#line 6927 "configure"
 #include "confdefs.h"
 
 #include <signal.h>
@@ -6687,7 +6931,7 @@
 extern RETSIGTYPE catch($cf_test); signal(SIGINT, catch)
 ; return 0; }
 EOF
-if { (eval echo configure:6691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sig_args="$cf_test";break
 else
@@ -6710,17 +6954,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6714: checking for $ac_hdr" >&5
+echo "configure:6958: 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 6719 "configure"
+#line 6963 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6757,17 +7001,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6761: checking for $ac_hdr" >&5
+echo "configure:7005: 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 6766 "configure"
+#line 7010 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6797,17 +7041,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6801: checking for $ac_hdr" >&5
+echo "configure:7045: 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 6806 "configure"
+#line 7050 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6848,13 +7092,13 @@
 
 
 echo $ac_n "checking for union wait""... $ac_c" 1>&6
-echo "configure:6852: checking for union wait" >&5
+echo "configure:7096: 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 6858 "configure"
+#line 7102 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -6865,7 +7109,7 @@
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7113: \"$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
@@ -6876,7 +7120,7 @@
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 6880 "configure"
+#line 7124 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -6891,7 +7135,7 @@
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7139: \"$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
@@ -6916,7 +7160,7 @@
 
 
 echo $ac_n "checking if the system function returns usable child-status""... $ac_c" 1>&6
-echo "configure:6920: checking if the system function returns usable child-status" >&5
+echo "configure:7164: checking if the system function returns usable child-status" >&5
 if eval "test \"`echo '$''{'cf_cv_system_status'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6925,7 +7169,7 @@
   cf_cv_system_status=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6929 "configure"
+#line 7173 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6958,7 +7202,7 @@
 }
 
 EOF
-if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_system_status=no
 else
@@ -6969,11 +7213,11 @@
   cf_cv_system_status=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6973 "configure"
+#line 7217 "configure"
 #include "confdefs.h"
 int main() { exit(system("exit 23") != (23 << 8)); }
 EOF
-if { (eval echo configure:6977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_system_status=yes
 else
@@ -6999,6 +7243,73 @@
 
 
 
+# Check if we are trying to use curses+color, but cannot
+if test $use_color = yes ; then
+	if test $use_curses = yes ; then
+		
+echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6
+echo "configure:7252: 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 7258 "configure"
+#include "confdefs.h"
+
+#include <$cf_cv_ncurses_header>
+
+int main() {
+chtype x = COLOR_BLUE;
+	 has_colors();
+	 start_color();
+#ifndef NCURSES_BROKEN
+	 wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */
+#endif
+	
+; return 0; }
+EOF
+if { (eval echo configure:7273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  cf_cv_color_curses=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_color_curses=no
+fi
+rm -f conftest*
+	
+fi
+
+echo "$ac_t""$cf_cv_color_curses" 1>&6
+if test $cf_cv_color_curses = yes ; then
+	cat >> confdefs.h <<\EOF
+#define COLOR_CURSES 1
+EOF
+
+	test ".$cf_cv_ncurses_broken" != .yes && cat >> confdefs.h <<\EOF
+#define HAVE_GETBKGD 1
+EOF
+
+fi
+
+		if test $cf_cv_color_curses = yes ; then
+			cat >> confdefs.h <<\EOF
+#define HAVE_COLOR 1
+EOF
+
+		else
+			echo "configure: warning: This curses library does not support color" 1>&2
+		fi
+	else
+		cat >> confdefs.h <<\EOF
+#define HAVE_COLOR 1
+EOF
+
+	fi
+fi
+
 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 if test -n "$GCC"; then
   check_sig_const=yes
@@ -7014,7 +7325,7 @@
   
 
 echo $ac_n "checking for redefinable signal constants""... $ac_c" 1>&6
-echo "configure:7018: checking for redefinable signal constants" >&5
+echo "configure:7329: checking for redefinable signal constants" >&5
 if eval "test \"`echo '$''{'cf_cv_sig_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7026,7 +7337,7 @@
   cf_cv_sig_const=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 7030 "configure"
+#line 7341 "configure"
 #include "confdefs.h"
 
 #define NEW_DFL	((RETSIGTYPE (*)($cf_test))0)
@@ -7053,7 +7364,7 @@
 	exit(0);
 }
 EOF
-if { (eval echo configure:7057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_sig_const=yes
 else
@@ -7079,13 +7390,13 @@
 
 
 echo $ac_n "checking for ANSI qsort""... $ac_c" 1>&6
-echo "configure:7083: checking for ANSI qsort" >&5
+echo "configure:7394: checking for ANSI qsort" >&5
 if eval "test \"`echo '$''{'cf_cv_comptype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7089 "configure"
+#line 7400 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -7097,7 +7408,7 @@
 	 qsort(foo, sizeof(foo)/sizeof(*foo), sizeof(*foo), compare)
 ; return 0; }
 EOF
-if { (eval echo configure:7101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7412: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_comptype=yes
 else
@@ -7125,7 +7436,7 @@
 
 
 echo $ac_n "checking if application can dump core""... $ac_c" 1>&6
-echo "configure:7129: checking if application can dump core" >&5
+echo "configure:7440: checking if application can dump core" >&5
 if eval "test \"`echo '$''{'cf_cv_corefile'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7134,7 +7445,7 @@
   cf_cv_corefile=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 7138 "configure"
+#line 7449 "configure"
 #include "confdefs.h"
 
 #include <signal.h>
@@ -7175,7 +7486,7 @@
 #endif
 }
 EOF
-if { (eval echo configure:7179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_corefile=yes
 else
@@ -7220,18 +7531,18 @@
 
 
 echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
-echo "configure:7224: checking for missing "${ac_func}" extern" >&5
+echo "configure:7535: checking for missing "${ac_func}" extern" >&5
 if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 
-echo "(line 7230) testing for missing "${ac_func}" external ..." 1>&5
+echo "(line 7541) testing for missing "${ac_func}" external ..." 1>&5
 
 cf_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 cat > conftest.$ac_ext <<EOF
-#line 7235 "configure"
+#line 7546 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7245,7 +7556,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -7281,18 +7592,18 @@
 
 
 echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
-echo "configure:7285: checking for missing "${ac_func}" extern" >&5
+echo "configure:7596: checking for missing "${ac_func}" extern" >&5
 if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 
-echo "(line 7291) testing for missing "${ac_func}" external ..." 1>&5
+echo "(line 7602) testing for missing "${ac_func}" external ..." 1>&5
 
 cf_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 cat > conftest.$ac_ext <<EOF
-#line 7296 "configure"
+#line 7607 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7306,7 +7617,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -7342,18 +7653,18 @@
 
 
 echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
-echo "configure:7346: checking for missing "${ac_func}" extern" >&5
+echo "configure:7657: checking for missing "${ac_func}" extern" >&5
 if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 
-echo "(line 7352) testing for missing "${ac_func}" external ..." 1>&5
+echo "(line 7663) testing for missing "${ac_func}" external ..." 1>&5
 
 cf_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 cat > conftest.$ac_ext <<EOF
-#line 7357 "configure"
+#line 7668 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7367,7 +7678,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -7456,18 +7767,18 @@
 
 
 echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
-echo "configure:7460: checking for missing "${ac_func}" extern" >&5
+echo "configure:7771: checking for missing "${ac_func}" extern" >&5
 if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 
-echo "(line 7466) testing for missing "${ac_func}" external ..." 1>&5
+echo "(line 7777) testing for missing "${ac_func}" external ..." 1>&5
 
 cf_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 cat > conftest.$ac_ext <<EOF
-#line 7471 "configure"
+#line 7782 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7481,7 +7792,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -7519,18 +7830,18 @@
 
 
 echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
-echo "configure:7523: checking for missing "${ac_func}" extern" >&5
+echo "configure:7834: checking for missing "${ac_func}" extern" >&5
 if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 
-echo "(line 7529) testing for missing "${ac_func}" external ..." 1>&5
+echo "(line 7840) testing for missing "${ac_func}" external ..." 1>&5
 
 cf_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 cat > conftest.$ac_ext <<EOF
-#line 7534 "configure"
+#line 7845 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7544,7 +7855,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -7579,18 +7890,18 @@
 
 
 echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
-echo "configure:7583: checking for missing "${ac_func}" extern" >&5
+echo "configure:7894: checking for missing "${ac_func}" extern" >&5
 if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 
-echo "(line 7589) testing for missing "${ac_func}" external ..." 1>&5
+echo "(line 7900) testing for missing "${ac_func}" external ..." 1>&5
 
 cf_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 cat > conftest.$ac_ext <<EOF
-#line 7594 "configure"
+#line 7905 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7604,7 +7915,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -7631,7 +7942,7 @@
 
 
 echo $ac_n "checking for working TIOCGWINSZ""... $ac_c" 1>&6
-echo "configure:7635: checking for working TIOCGWINSZ" >&5
+echo "configure:7946: checking for working TIOCGWINSZ" >&5
 if eval "test \"`echo '$''{'cf_cv_use_tiocgwinsz'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7642,7 +7953,7 @@
   cf_cv_use_tiocgwinsz=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 7646 "configure"
+#line 7957 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -7667,7 +7978,7 @@
 	exit(0);	/* we cannot guarantee this is run interactively */
 }
 EOF
-if { (eval echo configure:7671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   cf_cv_use_tiocgwinsz=yes
 else
@@ -7869,6 +8180,8 @@
 s%@PATH_METAMAIL@%$PATH_METAMAIL%g
 s%@PATH_PGP@%$PATH_PGP%g
 s%@PATH_SUM@%$PATH_SUM%g
+s%@DEFAULT_EDITOR@%$DEFAULT_EDITOR%g
+s%@DEFAULT_MAILER@%$DEFAULT_MAILER%g
 s%@ENABLE_DEBUG@%$ENABLE_DEBUG%g
 s%@SHOW_CC@%$SHOW_CC%g
 s%@ECHO_CC@%$ECHO_CC%g
diff -Nur tin-980202/configure.in tin-980226/configure.in
--- tin-980202/configure.in	Sat Jan 31 06:25:05 1998
+++ tin-980226/configure.in	Sat Feb 21 16:40:27 1998
@@ -2,10 +2,10 @@
 dnl Module    : configure.in
 dnl Author    : Thomas E. Dickey <dickey@clark.net>
 dnl Created   : 24.08.95
-dnl Updated   : 04.12.97
+dnl Updated   : 20.02.98
 dnl Notes     :
 dnl
-dnl Copyright 1996,1997 by Thomas Dickey
+dnl Copyright 1996,1997,1998 by Thomas Dickey
 dnl             You may  freely  copy or  redistribute  this software,
 dnl             so  long as there is no profit made from its use, sale
 dnl             trade or  reproduction.  You may not change this copy-
@@ -73,6 +73,10 @@
 [  --with-sum              (default: from system path)])
 CF_PROG_SUM_R
 
+CF_PATH_EDITOR
+CF_PATH_MAILER
+CF_PATH_MAILBOX
+
 ### check for this early, since it'll override several options
 AC_MSG_CHECKING(if NNTP-support will be used)
 CF_ARG_DISABLE(nntp,
@@ -320,9 +324,9 @@
 
 AC_MSG_CHECKING(whether to enable ANSI-color)
 CF_ARG_DISABLE(color,
-	[  --disable-color         disable ANSI-color support],,
-	[AC_DEFINE(HAVE_COLOR)])
-AC_MSG_RESULT($enableval)
+	[  --disable-color         disable ANSI-color support])
+use_color=$enableval
+AC_MSG_RESULT($use_color)
 
 AC_MSG_CHECKING(whether to enable posting-etiquette)
 CF_ARG_DISABLE(etiquette,
@@ -616,6 +620,20 @@
 AC_SYS_LONG_FILE_NAMES
 CF_SIG_ARGS
 CF_FUNC_SYSTEM
+
+# Check if we are trying to use curses+color, but cannot
+if test $use_color = yes ; then
+	if test $use_curses = yes ; then
+		CF_COLOR_CURSES
+		if test $cf_cv_color_curses = yes ; then
+			AC_DEFINE(HAVE_COLOR)
+		else
+			AC_MSG_WARN(This curses library does not support color)
+		fi
+	else
+		AC_DEFINE(HAVE_COLOR)
+	fi
+fi
 
 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 if test -n "$GCC"; then
diff -Nur tin-980202/doc/CHANGES tin-980226/doc/CHANGES
--- tin-980202/doc/CHANGES	Mon Feb  2 13:42:13 1998
+++ tin-980226/doc/CHANGES	Thu Feb 26 16:17:28 1998
@@ -1,3 +1,80 @@
+-- pre-1.4 release 980226 --
+
+566) Michael Stenns <stenns@hal.tci.uni-hannover.de>
+     ADD. fallback to "XHDR Xref" (if possible) if Xref is no present
+          in the overviewfile
+     FIX. lang.c, xref.c
+
+565) Kirk Bauer <kirk@kaybee.org>
+     Urs Janssen <urs@tin.org>
+     ADD. pass newsgroup name as first argument to external sigfile creator
+     FIX. sigfile.c
+
+564) Thomas E. Dickey <dickey@clark.net>
+     ADD. missing strerror() for SunOS 4.x
+     ADD. new/improved configure script checks for curses & termcap libraries
+          and headers.
+     ADD. configure options/checks for default editor, mailer and mailpath
+     ADD. configure check for curses-color support
+     ADD. ifdef in tin.h to reduce the noise when compiling on SunOS 4.x
+     FIX. aclocal.m4, configure[.in], autoconf.h[in], proto.h, tin.h,
+          screen.c, string.c
+
+563) Florian Kuehnert <sutok@gmx.de>
+     Urs Janssen <urs@tin.org>
+     ADD. skip article header when spellchecking
+     BUG. append_file() was broken
+     FIX. misc.c
+
+562) Sven Paulus <sven@tin.org>
+     ADD. 'z' (lynx style) as abort-key
+     FIX. read.c
+
+561) Yuri Kuzmenko <yuri@killer.cracksoft.kiev.ua>
+     BUG. tin sometimes freezes if getting a SIGHUP
+     FIX. init.c, open.c, signal.c
+
+560) Borislav Deianov <borislav@CS.Cornell.EDU>
+     BUG. tin retrys to connect after getting a 503 response from the
+          server
+     FIX. nntplib.c, open.c
+
+559) Ralf Doeblitz <doeblitz@gmx.de>
+     BUG. screen not cleared when scrolling by page
+     BUG. screen not redrawn when forcing redraw with
+          iKeyConfigRedrawScr
+     ADD. check for us-ascii when posting with non-7bit encoding
+     FIX. extern.h, config.c, lang.c, post.c
+
+558) Zbigniew Zych <zych@onet.pl>
+     Florian Kuehnert <sutok@gmx.de>
+     BUG. typos
+     FIX. lang.c, README
+
+557) Urs Janssen <urs@tin.org>
+     ADD. updated pcre (1.05 -> 1.07)
+     FIX. pcre/*
+
+556) Thomas E. Dickey <dickey@clark.net>
+     BUG. sh_format() escaped allready escaped chars
+     FIX. save.c, string.c
+
+555) Ralf Doeblitz <doeblitz@gmx.de>
+     BUG. rule.icase sometimes used uninitialized
+     FIX. filter.c
+
+554) Henryk Bochmann <bochmann@TUDURZ.urz.tu-dresden.de>
+     Michael Stenns <stenns@hal.tci.uni-hannover.de>
+     Thomas E. Dickey <dickey@clark.net>
+     Urs Janssen <urs@tin.org>
+     BUG. preprocesser symbol for OpenBSD was missing
+     ADD. check for HP-UX >=10
+     BUG. #ifdef NO_SHELL_ESCAPE was missing
+     BUG. TIN_DEFAULTS_DIR didn't get defined due misspelling
+     BUG. removed missplaced barce
+     BUG. no automatic aggregate initialization
+     FIX. init.c, misc.c, select.c, tin.h, autoconf.h[in]
+
 -- pre-1.4 release 980202 --
 
 553) Michael Stenns <stenns@hal.tci.uni-hannover.de>
diff -Nur tin-980202/doc/INSTALL tin-980226/doc/INSTALL
--- tin-980202/doc/INSTALL	Sun Feb  1 04:55:07 1998
+++ tin-980226/doc/INSTALL	Wed Feb 25 06:09:41 1998
@@ -343,7 +343,7 @@
 	DEC Alpha AXP & Linux 2.0.0 with gcc 2.7.1
 	Amiga 4000/040 & Linux 2.0.29 with gcc 2.7.2
 
-2)	HP 9000/825 & HP-UX 8.00 with cc
+2)	HP 9000/835 & HP-UX 8.00 with cc
 	HP 9000/825 & HP-UX 8.00 with gcc 2.7.2
 	HP 9000/735 & HP-UX 9.02 with gcc 2.6.3
 	HP 9000/720 & HP-UX 9.05 with cc
diff -Nur tin-980202/doc/TODO tin-980226/doc/TODO
--- tin-980202/doc/TODO	Mon Feb  2 15:22:09 1998
+++ tin-980226/doc/TODO	Thu Feb 19 11:36:20 1998
@@ -84,8 +84,6 @@
    to fix the problem properly in config.c by flashing changes to all
    groups using default attributes.
 
-o  ispell checks all headers
-
 o  tin crashes if compiled without default-newsserver and unset $NNTPSERVER
    ???
 
diff -Nur tin-980202/doc/tin.1 tin-980226/doc/tin.1
--- tin-980202/doc/tin.1	Sun Feb  1 05:10:08 1998
+++ tin-980226/doc/tin.1	Sat Feb 21 22:15:58 1998
@@ -2588,51 +2588,52 @@
 I wish to thank the following people for supplying patches:
 .PP
 David Abbott, Earle Ake, Orbby S. Arka, Joachim Astel, Anton Aylward, Jens
-Chr. Bachem, George Baltz, Volker Barthelmann, Paul Bauwens, Dieter Becker,
-Greg Berigan, Enrik Berkhan, Juergen Bernau, Dan Berry, David Binderman,
-Andrey Blochintsev, Chris Blum, Fokke de Boer, Andreas Borchert, Mark
-Boucher, Bill Brolik, Herman ten Brugge, Martin Buck, Leila Burrell-Davis,
-Sean Casey, Peter Castro, Troy Cauble, Andrey A. Chernov, Tan Kwee Chuan,
-Boleslaw Ciesielski, Robert Claeson, Steven Cogswell, Don Costello, Bryan
-Curnutt, Ned Danieley, Lars Dannenberg, Chris Davies, John Davis, Borislav
-Deianov, Thomas E. Dickey, Theo Van Dinter, Ralf Doeblitz, Bryan Dongray,
-Michael Douglass, Craig Durland, Bernd Eckenfels, Phil Edge, Kirk Edson,
-Stefan Elf, Rob Engle, Olle Eriksson, Brent Ermlick, Bernd Ernesti, Ragnar
-Hojland Espinosa, Jason Faultless, Michael Faurot, Werner Fleck, John M.
-Flinchbaugh, Andy Gabor, Torsten Gesang, Callum Gibson, Mike Glendinning,
-Philippe Goujard, Dan Greenspan, Karlo Gross, Carl Hage, Paul Halsema, Ed
-Hanway, Scott Hauck, Christian Haul, Per Headland, Arnold Hendriks, Daniel
-Hermans, Jose Herrero, Dave Hill, Tom Hite, Torsten Homeyer, Ulli Horlacher,
-Keith Howell, Tommy Hsieh, Shih-Kun Huang, Steve Hunt, Jeff Hurwitt, Pieter
-Immelman, Jarkko Isokungas, Patrick St. Jean, Hal Jespersen, Park Sang Jin,
-Robbin Johnson, Jarkko Jormanainen, Nelson Kading, Geoffrey Keating, Karsten
-Keil, Fritz Kleeman, Andreas Kies, Janne Kiviluoto, Tomasz Kloczko, Dwarven
-Knight, Thomas Koenig, Karl-Koenig Koenigsson, Martin Kraemer, Thomas
-Kroener, Kris Kugel, Yuri Kuzmenko, Olivier Lacroix, Geoff Lane, Alex Lange,
-Alain Lasserre, Hannu Laurila, Vincent Lefevre, Alexander Lehmann, Marty
-Leisner, Thomas Leitner, Hakan Lennestal, Kevin Lentin, Chua Choon Leong,
-Chris Lewis, Andreas Ley, David-Michael Lincke, Otto Lind, Richard Lloyd,
-Florian Lohoff, Reinhard Luebke, Clifford Luke, Michael Lupp, David
-MacKenzie, Hugh Mahon, Giuseppe De Marco, Dmitri A. Martynoff, Kazushi
-Marukawa, Owen Medd, Soren Moller, Bruce Momjian, Sergio Morales, Michael
-Morrell, Klaus Mueller, Mike Muise, Udo Munk, Daniel Naber, Torsten Neumann,
-Dirk Nimmich, James Nugen, David E. O'Brien, Michael O'Reilly, Oleg
-Ohotnikov, Ronald Orr, Julien Oster, Jeb Palmer, Neil Parker, Tom Parry, Jim
-Patterson, Sven Paulus, Walter Pelissero, Cameron Perkins, Colin Perkins,
-Eric Peterson, Tim Pierce, Bill Poitras, Scott W. Powers, Wolfgang Prediger,
-Thomas Quinot, Stefan Rapp, Ted Richards, Steve Robbins, Ollivier Robert,
-Branden Robinson, Jim Robinson, Stephen Roseman, Roland Rosenfeld, Peter Van
-Rossem, Clifton Royston, Rich Salz, Gary Sanders, Nickolay Saukh, John
-Sauter, Christopher Sawtell, Holger Schif, Volker Schmidt, John Schmitz,
-Torsten Schneider, Stefan Scholl, Rainer Scholz, Juergen Schroeder, Larry
-Schwimmer, Bart Sears, Karl-Olav Serrander, Doug Sewell, Philip Shearer,
-Jungshik Shin, Sergey Shkonda, Andreas Siegert, Mark Smith, Steve Spearman,
-Cliff Stanford, Steve Starck, Jason Steiner, Ralf Stephan, Helmrich
-Streitmatter, Michael Stenns, Dieter Stueken, Ed Sznyter, Dean Takemori,
-Darrell Tangman, Derek Terveer, Carsten Theis, Julian Thompson, David
-Tiller, Andry Timonin, Mark Tomlin, Michael Traub, Adri Verhoef, Paul
-Vickers, Oliver B. Warzecha, Jason Wessel, Cary Whitney, Henrik Wist, Greg
-Woods, Lloyd Wright, Billy Y., Nickolai Zeldovich
+Chr. Bachem, George Baltz, Volker Barthelmann, Kirk Bauer, Paul Bauwens,
+Dieter Becker, Greg Berigan, Enrik Berkhan, Juergen Bernau, Dan Berry, David
+Binderman, Andrey Blochintsev, Chris Blum, Fokke de Boer, Andreas Borchert,
+Mark Boucher, Bill Brolik, Herman ten Brugge, Martin Buck, Leila
+Burrell-Davis, Sean Casey, Peter Castro, Troy Cauble, Andrey A. Chernov, Tan
+Kwee Chuan, Boleslaw Ciesielski, Robert Claeson, Steven Cogswell, Don
+Costello, Bryan Curnutt, Ned Danieley, Lars Dannenberg, Chris Davies, John
+Davis, Borislav Deianov, Thomas E. Dickey, Theo Van Dinter, Ralf Doeblitz,
+Bryan Dongray, Michael Douglass, Craig Durland, Bernd Eckenfels, Phil Edge,
+Kirk Edson, Stefan Elf, Rob Engle, Olle Eriksson, Brent Ermlick, Bernd
+Ernesti, Ragnar Hojland Espinosa, Jason Faultless, Michael Faurot, Werner
+Fleck, John M. Flinchbaugh, Andy Gabor, Torsten Gesang, Callum Gibson, Mike
+Glendinning, Philippe Goujard, Dan Greenspan, Karlo Gross, Carl Hage, Paul
+Halsema, Ed Hanway, Scott Hauck, Christian Haul, Per Headland, Arnold
+Hendriks, Daniel Hermans, Jose Herrero, Dave Hill, Tom Hite, Torsten
+Homeyer, Ulli Horlacher, Keith Howell, Tommy Hsieh, Shih-Kun Huang, Steve
+Hunt, Jeff Hurwitt, Pieter Immelman, Jarkko Isokungas, Patrick St. Jean, Hal
+Jespersen, Park Sang Jin, Robbin Johnson, Jarkko Jormanainen, Nelson Kading,
+Geoffrey Keating, Karsten Keil, Fritz Kleeman, Andreas Kies, Janne
+Kiviluoto, Tomasz Kloczko, Dwarven Knight, Thomas Koenig, Karl-Koenig
+Koenigsson, Martin Kraemer, Thomas Kroener, Florian Kuehnert, Kris Kugel,
+Yuri Kuzmenko, Olivier Lacroix, Geoff Lane, Alex Lange, Alain Lasserre,
+Hannu Laurila, Vincent Lefevre, Alexander Lehmann, Marty Leisner, Thomas
+Leitner, Hakan Lennestal, Kevin Lentin, Chua Choon Leong, Chris Lewis,
+Andreas Ley, David-Michael Lincke, Otto Lind, Richard Lloyd, Florian Lohoff,
+Reinhard Luebke, Clifford Luke, Michael Lupp, David MacKenzie, Hugh Mahon,
+Giuseppe De Marco, Dmitri A. Martynoff, Kazushi Marukawa, Owen Medd, Soren
+Moller, Bruce Momjian, Sergio Morales, Michael Morrell, Klaus Mueller, Mike
+Muise, Udo Munk, Daniel Naber, Torsten Neumann, Dirk Nimmich, James Nugen,
+David E. O'Brien, Michael O'Reilly, Oleg Ohotnikov, Ronald Orr, Julien
+Oster, Jeb Palmer, Neil Parker, Tom Parry, Jim Patterson, Sven Paulus,
+Walter Pelissero, Cameron Perkins, Colin Perkins, Eric Peterson, Tim Pierce,
+Bill Poitras, Scott W. Powers, Wolfgang Prediger, Thomas Quinot, Stefan
+Rapp, Ted Richards, Steve Robbins, Ollivier Robert, Branden Robinson, Jim
+Robinson, Stephen Roseman, Roland Rosenfeld, Peter Van Rossem, Clifton
+Royston, Rich Salz, Gary Sanders, Nickolay Saukh, John Sauter, Christopher
+Sawtell, Holger Schif, Volker Schmidt, John Schmitz, Torsten Schneider,
+Stefan Scholl, Rainer Scholz, Juergen Schroeder, Larry Schwimmer, Bart
+Sears, Karl-Olav Serrander, Doug Sewell, Philip Shearer, Jungshik Shin,
+Sergey Shkonda, Andreas Siegert, Mark Smith, Steve Spearman, Cliff Stanford,
+Steve Starck, Jason Steiner, Ralf Stephan, Helmrich Streitmatter, Michael
+Stenns, Dieter Stueken, Ed Sznyter, Dean Takemori, Darrell Tangman, Derek
+Terveer, Carsten Theis, Julian Thompson, David Tiller, Andry Timonin, Mark
+Tomlin, Michael Traub, Adri Verhoef, Paul Vickers, Oliver B. Warzecha, Jason
+Wessel, Cary Whitney, Henrik Wist, Greg Woods, Lloyd Wright, Billy Y.,
+Nickolai Zeldovich, Zbigniew Zych
 .\"
 .\"
 .SH AUTHOR
diff -Nur tin-980202/include/autoconf.hin tin-980226/include/autoconf.hin
--- tin-980202/include/autoconf.hin	Sun Feb  1 08:18:36 1998
+++ tin-980226/include/autoconf.hin	Sat Feb 21 16:40:27 1998
@@ -3,7 +3,7 @@
  *  Module    : autoconf.hin
  *  Author    : Thomas Dickey <dickey@clark.net>
  *  Created   : 24.08.1995
- *  Updated   : 04.12.1997
+ *  Updated   : 10.02.1998
  *  Notes     : #include files, #defines & struct's
  *  Copyright : (c) Copyright 1996-98 by Thomas Dickey
  *              You may  freely  copy or  redistribute  this software,
@@ -55,9 +55,9 @@
 #undef	NO_ETIQUETTE
 #undef	NO_LOCALE
 #undef	OVERVIEW_FILE
-#undef	USE_SOCKS5
 #undef	SPOOLDIR
 #undef	USE_INN_NNTPLIB
+#undef	USE_SOCKS5
 
 /*
  * These are defined if the corresponding program is found during configuration
@@ -305,6 +305,9 @@
 /*
  * Program-paths (i.e., the invocation-path)
  */
+#undef	DEFAULT_EDITOR
+#undef	DEFAULT_MAILBOX
+#undef	DEFAULT_MAILER
 #undef	PATH_ISPELL
 #undef	PATH_METAMAIL
 #undef	PATH_SUM
@@ -419,6 +422,6 @@
  * can be left empty, tin searches for some standard places
  * XXXXX please define surrounded with double quotes! XXXXX
  */
-#undef TIN_DEFAULTS_PATH
+#undef TIN_DEFAULTS_DIR
 
 #undef HAVE_COFFEE
diff -Nur tin-980202/include/extern.h tin-980226/include/extern.h
--- tin-980202/include/extern.h	Sun Feb  1 10:04:12 1998
+++ tin-980226/include/extern.h	Sun Feb 15 12:13:02 1998
@@ -456,6 +456,7 @@
 extern constext txt_enter_option_num[];
 extern constext txt_enter_range[];
 extern constext txt_error_header_and_body_not_separate[];
+extern constext txt_error_header_line_bad_charset[];
 extern constext txt_error_header_line_blank[];
 extern constext txt_error_header_line_colon[];
 extern constext txt_error_header_line_comma[];
@@ -1216,6 +1217,7 @@
 extern t_bool confirm_to_quit;
 extern t_bool count_articles;
 extern t_bool created_rcdir;
+extern t_bool dangerous_signal_exit; /* TRUE if SIGHUP, SIGTERM, SIGUSR1 */
 extern t_bool default_auto_save;
 extern t_bool default_batch_save;
 extern t_bool default_filter_kill_case;
diff -Nur tin-980202/include/proto.h tin-980226/include/proto.h
--- tin-980202/include/proto.h	Mon Feb  2 14:44:24 1998
+++ tin-980226/include/proto.h	Sat Feb 21 16:40:27 1998
@@ -546,6 +546,10 @@
 #ifndef HAVE_STRTOL
 	extern long strtol (const char *str, char **ptr, int use_base);
 #endif /* HAVE STRTOL */
+#ifndef HAVE_STRERROR
+	extern char * my_strerror(int n);
+#	define strerror(n) my_strerror(n)
+#endif
 
 /* thread.c */
 extern int find_response (int i, int n);
diff -Nur tin-980202/include/tin.h tin-980226/include/tin.h
--- tin-980202/include/tin.h	Sun Feb  1 10:08:48 1998
+++ tin-980226/include/tin.h	Sat Feb 21 16:42:41 1998
@@ -185,6 +185,30 @@
 
 #ifdef HAVE_SYS_IOCTL_H
 #	include <sys/ioctl.h>
+/* We don't need/use these, and they cause redefinition errors with SunOS 4.x
+ * when we include termio.h or 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
 #endif
 
 #ifdef HAVE_PROTOTYPES_H
@@ -410,32 +434,21 @@
 #		define	strrchr(str, ch)	rindex(str, ch)
 #	endif
 #	define	DEFAULT_SHELL	"/bin/csh"
-#	if defined(__386BSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__FreeBSD__)
+#	if defined(__386BSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
 #		define	DEFAULT_PRINTER	"/usr/bin/lpr"
-#		define	DEFAULT_MAILER	"/usr/sbin/sendmail"
-#		define	DEFAULT_MAILBOX	"/var/mail"
 #		define	DEFAULT_SUM	"/usr/bin/cksum -o 1 <" /* use tailing <, otherwise get filename output too */
 #	else
-#		ifndef DEFAULT_EDITOR
-#			define	DEFAULT_EDITOR	"/usr/ucb/vi"
-#		endif
 #		define	DEFAULT_PRINTER	"/usr/ucb/lpr"
 #		define	DEFAULT_SUM	"sum"
 #	endif
 #	ifdef DGUX
-#		define	DEFAULT_MAILBOX	"/usr/mail"
 #		define	USE_INVERSE_HACK
 #	endif
 #	ifdef pyr
 #		define	DEFAULT_MAILER	"/usr/.ucbucb/mail"
 #	endif
 #else /* !BSD */
-#	if defined(NCR) || defined(atthcx) || defined(PTX) || defined(sinix)
-#		define	DEFAULT_MAILER	"/usr/bin/mailx"
-#	endif
 #	ifdef linux
-#		define	DEFAULT_MAILBOX	"/var/spool/mail"
-#		define	DEFAULT_MAILER	"/usr/sbin/sendmail"
 #		define	DEFAULT_PRINTER	"/usr/bin/lpr"
 #	endif
 #	ifdef M_AMIGA
@@ -485,12 +498,6 @@
 #		define	DEFAULT_UUDECODE	"uudecode %s"
 #		define	DEFAULT_UNSHAR	"unshar %s"
 #	endif
-#	ifdef M_XENIX
-#		ifndef DEFAULT_EDITOR
-#			define	DEFAULT_EDITOR	"/bin/vi"
-#		endif
-#		define	DEFAULT_MAILER	"/usr/bin/mail"
-#	endif
 #	ifdef QNX42
 #		ifndef DEFAULT_EDITOR
 #			define	DEFAULT_EDITOR	"/bin/vedit"
@@ -513,23 +520,15 @@
 #		define	DEFAULT_MAILER	"/bin/rmail"
 #	endif
 
-/*
- * TODO - check for new hp-ux (>=10) and correct the path
- * (new systems should have trasitions links to the old location, but...)
- *
- * DEFAULT_MAILER "/usr/sbin/sendmail"
- * DEFAULT_SHELL "/usr/bin/sh"
- * DEFAULT_MAILBOX "/var/mail/"
- */
+/* HP-UX >= 10 defines __STDC_EXT__ (ANSI) || __CLASSIC_C__ (K&R) */
+#	if defined (__hpux)
+#		if defined (__STDC_EXT__) || defined (__CLASSIC_C__)
+#			define DEFAULT_SHELL "/usr/bin/sh"
+#		endif
+#	endif
 
 #	ifndef DEFAULT_SHELL
 #		define	DEFAULT_SHELL	"/bin/sh"
-#	endif
-#	ifndef DEFAULT_MAILBOX
-#		define	DEFAULT_MAILBOX	"/usr/mail"
-#	endif
-#	ifndef DEFAULT_MAILER
-#		define	DEFAULT_MAILER	"/usr/lib/sendmail"
 #	endif
 #	ifndef DEFAULT_PRINTER
 #		define	DEFAULT_PRINTER	"/usr/bin/lp"
diff -Nur tin-980202/include/version.h tin-980226/include/version.h
--- tin-980202/include/version.h	Mon Feb  2 13:41:35 1998
+++ tin-980226/include/version.h	Thu Feb 26 16:09:34 1998
@@ -17,7 +17,7 @@
 
 #	define PRODUCT		"tin"
 #	define VERSION		"pre-1.4"
-#	define RELEASEDATE	"980202"
+#	define RELEASEDATE	"980226"
 #	define TINRC_VERSION	"1.1"
 
 #	ifdef M_AMIGA
diff -Nur tin-980202/makefile.in tin-980226/makefile.in
--- tin-980202/makefile.in	Mon Feb  2 13:41:36 1998
+++ tin-980226/makefile.in	Thu Feb 26 16:09:34 1998
@@ -7,7 +7,7 @@
 EXE		= tin
 MANEXT		= 1
 LVER		= 1.4
-PVER		= 980202
+PVER		= 980226
 VER		= pre-$(LVER)-$(PVER)
 MAIL_ADDR 	= "urs@tin.org"
 
diff -Nur tin-980202/pcre/ChangeLog tin-980226/pcre/ChangeLog
--- tin-980202/pcre/ChangeLog	Fri Dec 26 03:41:09 1997
+++ tin-980226/pcre/ChangeLog	Thu Feb 26 16:16:49 1998
@@ -2,6 +2,21 @@
 ------------------
 
 
+Version 1.07 16-Feb-98
+----------------------
+
+1. A pattern such as /((a)*)*/ was not being diagnosed as in error (unlimited
+repeat of a potentially empty string).
+
+
+Version 1.06 23-Jan-98
+----------------------
+
+1. Added Markus Oberhumer's little patches for C++.
+
+2. Literal strings longer than 255 characters were broken.
+
+
 Version 1.05 23-Dec-97
 ----------------------
 
diff -Nur tin-980202/pcre/internal.h tin-980226/pcre/internal.h
--- tin-980202/pcre/internal.h	Fri Dec 26 03:41:11 1997
+++ tin-980226/pcre/internal.h	Thu Feb 26 16:17:08 1998
@@ -3,7 +3,7 @@
 *************************************************/
 
 
-#define PCRE_VERSION       "1.05 23-Dec-1997"
+#define PCRE_VERSION       "1.07 16-Feb-1998"
 
 
 /* This is a library of functions to support regular expressions whose syntax
@@ -12,7 +12,7 @@
 
 Written by: Philip Hazel <ph10@cam.ac.uk>
 
-           Copyright (c) 1997 University of Cambridge
+           Copyright (c) 1998 University of Cambridge
 
 -----------------------------------------------------------------------------
 Permission is granted to anyone to use this software for any purpose on any
diff -Nur tin-980202/pcre/maketables.c tin-980226/pcre/maketables.c
--- tin-980202/pcre/maketables.c	Fri Dec 26 03:41:12 1997
+++ tin-980226/pcre/maketables.c	Thu Feb 26 16:17:08 1998
@@ -8,7 +8,7 @@
 
 Written by: Philip Hazel <ph10@cam.ac.uk>
 
-           Copyright (c) 1997 University of Cambridge
+           Copyright (c) 1998 University of Cambridge
 
 -----------------------------------------------------------------------------
 Permission is granted to anyone to use this software for any purpose on any
diff -Nur tin-980202/pcre/pcre.3 tin-980226/pcre/pcre.3
--- tin-980202/pcre/pcre.3	Fri Dec 26 03:41:13 1997
+++ tin-980226/pcre/pcre.3	Thu Feb 26 16:17:08 1998
@@ -1014,4 +1014,4 @@
 .br
 Phone: +44 1223 334714
 
-Copyright (c) 1997 University of Cambridge.
+Copyright (c) 1998 University of Cambridge.
diff -Nur tin-980202/pcre/pcre.c tin-980226/pcre/pcre.c
--- tin-980202/pcre/pcre.c	Fri Dec 26 03:41:15 1997
+++ tin-980226/pcre/pcre.c	Thu Feb 26 16:17:08 1998
@@ -9,7 +9,7 @@
 
 Written by: Philip Hazel <ph10@cam.ac.uk>
 
-           Copyright (c) 1997 University of Cambridge
+           Copyright (c) 1998 University of Cambridge
 
 -----------------------------------------------------------------------------
 Permission is granted to anyone to use this software for any purpose on any
@@ -49,10 +49,17 @@
 #include "internal.h"
 
 
+/* Allow compilation as C++ source code, should anybody want to do that. */
+
+#ifdef __cplusplus
+#define class pcre_class
+#endif
+
+
 /* Min and max values for the common repeats; for the maxima, 0 => infinity */
 
-static char rep_min[] = { 0, 0, 1, 1, 0, 0 };
-static char rep_max[] = { 0, 0, 0, 0, 1, 1 };
+static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };
+static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
 
 /* Text forms of OP_ values and things, for debugging (not all used) */
 
@@ -76,7 +83,7 @@
 on. Zero means further processing is needed (for things like \x), or the escape
 is invalid. */
 
-static short int escapes[] = {
+static const short int escapes[] = {
     0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */
     0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */
   '@', -ESC_A, -ESC_B,      0, -ESC_D,      0,      0,      0,   /* @ - G */
@@ -257,6 +264,13 @@
       case OP_KETRMIN:
       return TRUE;
 
+      /* Skip over entire bracket groups with zero lower bound */
+
+      case OP_BRAZERO:
+      case OP_BRAMINZERO:
+      cc++;
+      /* Fall through */
+
       /* Skip over assertive subpatterns */
 
       case OP_ASSERT:
@@ -271,8 +285,6 @@
       case OP_EOD:
       case OP_CIRC:
       case OP_DOLL:
-      case OP_BRAZERO:
-      case OP_BRAMINZERO:
       case OP_NOT_WORD_BOUNDARY:
       case OP_WORD_BOUNDARY:
       cc++;
@@ -1296,7 +1308,7 @@
     the next state. */
 
     previous[1] = length;
-    ptr--;
+    if (length < 255) ptr--;
     break;
     }
   }                   /* end of big loop */
@@ -3450,7 +3462,7 @@
 if (re->top_backref > 0 && re->top_backref >= ocount/2)
   {
   ocount = re->top_backref * 2 + 2;
-  match_block.offset_vector = (pcre_malloc)(ocount * sizeof(int));
+  match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
   if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
   using_temporary_offsets = TRUE;
   DPRINTF(("Got memory to hold back references\n"));
diff -Nur tin-980202/pcre/pcre.h tin-980226/pcre/pcre.h
--- tin-980202/pcre/pcre.h	Fri Dec 26 03:41:15 1997
+++ tin-980226/pcre/pcre.h	Thu Feb 26 16:17:08 1998
@@ -2,7 +2,7 @@
 *       Perl-Compatible Regular Expressions      *
 *************************************************/
 
-/* Copyright (c) 1997 University of Cambridge */
+/* Copyright (c) 1998 University of Cambridge */
 
 #ifndef _PCRE_H
 #define _PCRE_H
@@ -13,6 +13,12 @@
 #include <sys/types.h>
 #include <stdlib.h>
 
+/* Allow for C++ users */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Options */
 
 #define PCRE_CASELESS        0x0001
@@ -54,5 +60,9 @@
 extern int pcre_info(const pcre *, int *, int *);
 extern pcre_extra *pcre_study(const pcre *, int, const char **);
 extern const char *pcre_version(void);
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
 
 #endif /* End of pcre.h */
diff -Nur tin-980202/pcre/pcreposix.3 tin-980226/pcre/pcreposix.3
--- tin-980202/pcre/pcreposix.3	Fri Dec 26 03:41:16 1997
+++ tin-980226/pcre/pcreposix.3	Thu Feb 26 16:17:08 1998
@@ -132,4 +132,4 @@
 .br
 Phone: +44 1223 334714
 
-Copyright (c) 1997 University of Cambridge.
+Copyright (c) 1998 University of Cambridge.
diff -Nur tin-980202/pcre/pcreposix.c tin-980226/pcre/pcreposix.c
--- tin-980202/pcre/pcreposix.c	Fri Dec 26 03:41:16 1997
+++ tin-980226/pcre/pcreposix.c	Thu Feb 26 16:17:08 1998
@@ -12,7 +12,7 @@
 
 Written by: Philip Hazel <ph10@cam.ac.uk>
 
-           Copyright (c) 1997 University of Cambridge
+           Copyright (c) 1998 University of Cambridge
 
 -----------------------------------------------------------------------------
 Permission is granted to anyone to use this software for any purpose on any
@@ -212,7 +212,7 @@
 if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
 if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
 
-preg->re_erroffset = -1;   /* Only has meaning after compile */
+preg->re_erroffset = (size_t)(-1);   /* Only has meaning after compile */
 
 rc = pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), options,
   (int *)pmatch, nmatch * 2);
diff -Nur tin-980202/pcre/pcreposix.h tin-980226/pcre/pcreposix.h
--- tin-980202/pcre/pcreposix.h	Fri Dec 26 03:41:17 1997
+++ tin-980226/pcre/pcreposix.h	Thu Feb 26 16:17:08 1998
@@ -2,7 +2,7 @@
 *       Perl-Compatible Regular Expressions      *
 *************************************************/
 
-/* Copyright (c) 1997 University of Cambridge */
+/* Copyright (c) 1998 University of Cambridge */
 
 #ifndef _PCREPOSIX_H
 #define _PCREPOSIX_H
@@ -15,6 +15,12 @@
 
 #include <stdlib.h>
 
+/* Allow for C++ users */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Options defined by POSIX. */
 
 #define REG_ICASE     0x01
@@ -68,5 +74,9 @@
 extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
 extern size_t regerror(int, const regex_t *, char *, size_t);
 extern void regfree(regex_t *);
+
+#ifdef __cplusplus
+}   /* extern "C" */
+#endif
 
 #endif /* End of pcreposix.h */
diff -Nur tin-980202/pcre/pgrep.1 tin-980226/pcre/pgrep.1
--- tin-980202/pcre/pgrep.1	Fri Dec 26 03:41:17 1997
+++ tin-980226/pcre/pgrep.1	Thu Feb 26 16:17:08 1998
@@ -69,4 +69,4 @@
 .SH AUTHOR
 Philip Hazel <ph10@cam.ac.uk>
 .br
-Copyright (c) 1997 University of Cambridge.
+Copyright (c) 1998 University of Cambridge.
diff -Nur tin-980202/pcre/study.c tin-980226/pcre/study.c
--- tin-980202/pcre/study.c	Fri Dec 26 03:41:18 1997
+++ tin-980226/pcre/study.c	Thu Feb 26 16:17:08 1998
@@ -9,7 +9,7 @@
 
 Written by: Philip Hazel <ph10@cam.ac.uk>
 
-           Copyright (c) 1997 University of Cambridge
+           Copyright (c) 1998 University of Cambridge
 
 -----------------------------------------------------------------------------
 Permission is granted to anyone to use this software for any purpose on any
diff -Nur tin-980202/pcre/testinput tin-980226/pcre/testinput
--- tin-980202/pcre/testinput	Fri Dec 26 03:41:19 1997
+++ tin-980226/pcre/testinput	Thu Feb 26 16:17:08 1998
@@ -1591,4 +1591,7 @@
     aaaabcd
     aaAabcd 
 
+/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
+ \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
+
 / End of test input /
diff -Nur tin-980202/pcre/testinput2 tin-980226/pcre/testinput2
--- tin-980202/pcre/testinput2	Fri Dec 26 03:41:19 1997
+++ tin-980226/pcre/testinput2	Thu Feb 26 16:17:08 1998
@@ -282,5 +282,9 @@
 /[^aeiou ]{3,}/
     co-processors, and for 
     \Ico-processors, and for 
+    
+/((a)*)*/
+ 
+/((a|b|c)*)*/
 
 / End of test input /
diff -Nur tin-980202/pcre/testoutput tin-980226/pcre/testoutput
--- tin-980202/pcre/testoutput	Fri Dec 26 03:41:20 1997
+++ tin-980226/pcre/testoutput	Thu Feb 26 16:17:08 1998
@@ -1,5 +1,5 @@
 Testing Perl-Compatible Regular Expressions
-PCRE version 1.05 23-Dec-1997
+PCRE version 1.07 16-Feb-1998
 
 /the quick brown fox/
     the quick brown fox
@@ -2365,6 +2365,10 @@
  0: b
     aaAabcd 
  0: b
+
+/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
+ \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
+ 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff
 
 / End of test input /
 
diff -Nur tin-980202/pcre/testoutput2 tin-980226/pcre/testoutput2
--- tin-980202/pcre/testoutput2	Fri Dec 26 03:41:20 1997
+++ tin-980226/pcre/testoutput2	Thu Feb 26 16:17:08 1998
@@ -1,5 +1,5 @@
 Testing Perl-Compatible Regular Expressions
-PCRE version 1.05 23-Dec-1997
+PCRE version 1.07 16-Feb-1998
 
 /(a)b|/
 Identifying subpattern count = 1
@@ -640,6 +640,12 @@
  0: -pr
     \Ico-processors, and for 
  0: -pr
+    
+/((a)*)*/
+Failed: operand of unlimited repeat could match the empty string at offset 6
+
+/((a|b|c)*)*/
+Failed: operand of unlimited repeat could match the empty string at offset 10
 
 / End of test input /
 Identifying subpattern count = 0
diff -Nur tin-980202/src/Makefile.in tin-980226/src/Makefile.in
--- tin-980202/src/Makefile.in	Sun Feb  1 04:44:23 1998
+++ tin-980226/src/Makefile.in	Mon Feb 23 03:06:34 1998
@@ -1,7 +1,7 @@
-# Source Makefile for tin 
+# Source Makefile for tin
 # - for configuration options read the ../doc/INSTALL file.
 #
-# Updated   : 31.01.1998
+# Updated: 1998-01-31
 #
 
 SHELL		= /bin/sh
diff -Nur tin-980202/src/active.c tin-980226/src/active.c
--- tin-980202/src/active.c	Sun Feb  1 11:13:15 1998
+++ tin-980226/src/active.c	Tue Feb 24 19:24:17 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : active.c
  *  Author    : I. Lea
- *  Created   : 16.02.1992
- *  Updated   : 05.01.1998
+ *  Created   : 1992-02-16
+ *  Updated   : 1998-01-05
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/art.c tin-980226/src/art.c
--- tin-980202/src/art.c	Wed Jan 28 04:24:45 1998
+++ tin-980226/src/art.c	Mon Feb 23 04:42:54 1998
@@ -2,10 +2,10 @@
  *  Project   : tin - a Usenet reader
  *  Module    : art.c
  *  Author    : I.Lea & R.Skrenta
- *  Created   : 01-04-91
- *  Updated   : 19-04-95
+ *  Created   : 1991-04-01
+ *  Updated   : 1995-04-19
  *  Notes     :
- *  Copyright : (c) Copyright 1991-95 by Iain Lea & Rich Skrenta
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -35,10 +35,10 @@
 static int from_comp (t_comptype *p1, t_comptype *p2);
 static int iReadNovFile (struct t_group *group, long min, long max, int *expired);
 static int parse_headers (FILE *fp, struct t_article *h);
-static t_bool read_group (struct t_group *group, char *group_path, int *pcount);
 static int score_comp (t_comptype *p1, t_comptype *p2);
 static int subj_comp (t_comptype *p1, t_comptype *p2);
 static int valid_artnum (long art);
+static t_bool read_group (struct t_group *group, char *group_path, int *pcount);
 static void print_expired_arts (int num_expired);
 static void thread_by_subject (void);
 
@@ -273,11 +273,11 @@
 	FILE *fp;
 	char buf[PATH_LEN];
 	int count = 0, res;
-	t_bool modified = FALSE;
 	int respnum, total = 0;
 	long art;
 	register int i;
 	static char dir[PATH_LEN] = "";
+	t_bool modified = FALSE;
 
 	/*
 	 * change to groups spooldir to optimize fopen()'s on local articles
@@ -766,8 +766,7 @@
 			debug_print_header (h);
 #endif
 			return TRUE;
-		} else
-			return FALSE;
+		}
 	}
 
 	return FALSE;
@@ -1175,8 +1174,8 @@
  *       hash = TRUE
  *
  *  If hash = TRUE the index filename will be in format number.number.
- *  Hashing the groupname gets a number.  See if that #.1 file exists;
- *  if so, read first line. Is this the group we want?  If no, try #.2.
+ *  Hashing the groupname gets a number. See if that #.1 file exists;
+ *  if so, read first line. Is this the group we want? If no, try #.2.
  *  Repeat until no such file or we find an existing file that matches
  *  our group. Return pointer to path or NULL if not found.
  */
diff -Nur tin-980202/src/attrib.c tin-980226/src/attrib.c
--- tin-980202/src/attrib.c	Wed Jan 28 01:47:45 1998
+++ tin-980226/src/attrib.c	Mon Feb 23 03:51:24 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : attrib.c
  *  Author    : I. Lea
- *  Created   : 01.12.1993
- *  Updated   : 20.12.1997
+ *  Created   : 1993-12-01
+ *  Updated   : 1997-12-20
  *  Notes     : Group attribute routines
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -592,13 +592,12 @@
 #endif
 
 	/* alloc memory for tmp-filename */
-	if ((file_tmp = (char *) malloc (strlen (file)+5)) == NULL) {
+	if ((file_tmp = (char *) my_malloc (strlen (file)+5)) == NULL) {
 		wait_message (2, txt_out_of_memory2);
 		return;
 	}
 	/* generate tmp-filename */
-	strcpy (file_tmp, file);
-	strcat (file_tmp, ".tmp");
+	sprintf (file_tmp, "%s.tmp", file);
 
 	if ((fp = fopen (file_tmp, "w" FOPEN_OPTS)) == (FILE *) 0) {
 		error_message (txt_filesystem_full_backup, ATTRIBUTES_FILE);
diff -Nur tin-980202/src/auth.c tin-980226/src/auth.c
--- tin-980202/src/auth.c	Sun Jan 18 03:29:55 1998
+++ tin-980226/src/auth.c	Sun Feb 22 23:44:48 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : auth.c
  *  Author    : Dirk Nimmich <nimmich@uni-muenster.de>
- *  Created   : 05.04.1997
- *  Updated   : 19.12.1997
+ *  Created   : 1997-04-05
+ *  Updated   : 1997-12-19
  *  Notes     : Routines to authenticate to a news server via NNTP
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Dirk Nimmich
  *              You may  freely  copy or  redistribute  this software,
@@ -93,7 +93,7 @@
 
 #ifdef HAVE_PUTENV
 	sprintf (tmpbuf, "NNTP_AUTH_FDS=%d.%d.%d", fileno (nntp_rd_fp), fileno (nntp_wr_fp), cookiefd);
-	new_env = my_malloc (strlen (tmpbuf) + 1);
+	new_env = (char *) my_malloc (strlen (tmpbuf) + 1);
 	strcpy (new_env, tmpbuf);
 	putenv (new_env);
 	FreeIfNeeded (old_env);
@@ -237,10 +237,7 @@
 	debug_nntp ("authorization", line);
 #endif
 	put_server (line);
-	if ((ret = get_respcode(line)) == OK_AUTH)
-		wait_message(2, txt_authorization_ok, authuser);
-	else
-		wait_message(2, txt_authorization_fail, authuser);
+	wait_message(2, (((ret = get_respcode(line)) == OK_AUTH) ? txt_authorization_ok : txt_authorization_fail), authuser);
 	return ret;
 }
 
diff -Nur tin-980202/src/charset.c tin-980226/src/charset.c
--- tin-980202/src/charset.c	Sat Jan 24 19:27:32 1998
+++ tin-980226/src/charset.c	Mon Feb 23 02:49:03 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : charset.c
- *  Author    : M.Kuhn, T.Burmester
- *  Created   : 10-12-93
- *  Updated   : 28-02-94
+ *  Author    : M. Kuhn, T. Burmester
+ *  Created   : 1993-12-10
+ *  Updated   : 1994-02-28
  *  Notes     : ISO to ascii charset conversion routines
- *  Copyright : (c) Copyright 1991-94 by Markus Kuhn & Tilman Burmester
+ *  Copyright : (c) Copyright 1991-98 by Markus Kuhn & Tilman Burmester
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -17,7 +17,7 @@
 /*
  *  Table for the iso2asc convertion...
  *  iso2asc  by  (unrza3@cd4680fs.rrze.uni-erlangen.de)
- *  included by  (root@aspic.han.de) on 11/04/93
+ *  included by  (root@aspic.han.de)
  */
 
 #define SUB	"?"
diff -Nur tin-980202/src/color.c tin-980226/src/color.c
--- tin-980202/src/color.c	Sat Jan 24 01:54:42 1998
+++ tin-980226/src/color.c	Mon Feb 23 02:59:40 1998
@@ -6,11 +6,11 @@
  *              Giuseppe De Marco <gdm@rebel.net> (light-colors)
  *              Julien Oster <fuzzy@cu8.cum.de> (word highlighting)
  *              T.Dickey <dickey@clark.net> (curses support)
- *  Created   : 02-06-95
- *  Updated   : 06-03-95, 30-03-96, 22-04-96, 15-12-96
+ *  Created   : 1995-06-02
+ *  Updated   : 1996-12-15
  *  Notes     : This are the basic function for ansi-color
  *              and word highlighting
- *  Copyright : (c) 1995 by Olaf Kalzuga and Roland Rosenfeld
+ *  Copyright : (c) 1995-98 by Olaf Kalzuga and Roland Rosenfeld
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -91,7 +91,7 @@
 			if (found)
 				pair = p->pair;
 			else if (++nextpair < COLOR_PAIRS) {
-				p = (struct LIST *)malloc(sizeof(struct LIST));
+				p = (struct LIST *) my_malloc(sizeof(struct LIST));
 				p->fg = fcolor;
 				p->bg = bcolor;
 				p->pair = pair = nextpair;
diff -Nur tin-980202/src/config.c tin-980226/src/config.c
--- tin-980202/src/config.c	Sun Feb  1 04:17:25 1998
+++ tin-980226/src/config.c	Mon Feb 23 03:53:46 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : config.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 15.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-15
  *  Notes     : Configuration file routines
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -542,7 +542,7 @@
 				break;
 
 			if (match_boolean (buf, "show_xcommentto=", &show_xcommentto))
-				 break;
+				break;
 
 			if (match_boolean (buf, "space_goto_next_unread=", &space_goto_next_unread))
 				break;
@@ -615,7 +615,7 @@
 			}
 
 			if (match_integer (buf, "word_h_display_marks=", &word_h_display_marks, MAX_MARK))
-				 break;
+				break;
 #endif
 
 			break;
@@ -665,13 +665,12 @@
 	int i;
 
 	/* alloc memory for tmp-filename */
-	if ((file_tmp = (char *) malloc (strlen (file)+5)) == NULL) {
+	if ((file_tmp = (char *) my_malloc (strlen (file)+5)) == NULL) {
 		wait_message (0, txt_out_of_memory2);
 		return;
 	}
 	/* generate tmp-filename */
-	strcpy (file_tmp, file);
-	strcat (file_tmp, ".tmp");
+	sprintf (file_tmp, "%s.tmp", file);
 
 	if ((fp = fopen (file_tmp, "w")) == (FILE *) 0) {
 		error_message (txt_filesystem_full_backup, CONFIG_FILE);
@@ -1139,8 +1138,8 @@
 #define TopOfPage(option) option_lines_per_page \
 			* ((option) / option_lines_per_page)
 
-#define OptionInPage(option) ((option) - first_option_on_screen)
-#define OptionIndex(option)  (OptionInPage(option) % option_lines_per_page)
+#define OptionInPage(option)	((option) - first_option_on_screen)
+#define OptionIndex(option)	(OptionInPage(option) % option_lines_per_page)
 
 int
 option_row (
@@ -1362,11 +1361,15 @@
 				} else if (!first_option_on_screen) {
 					option = LAST_OPT;
 					first_option_on_screen = TopOfPage(option);
+					ClearScreen ();
+					show_config_page ();
 				} else if ((option -= option_lines_per_page) < 0) {
 					option = 0;
 					first_option_on_screen = 0;
 				} else {
 					first_option_on_screen -= option_lines_per_page;
+					ClearScreen ();
+					show_config_page ();
 				}
 				highlight_option (option);
 				break;
@@ -1380,6 +1383,8 @@
 					first_option_on_screen = 0;
 
 				option = first_option_on_screen;
+				ClearScreen ();
+				show_config_page ();
 				highlight_option (option);
 				break;
 
@@ -1413,6 +1418,8 @@
 			case iKeyConfigRedrawScr:	/* redraw screen */
 				my_retouch ();
 				set_xclick_off ();
+				ClearScreen ();
+				show_config_page ();
 				highlight_option (option);
 				break;
 
diff -Nur tin-980202/src/curses.c tin-980226/src/curses.c
--- tin-980202/src/curses.c	Sun Feb  1 04:48:55 1998
+++ tin-980226/src/curses.c	Mon Feb 23 02:49:47 1998
@@ -1,13 +1,13 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : curses.c
- *  Author    : D.Taylor & I.Lea
- *  Created   : 01-01-86
- *  Updated   : 17-05-94
+ *  Author    : D. Taylor & I. Lea
+ *  Created   : 1986-01-01
+ *  Updated   : 1994-05-17
  *  Notes     : This is a screen management library borrowed with permission
  *              from the Elm mail system. This library was hacked to provide
  *              what tin needs.
- *  Copyright : Copyright (c) 1986-94 Dave Taylor & Iain Lea
+ *  Copyright : Copyright (c) 1986-98 Dave Taylor & Iain Lea
  *              The Elm Mail System  -  @Revision: 2.1 $   $State: Exp @
  */
 
@@ -550,12 +550,12 @@
 set_keypad_on (void)
 {
 #ifndef INDEX_DAEMON
-#    ifdef HAVE_KEYPAD
+#	ifdef HAVE_KEYPAD
 	if (use_keypad && _keypadxmit) {
 		tputs (_keypadxmit, 1, outchar);
 		my_flush();
 	}
-#    endif
+#	endif
 #endif /* INDEX_DAEMON */
 }
 
@@ -564,12 +564,12 @@
 set_keypad_off (void)
 {
 #ifndef INDEX_DAEMON
-#    ifdef HAVE_KEYPAD
+#	ifdef HAVE_KEYPAD
 	if (use_keypad && _keypadlocal) {
 		tputs (_keypadlocal, 1, outchar);
 		my_flush();
 	}
-#    endif
+#	endif
 #endif /* INDEX_DAEMON */
 }
 
diff -Nur tin-980202/src/debug.c tin-980226/src/debug.c
--- tin-980202/src/debug.c	Sun Jan 18 21:15:49 1998
+++ tin-980226/src/debug.c	Sun Feb 22 23:44:49 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : debug.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 24.12.1994
+ *  Created   : 1991-04-01
+ *  Updated   : 1994-12-24
  *  Notes     : debug routines
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -269,7 +269,7 @@
 		(attr->savefile == (char *) 0 ? "" : attr->savefile));
 	fprintf (fp, "sigfile=[%s] followup_to=[%s]\n\n",
 		(attr->sigfile == (char *) 0 ? "" : attr->sigfile),
-		(attr->followup_to  == (char *) 0 ? "" : attr->followup_to));
+		(attr->followup_to == (char *) 0 ? "" : attr->followup_to));
 	fflush (fp);
 }
 
diff -Nur tin-980202/src/descrip.mms tin-980226/src/descrip.mms
--- tin-980202/src/descrip.mms	Sun Feb  1 08:48:08 1998
+++ tin-980226/src/descrip.mms	Tue Feb  3 00:35:06 1998
@@ -129,10 +129,10 @@
           charset, config, curses, debug, -
 	  envarg, feed, filter, getline, group, hashstr, -
           help, inews, init, lang, list, mail, main, -
-          memory, misc, msmail, newsrc, nntplib, nntpw32, -
-          open, os_2, page, pgp, post, prompt, -
+          memory, misc, newsrc, nntplib, -
+          open, page, pgp, post, prompt, -
           save, screen, search, select, sigfile, signal, -
-          strftime, thread, wildmat, win32, win32tcp, -
+          strftime, thread, wildmat, -
           xref, -
           rfc1522, rfc1521, string, header, -
           nrctbl, read, refs, regex, auth
diff -Nur tin-980202/src/envarg.c tin-980226/src/envarg.c
--- tin-980202/src/envarg.c	Fri Dec 26 03:44:29 1997
+++ tin-980226/src/envarg.c	Mon Feb 23 02:41:38 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : envarg.c
- *  Author    : B.Davidson
- *  Created   : 10-13-91
- *  Updated   : 03-10-93
+ *  Author    : B. Davidson
+ *  Created   : 1991-10-13
+ *  Updated   : 1993-03-10
  *  Notes     : Adds default options from environment to command line
- *  Copyright : (c) Copyright 1991-94 by Bill Davidsen
+ *  Copyright : (c) Copyright 1991-98 by Bill Davidsen
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/feed.c tin-980226/src/feed.c
--- tin-980202/src/feed.c	Thu Jan 22 23:50:55 1998
+++ tin-980226/src/feed.c	Mon Feb 23 02:42:26 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : feed.c
- *  Author    : I.Lea
- *  Created   : 31-08-91
- *  Updated   : 22-12-94
+ *  Author    : I. Lea
+ *  Created   : 1991-08-31
+ *  Updated   : 1994-12-22
  *  Notes     : provides same interface to mail,pipe,print and save commands
- *  Copyright : (c) Copyright 1991-94 by Iain Lea
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/filter.c tin-980226/src/filter.c
--- tin-980202/src/filter.c	Sun Feb  1 04:22:31 1998
+++ tin-980226/src/filter.c	Mon Feb 23 03:57:29 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : filter.c
  *  Author    : I. Lea
- *  Created   : 28.12.1992
- *  Updated   : 30.12.1997
+ *  Created   : 1992-12-28
+ *  Updated   : 1998-02-04
  *  Notes     : Filter articles. Kill & auto selection are supported.
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -22,7 +22,8 @@
 #define IS_KILLED(i)	(arts[i].killed)
 #define IS_SELECTED(i)	(arts[i].selected)
 
-/* SET_FILTER in group grp, current article arts[i], with rule ptr[j]
+/*
+ * SET_FILTER in group grp, current article arts[i], with rule ptr[j]
  *
  * filtering is now done this way:
  * a. set score for all articles and rules
@@ -95,11 +96,10 @@
 	return new;
 }
 
+
 /*
  * vSetFilter() initialises a struct t_filter with default values
  */
-
-
 #ifndef INDEX_DAEMON
 static void
 vSetFilter (
@@ -126,10 +126,10 @@
 }
 #endif /* INDEX_DAEMON */
 
+
 /*
  * free_filter_item() frees all filter data (char *)
  */
-
 static void
 free_filter_item (
 	struct t_filter *ptr)
@@ -141,10 +141,10 @@
 	FreeAndNull(ptr->xref);
 }
 
+
 /*
  * free_filter_array() frees t_filter structs t_filters contains pointers to
  */
-
 static void
 free_filter_array (
 	struct t_filters *ptr)
@@ -701,6 +701,7 @@
 	rule.msgid_ok = FALSE;
 	rule.fullref = FILTER_MSGID;
 	rule.subj_ok = FALSE;
+	rule.icase = FALSE;
 	rule.type = type;
 	rule.score = 0;
 	rule.expire_time = FALSE;
@@ -779,6 +780,24 @@
 			return FALSE;
 
 		rule.counter = i;
+		switch (i) {
+			case FILTER_SUBJ_CASE_IGNORE:
+			case FILTER_FROM_CASE_IGNORE:
+				rule.icase = TRUE;
+				break;
+
+			case FILTER_SUBJ_CASE_SENSITIVE:
+			case FILTER_FROM_CASE_SENSITIVE:
+			case FILTER_MSGID:
+			case FILTER_MSGID_LAST:
+			case FILTER_MSGID_ONLY:
+				/* rule.icase is FALSE already, no assignment necessary */
+				break;
+
+			default: /* should not happen */
+				assert(0 != 0);
+				break;
+		}
 	}
 
 	if (!*rule.text) {
@@ -900,10 +919,8 @@
 	/*
 	 * Expire time
 	 */
-	strcpy(double_time, "2x ");
-	strcat(double_time, text_time);
-	strcpy(quat_time, "4x ");
-	strcat(quat_time, text_time);
+	sprintf (double_time, "2x %s", text_time);
+	sprintf (quat_time, "4x %s", text_time);
 	i = get_choice (INDEX_TOP+9, txt_help_filter_time, ptr_filter_time, txt_unlimited_time, text_time, double_time, quat_time, (char *)0);
 
 	if (i == -1)
@@ -1213,6 +1230,7 @@
 			break;
 	}
 
+	psPtr[*plNum].icase = psRule->icase;
 	if (*psRule->text) {
 		sprintf (acBuf, REGEX_FMT, quote_wild_whitespace(psRule->text));
 
@@ -1220,15 +1238,11 @@
 			case FILTER_SUBJ_CASE_IGNORE:
 			case FILTER_SUBJ_CASE_SENSITIVE:
 				psPtr[*plNum].subj = my_strdup (acBuf);
-				if (psRule->counter == FILTER_SUBJ_CASE_IGNORE)
-					psPtr[*plNum].icase = TRUE;
 				break;
 
 			case FILTER_FROM_CASE_IGNORE:
 			case FILTER_FROM_CASE_SENSITIVE:
 				psPtr[*plNum].from = my_strdup (acBuf);
-				if (psRule->counter == FILTER_FROM_CASE_IGNORE)
-					psPtr[*plNum].icase = TRUE;
 				break;
 
 			case FILTER_MSGID:
@@ -1245,7 +1259,6 @@
 		iFiltered = TRUE;
 		(*plNum)++;
 	} else {
-		psPtr[*plNum].icase = psRule->icase;
 		if (psRule->subj_ok) {
 			sprintf (acBuf, REGEX_FMT, (psRule->check_string ? quote_wild (psArt->subject) : psArt->subject));
 			psPtr[*plNum].subj = my_strdup (acBuf);
@@ -1426,7 +1439,7 @@
 							if (regex_errpos >= 0) {
 								SET_FILTER(group, i, j);
 							} else if (regex_errpos != PCRE_ERROR_NOMATCH)
-								 sprintf(msg, txt_pcre_error_num, regex_errpos);
+								sprintf(msg, txt_pcre_error_num, regex_errpos);
 						}
 					}
 				}
@@ -1464,7 +1477,7 @@
 							if (regex_errpos >= 0) {
 								SET_FILTER(group, i, j);
 							} else if (regex_errpos != PCRE_ERROR_NOMATCH)
-								 sprintf(msg, txt_pcre_error_num, regex_errpos);
+								sprintf(msg, txt_pcre_error_num, regex_errpos);
 						}
 					}
 				}
@@ -1529,7 +1542,7 @@
 							if (regex_errpos >= 0) {
 								SET_FILTER(group, i, j);
 							} else if (regex_errpos != PCRE_ERROR_NOMATCH)
-								 sprintf(msg, txt_pcre_error_num, regex_errpos);
+								sprintf(msg, txt_pcre_error_num, regex_errpos);
 							else  { /* No match, try Message-ID */
 								regex_errpos =
 								  pcre_exec(regex_cache_msgid[j].re,
@@ -1646,7 +1659,7 @@
 											if (regex_errpos >= 0)
 												group_count = -1;
 											else if (regex_errpos != PCRE_ERROR_NOMATCH)
-												 sprintf(msg, txt_pcre_error_num, regex_errpos);
+												sprintf(msg, txt_pcre_error_num, regex_errpos);
 										}
 									}
 								}
diff -Nur tin-980202/src/getline.c tin-980226/src/getline.c
--- tin-980202/src/getline.c	Fri Dec 26 03:44:32 1997
+++ tin-980226/src/getline.c	Mon Feb 23 02:50:32 1998
@@ -2,10 +2,10 @@
  *  Project   : tin - a Usenet reader
  *  Module    : getline.c
  *  Author    : Chris Thewalt & Iain Lea
- *  Created   : 09-11-91
- *  Updated   : 27-07-94
+ *  Created   : 1991-11-09
+ *  Updated   : 1994-07-27
  *  Notes     : emacs style line editing input package.
- *  Copyright : (c) Copyright 1991-94 by Chris Thewalt & Iain Lea
+ *  Copyright : (c) Copyright 1991-98 by Chris Thewalt & Iain Lea
  *              Permission to use, copy, modify, and distribute this
  *              software for any purpose and without fee is hereby
  *              granted, provided that the above copyright notices
diff -Nur tin-980202/src/group.c tin-980226/src/group.c
--- tin-980202/src/group.c	Wed Jan 28 07:14:27 1998
+++ tin-980226/src/group.c	Sun Feb 22 23:44:50 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : group.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 31.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/hashstr.c tin-980226/src/hashstr.c
--- tin-980202/src/hashstr.c	Fri Dec 26 03:44:34 1997
+++ tin-980226/src/hashstr.c	Mon Feb 23 03:00:15 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : hashstr.c
- *  Author    : I.Lea & R.Skrenta
- *  Created   : 01-04-91
- *  Updated   : 01-12-94
+ *  Author    : I. Lea & R. Skrenta
+ *  Created   : 1991-04-01
+ *  Updated   : 1994-12-01
  *  Notes     :
- *  Copyright : (c) Copyright 1991-94 by Iain Lea & Rich Skrenta
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/header.c tin-980226/src/header.c
--- tin-980202/src/header.c	Sun Feb  1 05:31:51 1998
+++ tin-980226/src/header.c	Mon Feb 23 19:06:18 1998
@@ -2,8 +2,8 @@
  * Project   : tin - a Usenet reader
  * Module    : header.c
  * Author    : Urs Janssen <urs@tin.org>
- * Created   : 10.03.1997
- * Updated   : 19.03.1997
+ * Created   : 1997-03-10
+ * Updated   : 1997-03-19
  * Copyright : (c) Copyright 1997-98 by Urs Janssen
  *             You may  freely  copy or  redistribute  this software,
  *             so  long as there is no profit made from its use, sale
@@ -321,14 +321,14 @@
 
 	sender[0] = '\0';
 
-	if ((ptr = get_full_name())) {
-		strcpy(sender, ptr);
-		strcat(sender, " ");
-	}
+	if ((ptr = get_full_name()))
+		sprintf(sender, "%s ", ptr);
+
 	if ((ptr = get_user_name())) {
 		strcat(sender, "<");
 		strcat(sender, ptr);
 		strcat(sender, "@");
+
 #ifdef HAVE_GETHOSTBYNAME
 		if ((ptr = get_fqdn(get_host_name())))
 #else
diff -Nur tin-980202/src/help.c tin-980226/src/help.c
--- tin-980202/src/help.c	Sat Jan 24 01:59:34 1998
+++ tin-980226/src/help.c	Sun Feb 22 23:44:50 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : help.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 31.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/inews.c tin-980226/src/inews.c
--- tin-980202/src/inews.c	Sun Feb  1 05:33:22 1998
+++ tin-980226/src/inews.c	Sun Feb 22 23:44:50 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : inews.c
  *  Author    : I. Lea
- *  Created   : 17.03.1992
- *  Updated   : 31.12.1997
+ *  Created   : 1992-03-17
+ *  Updated   : 1997-12-31
  *  Notes     : NNTP builtin version of inews
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/init.c tin-980226/src/init.c
--- tin-980202/src/init.c	Sun Feb  1 05:26:18 1998
+++ tin-980226/src/init.c	Sun Feb 22 23:44:50 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : init.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 28.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-28
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -219,6 +219,8 @@
 t_bool confirm_to_quit;
 t_bool count_articles;			/* count articles on spooldir or via GROUP cmd */
 t_bool created_rcdir;			/* checks if first time tin is started */
+t_bool dangerous_signal_exit;		/* no get_respcode() in nntp_command
+					when dangerous signal exit */
 t_bool default_auto_save;		/* save thread with name from Archive-name: field */
 t_bool default_batch_save;		/* save arts if -M/-S command line switch specified */
 t_bool default_filter_kill_case;
@@ -539,6 +541,7 @@
 	inverse_okay = TRUE;
 	draw_arrow_mark = FALSE;
 #endif
+	dangerous_signal_exit = FALSE;
 	default_auto_save = FALSE;
 	default_auto_save_msg = FALSE;
 	default_batch_save = FALSE;
@@ -706,7 +709,7 @@
 	 */
 
 #ifdef INEWSDIR
-	strcpy(inewsdir, INEWSDIR);
+	strcpy (inewsdir, INEWSDIR);
 #else /* INEWSDIR */
 	inewsdir[0] = '\0';
 #endif /* INEWSDIR */
@@ -723,9 +726,8 @@
 		my_strncpy (default_organization, ptr, sizeof (default_organization));
 #endif /* USE_INN_NNTPLIB */
 
-	/* getval sucks - it doesn't check buffer overflows! */
-	strcpy(libdir, get_val("TIN_LIBDIR", NEWSLIBDIR));
 #ifndef NNTP_ONLY
+	strcpy (libdir, get_val("TIN_LIBDIR", NEWSLIBDIR)); /* moved inside ifdef */
 	strcpy (novrootdir, get_val ("TIN_NOVROOTDIR", NOVROOTDIR));
 	strcpy (novfilename, get_val ("TIN_NOVFILENAME", OVERVIEW_FILE));
 	strcpy (spooldir, get_val ("TIN_SPOOLDIR", SPOOLDIR));
@@ -1058,7 +1060,7 @@
 {
 	FILE *fp;
 	char buf[LEN];
-	const char *tin_defaults[] = { TIN_DEFAULTS };
+	static const char *tin_defaults[] = { TIN_DEFAULTS };
 	int i = 0;
 	struct stat sb;
 
diff -Nur tin-980202/src/joinpath.c tin-980226/src/joinpath.c
--- tin-980202/src/joinpath.c	Wed Dec 31 04:09:02 1997
+++ tin-980226/src/joinpath.c	Sun Feb 22 23:44:50 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : joinpath.c
  *  Author    : Thomas Dickey <dickey@clark.net>
- *  Created   : 10.01.1997
- *  Updated   : 10.01.1997
+ *  Created   : 1997-01-10
+ *  Updated   : 1997-01-10
  *  Notes     :
  *  Copyright : (c) Copyright 1997-98 by Thomas Dickey
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/lang.c tin-980226/src/lang.c
--- tin-980202/src/lang.c	Sun Feb  1 05:27:46 1998
+++ tin-980226/src/lang.c	Tue Feb 24 19:01:20 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : lang.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 26.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-26
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -115,6 +115,7 @@
 constext txt_enter_range[] = "Enter range [%s]> ";
 constext txt_error_sender_in_header_not_allowed[] = "Error on line %d: \"Sender:\" header not allowed (it will be added for you)\n";
 constext txt_error_header_and_body_not_separate[] = "Error: No blank line found after header.\n\n";
+constext txt_error_header_line_bad_charset[] = "Error: Bad charset for non-7bit encoding (must not be us-ascii)\n\n";
 constext txt_error_header_line_blank[] = "Error: Article starts with blank line instead of header\n\n";
 constext txt_error_header_line_colon[] = "Error: Header on line %d does not have a colon after the header name:\n%s\n\n";
 constext txt_superseding_art[] = "Superseding article...";
@@ -651,7 +652,7 @@
 constext txt_opt_sigfile[] = "Create signature from path/command : ";
 constext txt_opt_sort_art_type[] = "Sort article by                    : ";
 constext txt_opt_space_goto_next_unread[] = "Space goes to next unread article  : ";
-constext txt_opt_pgdn_goto_next[] = "PgDn goes to next artice at EOF    : ";
+constext txt_opt_pgdn_goto_next[] = "PgDn goes to next article at EOF   : ";
 constext txt_opt_start_editor_offset[] = "Start editor with line offset      : ";
 constext txt_opt_strip_blanks[] = "Strip blanks of end of lines       : ";
 constext txt_opt_strip_bogus[] = "Remove bogus groups from newsrc    : ";
@@ -1194,7 +1195,7 @@
   Warning: Found %d '-- \\n' lines, this may confuse some people.\n\n";
 constext txt_warn_wrong_sig_format[] = "\n\
   Warning: Signatures should start with '-- \\n' not with '--\\n'.\n\n";
-constext txt_warn_xref_not_supported[] = "Your server does not have Xref: in its XOVER information.\nTin will be unable to mark crossposts read.\n";
+constext txt_warn_xref_not_supported[] = "Your server does not have Xref: in its XOVER information.\nTin will try to use XHDR XREF instead (slows down things a bit).\n";
 constext txt_writing_attributes_file[] = "Writing attributes file...";
 constext txt_x_resp[] = "%d Responses" cCRLF;
 constext txt_xpost_quote[] = "In %G %F wrote:";
diff -Nur tin-980202/src/list.c tin-980226/src/list.c
--- tin-980202/src/list.c	Sun Jan 25 05:14:21 1998
+++ tin-980226/src/list.c	Mon Feb 23 02:44:00 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : list.c
- *  Author    : I.Lea
- *  Created   : 18-12-93
- *  Updated   : 07-01-97
+ *  Author    : I. Lea
+ *  Created   : 1993-12-18
+ *  Updated   : 1997-01-07
  *  Notes     : Low level functions handling the active[] list and its group_hash index
- *  Copyright : (c) Copyright 1991-94 by Iain Lea
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/mail.c tin-980226/src/mail.c
--- tin-980202/src/mail.c	Thu Jan 22 14:48:21 1998
+++ tin-980226/src/mail.c	Mon Feb 23 03:01:11 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : mail.c
- *  Author    : I.Lea
- *  Created   : 02-10-92
- *  Updated   : 11-08-94
+ *  Author    : I. Lea
+ *  Created   : 1992-10-02
+ *  Updated   : 1994-08-11
  *  Notes     : Mail handling routines for creating pseudo newsgroups
- *  Copyright : (c) Copyright 1991-94 by Iain Lea
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/main.c tin-980226/src/main.c
--- tin-980202/src/main.c	Sun Feb  1 05:41:00 1998
+++ tin-980226/src/main.c	Sun Feb 22 23:44:51 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : main.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 28.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-28
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/makecfg.c tin-980226/src/makecfg.c
--- tin-980202/src/makecfg.c	Sun Jan 11 19:12:28 1998
+++ tin-980226/src/makecfg.c	Sun Feb 22 23:44:51 1998
@@ -2,7 +2,7 @@
  *  Project   : tin - a Usenet reader
  *  Module    : makecfg.c
  *  Author    : Thomas E. Dickey <dickey@clark.net>
- *  Created   : 23.08.1997
+ *  Created   : 1997-08-23
  *  Updated   :
  *  Notes     : #defines and structs for config.c
  *  Copyright : (c) Copyright 1997-98 by Thomas E. Dickey
diff -Nur tin-980202/src/memory.c tin-980226/src/memory.c
--- tin-980202/src/memory.c	Wed Jan 28 07:03:36 1998
+++ tin-980226/src/memory.c	Mon Feb 23 03:01:49 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : memory.c
- *  Author    : I.Lea & R.Skrenta
- *  Created   : 01-04-91
- *  Updated   : 05-06-94
+ *  Author    : I. Lea & R. Skrenta
+ *  Created   : 1991-04-01
+ *  Updated   : 1994-06-05
  *  Notes     :
- *  Copyright : (c) Copyright 1991-94 by Iain Lea & Rich Skrenta
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -102,8 +102,7 @@
 		active = (struct t_group *) my_malloc (sizeof (*active) * max_active);
 		my_group = (int *) my_malloc (sizeof (int) * max_active);
 	} else {
-		active = (struct t_group *) my_realloc((char *) active,
-				 sizeof (*active) * max_active);
+		active = (struct t_group *) my_realloc((char *) active, sizeof (*active) * max_active);
 		my_group = (int *) my_realloc((char *) my_group, sizeof (int) * max_active);
 	}
 }
diff -Nur tin-980202/src/misc.c tin-980226/src/misc.c
--- tin-980202/src/misc.c	Sun Feb  1 09:59:00 1998
+++ tin-980226/src/misc.c	Sun Feb 22 23:44:51 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : misc.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 31.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute	this software,
@@ -51,7 +51,7 @@
 		fclose (fp_new);
 		return;
 	}
-	copy_fp (fp_old, fp_new);
+	copy_fp (fp_new, fp_old);
 	fclose (fp_old);
 	fclose (fp_new);
 }
@@ -251,29 +251,76 @@
 invoke_ispell (
 	char *nam) /* return value is always ignored */
 {
+	FILE *fp_all, *fp_body, *fp_head;
 	char *my_ispell;
-	char buf[PATH_LEN];
+	char buf[PATH_LEN], nam_body[100], nam_head[100];
+	int retcode;
 	static char ispell[PATH_LEN];
 	static t_bool first = TRUE;
 
 	if (first) {
 #ifdef VMS
-	*my_ispell = '\0';
-	strcpy(ispell, "ispell");
-	first = FALSE;
+		*my_ispell = '\0';
+		strcpy (ispell, "ispell");
 #else
 		my_ispell = getenv ("ISPELL");
-
 		strcpy (ispell, my_ispell != NULL ? my_ispell : PATH_ISPELL);
-		first = FALSE;
 #endif
+		first = FALSE;
 	}
 
-	sh_format (buf, sizeof(buf), "%s %s", ispell, nam);
+	/*
+	 * Now seperating the header and body in two different files so that
+	 * the header is not checked by ispell
+	 */
 
-	wait_message (0, buf);
+	strncpy (nam_body, nam, 90);
+	strcat (nam_body, ".body");
 
-	return invoke_cmd (buf);
+	strncpy (nam_head, nam, 90);
+	strcat (nam_head, ".head");
+
+	if ((fp_all = fopen(nam, "r")) == (FILE *) 0) {
+		perror_message(txt_cannot_open, nam);
+		return FALSE;
+	}
+
+
+	if ((fp_head = fopen (nam_head, "w")) == NULL) {
+		perror_message(txt_cannot_open, nam_head);
+		fclose (fp_all);
+		return FALSE;
+	}
+
+	if ((fp_body = fopen (nam_body, "w")) == NULL) {
+		perror_message(txt_cannot_open, nam_body);
+		fclose (fp_head);
+		fclose (fp_all);
+		return FALSE;
+	}
+
+	while (fgets (buf, sizeof(buf), fp_all) != NULL) {
+		fputs (buf, fp_head);
+		if (buf[0] == '\n' || buf[0] == '\r') {
+			fclose (fp_head);
+			break;
+		}
+	}
+
+	while (fgets(buf, sizeof(buf), fp_all) != NULL)
+		fputs(buf, fp_body);
+
+	fclose (fp_body);
+	fclose (fp_all);
+
+	sh_format (buf, sizeof(buf), "%s %s", ispell, nam_body);
+	retcode = invoke_cmd(buf);
+
+	append_file (nam_head, nam_body);
+	unlink (nam_body);
+	rename_file (nam_head, nam);
+
+	return retcode;
 }
 #endif
 
@@ -506,13 +553,13 @@
 	char buf[LEN];
 	struct stat sb;
 
-	sprintf(buf, "mkdir %s", path);
+	sprintf(buf, "mkdir %s", path); /* redirect stderr to /dev/null ? */
 	if (stat (path, &sb) == -1) {
 		system (buf);
 		chmod (path, mode);
 	}
 #else
-#	if  defined(M_OS2) || defined(WIN32)
+#	if defined(M_OS2) || defined(WIN32)
 		return mkdir (path);
 #	else
 		return mkdir (path, mode);
@@ -1292,7 +1339,7 @@
 #ifdef USE_CURSES
 #	ifdef NCURSES_MOUSE_VERSION
 	MEVENT my_event;
-#endif /* NCURSES_MOUSE_VERSION */
+#	endif /* NCURSES_MOUSE_VERSION */
 	int ch = getch();
 	int code = KEYMAP_UNKNOWN;
 
@@ -1327,7 +1374,7 @@
 		case KEY_END:
 			code = KEYMAP_END;
 			break;
-#ifdef NCURSES_MOUSE_VERSION
+#	ifdef NCURSES_MOUSE_VERSION
 		case KEY_MOUSE:
 			if (getmouse(&my_event) != ERR) {
 				switch ((int) my_event.bstate) {
@@ -1346,7 +1393,7 @@
 				code = KEYMAP_MOUSE;
 			}
 			break;
-#endif
+#	endif /* NCURSES_MOUSE_VERSION */
 	}
 	return code;
 #else	/* not USE_CURSES */
@@ -1356,23 +1403,22 @@
 #define wait_a_while(i) \
 	while (!input_pending(0) \
 		&& i < ((VT_ESCAPE_TIMEOUT * 1000) / SECOND_CHARACTER_DELAY))
-#ifdef M_AMIGA
+
+#	ifndef VMS
+#		ifdef M_AMIGA
 	if (WaitForChar(Input(),1000) == DOSTRUE)
 		return prech;
-#else	/* !M_AMIGA */
-#	ifdef VMS
-	;
-#	endif /* VMS */
+#		else	/* !M_AMIGA */
 	if (!input_pending(0)) {
-#ifdef HAVE_USLEEP
+#			ifdef HAVE_USLEEP
 		int i=0;
 
 		wait_a_while(i) {
 			usleep(SECOND_CHARACTER_DELAY * 1000);
 			i++;
 		}
-#else	/* !HAVE_USLEEP */
-#ifdef HAVE_SELECT
+#			else	/* !HAVE_USLEEP */
+#				ifdef HAVE_SELECT
 		struct timeval tvptr;
 		int i=0;
 
@@ -1382,8 +1428,8 @@
 			select (0, NULL, NULL, NULL, &tvptr);
 			i++;
 		}
-#else  /* !HAVE_SELECT */
-#ifdef HAVE_POLL
+#				else  /* !HAVE_SELECT */
+#					ifdef HAVE_POLL
 		struct pollfd fds[1];
 		int i=0;
 
@@ -1391,18 +1437,16 @@
 			poll(fds, 0, SECOND_CHARACTER_DELAY);
 			i++;
 		}
-#else /* !HAVE_POLL */
+#					else /* !HAVE_POLL */
 		sleep(1);
-	}
-
-#endif	/* HAVE_POLL */
-#endif	/* HAVE_SELECT */
-#endif	/* HAVE_USLEEP */
-
+#					endif	/* HAVE_POLL */
+#				endif	/* HAVE_SELECT */
+#			endif	/* HAVE_USLEEP */
 		if (!input_pending(0))
-				return prech;
+			return prech;
 	}
-#endif	/* M_AMIGA */
+#		endif	/* M_AMIGA */
+#	endif	/* !VMS */
 	ch = ReadCh ();
 	if (ch == '[' || ch == 'O')
 		ch = ReadCh ();
@@ -1410,65 +1454,65 @@
 	switch (ch) {
 		case 'A':
 		case 'i':
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA1:
-#endif
+#	endif
 			return KEYMAP_UP;
 
 		case 'B':
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA9:
-#endif
+#	endif
 			return KEYMAP_DOWN;
 
 		case 'D':
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA4:
-#endif
+#	endif
 			return KEYMAP_LEFT;
 
 		case 'C':
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA6:
-#endif
+#	endif
 			return KEYMAP_RIGHT;
 
 		case 'I':		/* ansi  PgUp */
 		case 'V':		/* at386 PgUp */
 		case 'S':		/* 97801 PgUp */
 		case 'v':		/* emacs style */
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA2:
-#endif
-#ifdef M_AMIGA
+#	endif
+#	ifdef M_AMIGA
 			return KEYMAP_PAGE_DOWN;
-#else
+#	else
 			return KEYMAP_PAGE_UP;
-#endif
+#	endif
 
 		case 'G':		/* ansi  PgDn */
 		case 'U':		/* at386 PgDn */
 		case 'T':		/* 97801 PgDn */
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xAA:
-#endif
-#ifdef M_AMIGA
+#	endif
+#	ifdef M_AMIGA
 			return KEYMAP_PAGE_UP;
-#else
+#	else
 			return KEYMAP_PAGE_DOWN;
-#endif
+#	endif
 
 		case 'H':		/* at386  Home */
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA0:
-#endif
+#	endif
 			return KEYMAP_HOME;
 
 		case 'F':		/* ansi   End */
 		case 'Y':		/* at386  End */
-#ifdef QNX42
+#	ifdef QNX42
 		case 0xA8:
-#endif
+#	endif
 			return KEYMAP_END;
 
 		case '2':		/* vt200 Ins */
@@ -1512,7 +1556,7 @@
 		default:
 			return KEYMAP_UNKNOWN;
 	}
-#endif
+#endif /* USE_CURSES */
 }
 
 /*
@@ -1914,7 +1958,7 @@
 				 */
 				envptr = getenv (tbuf);
 				if (envptr == (char *) 0 || (*envptr == '\0'))
-					strncpy(tbuf, defbuf, sizeof (tbuf)-1);
+					strncpy (tbuf, defbuf, sizeof (tbuf)-1);
 				else
 					strncpy (tbuf, envptr, sizeof (tbuf)-1);
 				i = strlen (tbuf);
@@ -2393,8 +2437,10 @@
 {
 	if (use_local_charset) {
 		c = c_l1_next[(unsigned char)c];
-		if (c == BAD) return '?';
-		else return c;
+		if (c == BAD)
+			return '?';
+		else
+			return c;
 	} else
 		return c;
 }
@@ -2413,8 +2459,10 @@
 {
 	if (use_local_charset) {
 		c = c_next_l1[(unsigned char) c];
-		if (c==BAD) return '?';
-		else return c;
+		if (c==BAD)
+			return '?';
+		else
+			return c;
 	} else
 		return c;
 }
@@ -2488,7 +2536,7 @@
 
 	while (fgets(buf, sizeof(buf), fp)) {
 
-		if ((chr = malloc(strlen(buf)+1)) != NULL) {
+		if ((chr = my_malloc(strlen(buf)+1)) != NULL) {
 			strcpy(chr, buf);
 			if ((chr1 = strpbrk(chr, "\n\r")) != NULL)
 				*chr1 = '\0';
@@ -2570,7 +2618,7 @@
 			if (*str == '(' || *str == ')' || *str == '[' || *str == ']' || *str == '{' || *str == '}'
 			    || *str == '\\' || *str == '^' || *str == '$'
 			    || *str == '*' || *str == '+' || *str == '?' || *str == '.'
-			    || *str == ' ' || *str == '\t' ) {
+			    || *str == ' ' || *str == '\t') {
 				*target++ = '\\';
 				*target++ = ((*str == ' ' || *str == '\t')? 's' : *str);
 			} else
diff -Nur tin-980202/src/newsrc.c tin-980226/src/newsrc.c
--- tin-980202/src/newsrc.c	Sun Feb  1 17:11:19 1998
+++ tin-980226/src/newsrc.c	Sun Feb 22 23:44:52 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : newsrc.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 28.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-28
  *  Notes     : ArtCount = (ArtMax - ArtMin) + 1  [could have holes]
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/nntplib.c tin-980226/src/nntplib.c
--- tin-980202/src/nntplib.c	Mon Feb  2 14:51:55 1998
+++ tin-980226/src/nntplib.c	Sun Feb 22 23:44:52 1998
@@ -2,9 +2,9 @@
  *  Project   : tin - a Usenet reader
  *  Module    : nntplib.c
  *  Author    : S. Barber & I. Lea
- *  Created   : 12.01.1991
- *  Updated   : 22.12.1997
- *  Notes     : NNTP client routines taken from clientlib.c 1.5.11 (10.02.1991)
+ *  Created   : 1991-01-12
+ *  Updated   : 1997-12-22
+ *  Notes     : NNTP client routines taken from clientlib.c 1.5.11 (1991-02-10)
  *  Copyright : (c) Copyright 1991-98 by Stan Barber & Iain Lea
  *              Permission is hereby granted to copy, reproduce, redistribute
  *              or otherwise use this software  as long as: there is no
@@ -221,6 +221,7 @@
 	sockt_wr = sockt_rd;
 #endif
 
+	last_put[0] = '\0';		/* no retries in get_respcode */
 	/*
 	 * Now get the server's signon message
 	 */
@@ -349,7 +350,7 @@
 		return (-EHOSTUNREACH);
 	}
 #else
-	sp = (struct servent *) malloc (sizeof (struct servent));
+	sp = (struct servent *) my_malloc (sizeof (struct servent));
 	sp->s_port = htons (IPPORT_NNTP);
 #endif
 	/* If not a raw ip address, try nameserver */
diff -Nur tin-980202/src/nrctbl.c tin-980226/src/nrctbl.c
--- tin-980202/src/nrctbl.c	Sun Feb  1 05:13:49 1998
+++ tin-980226/src/nrctbl.c	Sun Feb 22 23:44:52 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : nrctbl.c
  *  Author    : Sven Paulus <sven@tin.org>
- *  Created   : 06.10.1996
- *  Updated   : 26.12.1997
+ *  Created   : 1996-10-06
+ *  Updated   : 1997-12-26
  *  Notes     : This module does the NNTP server name lookup in
  *              ~/.tin/newsrctable and returns the real hostname
  *              and the name of the newsrc file for a given
diff -Nur tin-980202/src/open.c tin-980226/src/open.c
--- tin-980202/src/open.c	Wed Jan 28 07:16:19 1998
+++ tin-980226/src/open.c	Sun Feb 22 23:44:52 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : open.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 24.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-24
  *  Notes     : Routines to make reading news locally (ie. /var/spool/news)
  *              or via NNTP transparent
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
@@ -253,7 +253,8 @@
 	respcode = (int) strtol(ptr, &end, 10);
 DEBUG_IO((stderr, "get_respcode(%d)\n", respcode));
 
-	if ((respcode == ERR_FAULT)  /* || (respcode == ERR_GOODBYE) ??? */) {
+	if ((respcode == ERR_FAULT /* || respcode == ERR_GOODBYE ??? */) &&
+	    last_put[0] != '\0') {
 		/*
 		 * Maybe server timed out.
 		 * If so, retrying will force a reconnect.
@@ -325,6 +326,7 @@
 #endif
 	put_server (command);
 
+	if (dangerous_signal_exit != TRUE)
 	if ((/* respcode = */ get_respcode (message)) != success) {
 #ifdef DEBUG
 		debug_nntp (command, "NOT_OK");
@@ -464,7 +466,7 @@
 # endif /* DEBUG */
 				return result;
 			}
-			read_local_newsgroups_file = FALSE ;
+			read_local_newsgroups_file = FALSE;
 		}
 		return (nntp_command ("LIST NEWSGROUPS", OK_GROUPS, NULL));
 	} else
@@ -794,7 +796,7 @@
 		 * nntpcache and leafnode. Usually this should not be needed.
 		 */
 		sprintf (buf, "GROUP %s", group->name);
-		if (nntp_command(buf, OK_GROUP, line) == NULL)
+		if (nntp_command(buf, OK_GROUP, NULL) == NULL)
 			return(-1);
 #endif /* 0*/
 
diff -Nur tin-980202/src/page.c tin-980226/src/page.c
--- tin-980202/src/page.c	Sun Feb  1 17:13:01 1998
+++ tin-980226/src/page.c	Mon Feb 23 02:53:17 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : page.c
- *  Author    : I.Lea & R.Skrenta
- *  Created   : 01-04-91
- *  Updated   : 26-07-95
+ *  Author    : I. Lea & R. Skrenta
+ *  Created   : 1991-04-01
+ *  Updated   : 1995-07-26
  *  Notes     :
- *  Copyright : (c) Copyright 1991-94 by Iain Lea & Rich Skrenta
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -359,7 +359,7 @@
 				respnum = n;
 				goto restart;
 
-			case iKeyPageNextUnread: 	/* goto next unread article */
+			case iKeyPageNextUnread:	/* goto next unread article */
 page_goto_next_unread:
 				skip_include = '\0';
 				if (note_page != ART_UNAVAILABLE) {
diff -Nur tin-980202/src/parsdate.y tin-980226/src/parsdate.y
--- tin-980202/src/parsdate.y	Fri Dec 26 03:44:51 1997
+++ tin-980226/src/parsdate.y	Mon Feb 23 02:54:43 1998
@@ -2,9 +2,9 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : parsedate.y
- *  Author    : S.Bellovin & R.$alz & J.Berets & P.Eggert
- *  Created   : 01-08-90
- *  Updated   : 23-09-94
+ *  Author    : S. Bellovin, R. $alz, J. Berets, P. Eggert
+ *  Created   : 1990-08-01
+ *  Updated   : 1994-09-23
  *  Notes     : This grammar has 6 shift/reduce conflicts.
  *              Originally written by Steven M. Bellovin <smb@research.att.com>
  *              while at the University of North Carolina at Chapel Hill.
diff -Nur tin-980202/src/pgp.c tin-980226/src/pgp.c
--- tin-980202/src/pgp.c	Thu Jan 22 17:44:18 1998
+++ tin-980226/src/pgp.c	Sun Feb 22 23:44:53 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : pgp.c
  *  Author    : Steven J. Madsen
- *  Created   : 12.05.1995
- *  Updated   : 31.12.1997
+ *  Created   : 1995-05-12
+ *  Updated   : 1997-12-31
  *  Notes     : PGP support for article posting and mailing
  *  Copyright : (c) 1995-98 by Steven J. Madsen
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/post.c tin-980226/src/post.c
--- tin-980202/src/post.c	Sun Feb  1 05:38:39 1998
+++ tin-980226/src/post.c	Mon Feb 23 04:07:40 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : post.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 25.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-25
  *  Notes     : mail/post/replyto/followup/repost & cancel articles
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -152,8 +152,7 @@
 {
 	static char name[PATH_LEN];
 
-	strcpy(name, the_article);
-	strcat(name, ".bak");
+	sprintf(name, "%s.bak", the_article);
 	return name;
 }
 
@@ -419,7 +418,8 @@
  * 8.  Group(s) must be listed in the active file
  * 9.  No Sender: header allowed (limit forging) and rejection by
  *     inn servers
- * 10. Display an 'are you sure' message before posting article
+ * 10. Check for charset != US-ASCII when using non-7bit-encoding
+ * 11. Display an 'are you sure' message before posting article
  */
 
 static t_bool
@@ -448,6 +448,8 @@
 	t_bool found_followup_to_several_groups = FALSE;
 	t_bool got_long_line = FALSE;
 	t_bool saw_wrong_sig_dashes = FALSE;
+	t_bool mime_7bit = TRUE;
+	t_bool mime_usascii = TRUE;
 	struct t_group *psGrp;
 
 	if ((fp = fopen (the_article, "r")) == (FILE *) 0) {
@@ -595,6 +597,22 @@
 		my_fflush (stderr);
 		errors++;
 	}
+
+	/* check for MIME Content-Type and Content-Transfer-Encoding */
+	get_mm_charset ();
+	if (strcasecmp (mm_charset, "US-ASCII")) {
+		mime_usascii = FALSE;
+	}
+	if (strcasecmp (txt_mime_types[post_mime_encoding], "7bit")) {
+		mime_7bit = FALSE;
+	}
+	if (!mime_7bit && mime_usascii) {
+		setup_check_article_screen (&init);
+		my_fprintf (stderr, txt_error_header_line_bad_charset);
+		my_fflush (stderr);
+		errors++;
+	}
+
 	/*
 	 * Check the body of the article for long lines
 	 * check if sig is shorter then 5 lines
@@ -1712,7 +1730,7 @@
 	const char *e;
 	int space;
 
-	b = (char *) malloc (strlen (oldrefs) + strlen (newref) + 64);
+	b = (char *) my_malloc (strlen (oldrefs) + strlen (newref) + 64);
 	c = b;
 	e = oldrefs;
 	space = 0;
diff -Nur tin-980202/src/prompt.c tin-980226/src/prompt.c
--- tin-980202/src/prompt.c	Wed Jan 28 07:19:33 1998
+++ tin-980226/src/prompt.c	Sun Feb 22 23:44:53 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : prompt.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 31.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/read.c tin-980226/src/read.c
--- tin-980202/src/read.c	Sun Feb  1 04:50:04 1998
+++ tin-980226/src/read.c	Mon Feb 23 02:55:26 1998
@@ -2,9 +2,9 @@
  *  Project   : tin - a Usenet reader
  *  Module    : read.c
  *  Author    : Jason Faultless <jason@radar.demon.co.uk>
- *  Created   : 10-04-97
- *  Updated   : 15-05-97
- *  Copyright : (c) 1997 by Jason Faultless
+ *  Created   : 1997-04-10
+ *  Updated   : 1997-04-15
+ *  Copyright : (c) 1997-98 by Jason Faultless
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -34,7 +34,7 @@
 #ifdef NNTP_ABLE
 /*
  * Used by the I/O read routine to look for keyboard input
- * Returns TRUE if user aborted with 'q'
+ * Returns TRUE if user aborted with 'q' or 'z' (lynx-style)
  *         FALSE otherwise
  * Exits via tin_done() on irrecoverable errors
  */
@@ -45,7 +45,7 @@
 #ifdef VMS
 	int ch = ReadChNowait ();
 
-	if (ch == 'q' || ch == ESC) {
+	if (ch == 'q' || ch == 'z' || ch == ESC) {
 		if (prompt_yn (cLINES, "Do you want to abort this operation? (y/n): ", FALSE) == 1)
 			return (TRUE);
 	}
@@ -98,7 +98,7 @@
 DEBUG_IO((stderr, "keybd ready\n"));
 				ch = ReadCh();
 
-				if (ch == 'q' || ch == ESC) {
+				if (ch == 'q' || ch == 'z' || ch == ESC) {
 					if (prompt_yn (cLINES, "Do you want to abort this operation? (y/n): ", FALSE) == 1)
 /* TODO if(cmd_line) this is all cacked when not in curses mode */
 						return (TRUE);
@@ -299,12 +299,12 @@
 }
 
 /* It works the same way as fgets except that it converts
-   new line character into ' ' if the first character following it
-   is white space(' ' or '\t'). It's used by rfc1521.c
-   to concatenate multiple line header field into a single line.
-   It also removes leading white spaces in continuation header lines
-   J. Shin */
-
+ * new line character into ' ' if the first character following it
+ * is white space(' ' or '\t'). It's used by rfc1521.c
+ * to concatenate multiple line header field into a single line.
+ * It also removes leading white spaces in continuation header lines
+ * J. Shin
+ */
 char *
 fgets_hdr (
 	char *s,
@@ -319,7 +319,7 @@
 	*s1 = (int) c;
 
 	while ((size_t) (s1-s) < size-2 && c != EOF) {
-		if (*s1  == '\n' || *s1 == '\r') {
+		if (*s1 == '\n' || *s1 == '\r') {
 			if (!is_leading_wsp) {
 				is_leading_wsp = 1;
 				c = fgetc(f);
diff -Nur tin-980202/src/refs.c tin-980226/src/refs.c
--- tin-980202/src/refs.c	Wed Jan 28 07:20:33 1998
+++ tin-980226/src/refs.c	Mon Feb 23 02:46:11 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : refs.c
  *  Author    : Jason Faultless <jason@radar.demon.co.uk>
- *  Created   : 09.05.96
- *  Updated   : 04.01.98
+ *  Created   : 1996-05-09
+ *  Updated   : 1998-01-04
  *  Notes     : Cacheing of message ids / References based threading
  *  Credits   : Richard Hodson <richard@radar.demon.co.uk>
  *              hash_msgid, free_msgid
diff -Nur tin-980202/src/regex.c tin-980226/src/regex.c
--- tin-980202/src/regex.c	Fri Dec 26 03:46:35 1997
+++ tin-980226/src/regex.c	Mon Feb 23 02:45:05 1998
@@ -2,11 +2,11 @@
  *  Project   : tin - a Usenet reader
  *  Module    : regex.c
  *  Author    : Jason Faultless <jason@radar.demon.co.uk>
- *  Created   : 21-02-97
- *  Updated   : 25-02-97
+ *  Created   : 1997-02-21
+ *  Updated   : 1997-02-25
  *  Notes     : Regular expression subroutines
  *  Credits   :
- *  Copyright : (c) 1997 by Jason Faultless
+ *  Copyright : (c) 1997-98 by Jason Faultless
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/rfc1521.c tin-980226/src/rfc1521.c
--- tin-980202/src/rfc1521.c	Tue Jan 27 20:51:23 1998
+++ tin-980226/src/rfc1521.c	Mon Feb 23 02:52:06 1998
@@ -3,7 +3,7 @@
  *  Module    : rfc1521.c
  *  Author    : Chris Blum <chris@phil.uni-sb.de>
  *  Created   : September '95
- *  Updated   : 03.01.98
+ *  Updated   : 1998-01-03
  *  Notes     : MIME text/plain support
  *  Copyright : (c) Copyright 1995-98 by Chris Blum
  *              You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/rfc1522.c tin-980226/src/rfc1522.c
--- tin-980202/src/rfc1522.c	Wed Jan 28 07:22:35 1998
+++ tin-980226/src/rfc1522.c	Mon Feb 23 02:52:29 1998
@@ -3,9 +3,9 @@
  *  Module    : rfc1522.c
  *  Author    : Chris Blum <chris@phil.uni-sb.de>
  *  Created   : September '95
- *  Updated   : 08-15-96
+ *  Updated   : 1996-08-15
  *  Notes     : MIME header encoding/decoding stuff
- *  Copyright : (c) Copyright 1995-96 by Chris Blum
+ *  Copyright : (c) Copyright 1995-98 by Chris Blum
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/save.c tin-980226/src/save.c
--- tin-980202/src/save.c	Sun Feb  1 17:17:46 1998
+++ tin-980226/src/save.c	Sun Feb 22 23:44:54 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : save.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 31.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *	             You may  freely  copy or  redistribute this  software,
@@ -1324,7 +1324,7 @@
 						 *  Write to temp file
 						 */
 						if (found_header)
-							my_fputs (buf, fp_out);
+							fputs (buf, fp_out);
 					}
 				}
 				fclose (fp_in);
diff -Nur tin-980202/src/screen.c tin-980226/src/screen.c
--- tin-980202/src/screen.c	Sat Jan 24 15:55:54 1998
+++ tin-980226/src/screen.c	Sun Feb 22 23:44:54 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : screen.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 31.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
@@ -126,21 +126,6 @@
 void
 perror_message (const char *fmt, ...)
 {
-#ifndef HAVE_STRERROR
-#	ifdef HAVE_SYS_ERRLIST
-#		ifdef M_AMIGA
-#			ifndef sys_errlist
-				extern char *__sys_errlist[];
-#				define sys_errlist	__sys_errlist
-#			endif
-#		else
-#			ifdef DECL_SYS_ERRLIST
-				extern char *sys_errlist[];
-#			endif
-#		endif
-#	endif
-#endif
-
 	int err;
 	va_list ap;
 
@@ -151,15 +136,7 @@
 
 	vsprintf (msg, fmt, ap);
 
-#ifdef HAVE_STRERROR
 	my_fprintf (stderr, "%s: Error: %s", msg, strerror(err));
-#else
-#	ifdef HAVE_SYS_ERRLIST
-		my_fprintf (stderr, "%s: %s", msg, sys_errlist[err]);
-#	else
-		my_fprintf (stderr, "%s: Errno: %i", msg, err);
-#	endif
-#endif
 	errno = 0;
 
 	if (cmd_line) {
@@ -356,108 +333,3 @@
 		my_printf ("%s%4d/%-4d", txt, count, total);
 	my_flush();
 }
-
-#if 0
-These are the original fixed argument versions
-void
-info_message (
-	const char *str)
-{
-	clear_message ();			/* Clear any old messages hanging around */
-#ifdef HAVE_COLOR
-	fcol(col_message);
-#endif
-	center_line (cLINES, FALSE, str);	/* center the message at screen bottom */
-#ifdef HAVE_COLOR
-	fcol(col_normal);
-#endif
-	stow_cursor();
-}
-
-
-void
-wait_message (
-	const char *str)
-{
-	clear_message ();	  /* Clear any old messages hanging around */
-#ifdef HAVE_COLOR
-	fcol(col_message);
-#endif
-	my_fputs (str, stdout);
-#ifdef HAVE_COLOR
-	fcol(col_normal);
-#endif
-	cursoron ();
-	my_flush();
-}
-
-
-void
-error_message (
-	const char *template,
-	const char *str)
-{
-	errno = 0;
-
-	clear_message ();	  /* Clear any old messages hanging around */
-
-	my_fprintf (stderr, template, str);
-	my_fflush (stderr);
-
-	if (cmd_line) {
-		my_fputc ('\n', stderr);
-		fflush (stderr);
-	} else {
-		stow_cursor();
-		sleep (3);
-	}
-}
-
-
-void
-perror_message (
-	const char *template,
-	const char *str)
-{
-#ifndef HAVE_STRERROR
-#	ifdef HAVE_SYS_ERRLIST
-#		ifdef M_AMIGA
-#			ifndef sys_errlist
-				extern char *__sys_errlist[];
-#				define sys_errlist	__sys_errlist
-#			endif
-#		else
-#			ifdef DECL_SYS_ERRLIST
-				extern char *sys_errlist[];
-#			endif
-#		endif
-#	endif
-#endif
-
-	char str2[512];
-	int err;
-
-	clear_message ();	  /* Clear any old messages hanging around */
-
-	sprintf (str2, template, str);
-	err = errno;
-#ifdef HAVE_STRERROR
-	my_fprintf (stderr, "%s: Error: %s", str2, strerror(err));
-#else
-#  ifdef HAVE_SYS_ERRLIST
-	my_fprintf (stderr, "%s: %s", str2, sys_errlist[err]);
-#  else
-	my_fprintf (stderr, "%s: Error: %i", str2, err);
-#  endif
-#endif
-	errno = 0;
-
-	if (cmd_line) {
-		my_fputc ('\n', stderr);
-		fflush (stderr);
-	} else {
-		stow_cursor();
-		sleep (3);
-	}
-}
-#endif
diff -Nur tin-980202/src/search.c tin-980226/src/search.c
--- tin-980202/src/search.c	Thu Jan 29 03:02:49 1998
+++ tin-980226/src/search.c	Sun Feb 22 23:44:54 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : search.c
  *  Author    : I. Lea & R. Skrenta
- *  Created   : 01.04.1991
- *  Updated   : 27.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-27
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
@@ -514,7 +514,7 @@
 	 * Skip the header
 	 */
 	while ((line = tin_fgets (buf, sizeof (buf), fp)) != (char *) 0) {
-		if (line[0] == '\0')
+		if (line[0] == '\0') /* tin_fgets() strips tailing \n */
 			break;
 	}
 
@@ -527,7 +527,7 @@
 	 * Now search the body
 	 */
 	while ((line = tin_fgets (buf, sizeof (buf), fp)) != (char *) 0) {
-		if (REGEX_MATCH (buf, pat, TRUE)) {
+		if (REGEX_MATCH (line, pat, TRUE)) {
 			fclose (fp);
 			return TRUE;
 		}
diff -Nur tin-980202/src/select.c tin-980226/src/select.c
--- tin-980202/src/select.c	Sun Feb  1 11:25:53 1998
+++ tin-980226/src/select.c	Mon Feb 23 02:56:02 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : select.c
- *  Author    : I.Lea & R.Skrenta
- *  Created   : 01-04-91
- *  Updated   : 21-12-94
+ *  Author    : I. Lea & R. Skrenta
+ *  Created   : 1991-04-01
+ *  Updated   : 1994-12-21
  *  Notes     :
- *  Copyright : (c) Copyright 1991-94 by Iain Lea & Rich Skrenta
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea & Rich Skrenta
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -51,7 +51,9 @@
 continual_key (int ch, int ch1)
 {
 	switch(ch) {
+#ifndef NO_SHELL_ESCAPE
 		case iKeyShellEscape:
+#endif
 		case iKeyLookupMessage:
 		case iKeyOptionMenu:
 		case iKeyQuit:
diff -Nur tin-980202/src/sigfile.c tin-980226/src/sigfile.c
--- tin-980202/src/sigfile.c	Sun Jan 18 20:13:17 1998
+++ tin-980226/src/sigfile.c	Mon Feb 23 02:57:10 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : sigfile.c
  *  Author    : M. Gleason & I. Lea
- *  Created   : 17.10.1992
- *  Updated   : 20.12.1997
+ *  Created   : 1992-10-17
+ *  Updated   : 1998-02-22
  *  Notes     : Generate random signature for posting/mailing etc.
  *  Copyright : (c) Copyright 1989-98 by Mike Gleason & Iain Lea
  *	             You may  freely  copy or  redistribute  this software,
@@ -54,12 +54,19 @@
 	if (thisgroup->attribute->sigfile[0] == '!') {
 		char cmd[PATH_LEN];
 		FILE *pipe_fp;
+		char *sigcmd;
 		fprintf (fp, "\n%s", sigdashes ? SIGDASHES : "\n");
-		if ((pipe_fp = popen (thisgroup->attribute->sigfile+1, "r")) != (FILE *) 0) {
-			while (fgets (cmd, PATH_LEN, pipe_fp))
-				fputs (cmd, fp);
-			pclose (pipe_fp);
-		}
+		if ((sigcmd = (char *) my_malloc(strlen(thisgroup->attribute->sigfile+1) + strlen(thisgroup->name) + 4)) != NULL) {
+			sprintf (sigcmd, "%s \"%s\"", thisgroup->attribute->sigfile+1, thisgroup->name);
+			if ((pipe_fp = popen (sigcmd, "r")) != (FILE *) 0) {
+				while (fgets (cmd, PATH_LEN, pipe_fp))
+					fputs (cmd, fp);
+				pclose (pipe_fp);
+			}
+			free(sigcmd);
+		} else
+			wait_message (2, txt_out_of_memory2);
+
 		return;
 	}
 	get_cwd (cwd);
diff -Nur tin-980202/src/signal.c tin-980226/src/signal.c
--- tin-980202/src/signal.c	Sun Feb  1 05:39:37 1998
+++ tin-980226/src/signal.c	Mon Feb 23 02:56:35 1998
@@ -2,10 +2,10 @@
  *  Project   : tin - a Usenet reader
  *  Module    : signal.c
  *  Author    : I.Lea
- *  Created   : 01-04-91
- *  Updated   : 21-12-94
+ *  Created   : 1991-04-01
+ *  Updated   : 1994-12-21
  *  Notes     : signal handlers for different modes and window resizing
- *  Copyright : (c) Copyright 1991-94 by Iain Lea
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -119,6 +119,9 @@
 #ifdef SIGTSTP
 	{ SIGTSTP,	"SIGTSTP" },	/* terminal-stop */
 #endif
+#ifdef SIGHUP
+	{ SIGHUP,	"SIGHUP" },	/* hang up signal */
+#endif
 #ifdef SIGUSR1
 	{ SIGUSR1,	"SIGUSR1" },	/* User-defined signal 1 */
 #endif
@@ -319,13 +322,26 @@
 	Raw (FALSE);
 	EndWin ();
 	fprintf (stderr, "\n%s: signal handler caught %s signal (%d).\n", progname, signal_name(sig), sig);
+#if defined(SIGHUP)
+	if (sig == SIGHUP)
+	{
+		dangerous_signal_exit = TRUE;
+		tin_done (- SIGHUP);
+	}
+#endif
 #if defined(SIGUSR1)
 	if (sig == SIGUSR1)
+	{
+		dangerous_signal_exit = TRUE;
 		tin_done (- SIGUSR1);
+	}
 #endif
 #if defined(SIGTERM)
 	if (sig == SIGTERM)
+	{
+		dangerous_signal_exit = TRUE;
 		tin_done (- SIGTERM);
+	}
 #endif
 #if defined(SIGBUS) || defined(SIGSEGV)
 	if (
diff -Nur tin-980202/src/strftime.c tin-980226/src/strftime.c
--- tin-980202/src/strftime.c	Sun Jan 18 19:01:29 1998
+++ tin-980226/src/strftime.c	Mon Feb 23 02:58:23 1998
@@ -1,9 +1,9 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : strftime.c
- *  Author    : A.Robbins & I.Lea
- *  Created   : 01-02-91
- *  Updated   : 15-08-93
+ *  Author    : A. Robbins & I. Lea
+ *  Created   : 1991-02-01
+ *  Updated   : 1993-08-15
  *  Notes     : Relatively quick-and-dirty implemenation of ANSI library
  *              routine for System V Unix systems.
  *              If target system already has strftime() call the #define
@@ -11,7 +11,7 @@
  *  Example   : time (&secs);
  *              tm = localtime (&secs);
  *              num = strftime (buf, sizeof (buf), "%a %d-%m-%y %H:%M:%S", tm);
- *  Copyright : (c) Copyright 1991-94 by Arnold Robbins & Iain Lea
+ *  Copyright : (c) Copyright 1991-98 by Arnold Robbins & Iain Lea
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
diff -Nur tin-980202/src/string.c tin-980226/src/string.c
--- tin-980202/src/string.c	Sun Feb  1 05:39:55 1998
+++ tin-980226/src/string.c	Sun Feb 22 23:44:55 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : string.c
  *  Author    : Urs Janssen <urs@tin.org>
- *  Created   : 20.01.1997
- *  Updated   : 31.12.1997
+ *  Created   : 1997-01-20
+ *  Updated   : 1997-12-31
  *  Notes     :
  *  Copyright : (c) Copyright 1997-98 by Urs Janssen
  *              You may  freely  copy or  redistribute	this software,
@@ -453,6 +453,15 @@
  * Returns the number of characters written (not counting null), or -1 if there
  * is not enough room in the 'dst' buffer.
  */
+
+#define SH_FORMAT(c)	if (++result >= (int) len) \
+				break; \
+			*dst++ = c
+
+#define SH_SINGLE "\\\'"
+#define SH_DOUBLE "\\\'\"`$"
+#define SH_META   "\\\'\"`$*%?()[]{}|<>^&;#~"
+
 int
 sh_format (char *dst,
 	size_t len,
@@ -463,17 +472,22 @@
 	char *src;
 	char temp[20];
 	va_list ap;
+	int quote = 0;
 
 	va_start(ap,fmt);
 
 	while (*fmt != 0) {
 		int ch = *fmt++;
 
-		if (ch == '%') {
-			if (*fmt == 0) {
-				if (++result >= (int) len)
-					break;
-				*dst++ = '%';
+		if (ch == '\\') {
+			SH_FORMAT(ch);
+			if (*fmt != '\0') {
+				SH_FORMAT(*fmt++);
+			}
+			continue;
+		} else if (ch == '%') {
+			if (*fmt == '\0') {
+				SH_FORMAT('%');
 				break;
 			}
 
@@ -494,8 +508,8 @@
 			}
 
 			while (*src != '\0') {
-				if (++result >= (int) len)
-					break;
+				t_bool fix;
+
 				/*
 				 * This logic works for Unix.  Non-Unix systems
 				 * may require a different set of problem
@@ -503,17 +517,27 @@
 				 * string rather than escaping individual
 				 * chars.
 				 */
-				if (strchr("*%?$()[]{}|<>^&;#\\\"`'~", *src)) {
-					if (++result >= (int) len)
-						break;
-					*dst++ = '\\';
+				if (quote == '"') {
+					fix = (strchr(SH_DOUBLE, *src) != 0);
+				} else if (quote == '\'') {
+					fix = (strchr(SH_SINGLE, *src) != 0);
+				} else {
+					fix = (strchr(SH_META, *src) != 0);
 				}
-				*dst++ = *src++;
+				if (fix) {
+					SH_FORMAT('\\');
+				}
+				SH_FORMAT(*src++);
 			}
 		} else {
-			if (++result >= (int) len)
-				break;
-			*dst++ = ch;
+			if (quote) {
+				if (ch == quote)
+					quote = 0;
+			} else {
+				if (ch == '"' || ch == '\'')
+					quote = ch;
+			}
+			SH_FORMAT(ch);
 		}
 	}
 	va_end(ap);
@@ -525,3 +549,31 @@
 
 	return (result);
 }
+
+#ifndef HAVE_STRERROR
+#	ifdef HAVE_SYS_ERRLIST
+#		ifdef M_AMIGA
+#			ifndef sys_errlist
+				extern char *__sys_errlist[];
+#				define sys_errlist	__sys_errlist
+#			endif
+#		else
+#			ifdef DECL_SYS_ERRLIST
+				extern char *sys_errlist[];
+#			endif
+#		endif
+		extern int sys_nerr;
+#	endif
+
+char *
+my_strerror(int n)
+{
+	static char temp[20];
+#ifdef HAVE_SYS_ERRLIST
+	if (n >= 0 && n < sys_nerr)
+		return sys_errlist[n];
+#endif
+	sprintf(temp, "Errno: %i", n);
+	return temp;
+}
+#endif /* !HAVE_STRERROR */
diff -Nur tin-980202/src/tcurses.c tin-980226/src/tcurses.c
--- tin-980202/src/tcurses.c	Sat Jan 24 02:07:54 1998
+++ tin-980226/src/tcurses.c	Sun Feb 22 23:44:55 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : tcurses.c
  *  Author    : Thomas Dickey <dickey@clark.net>
- *  Created   : 02.03.1997
- *  Updated   : 31.12.1997
+ *  Created   : 1997-03-02
+ *  Updated   : 1997-12-31
  *  Notes     : This is a set of wrapper functions adapting the termcap
  *	             interface of tin to use SVr4 curses (e.g., ncurses).
  * Copyright :  (c) Copyright 1997-98 by Thomas Dickey
diff -Nur tin-980202/src/thread.c tin-980226/src/thread.c
--- tin-980202/src/thread.c	Sun Feb  1 05:30:20 1998
+++ tin-980226/src/thread.c	Sun Feb 22 23:44:55 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : thread.c
  *  Author    : I. Lea
- *  Created   : 01.04.1991
- *  Updated   : 26.12.1997
+ *  Created   : 1991-04-01
+ *  Updated   : 1997-12-26
  *  Notes     :
  *  Copyright : (c) Copyright 1991-98 by Iain Lea
  *              You may  freely  copy or  redistribute  this software,
@@ -74,12 +74,10 @@
 	struct t_msgid *ptr;
 
 	/*
-	 * Start with space for ->
+	 * Start with 2 spaces for ->
 	 * then index number of the message and whitespace (2+4+1 chars)
 	 */
-	strcpy(buff, "  ");
-	strcat(buff, tin_itoa(l, 4));
-	strcat(buff, " ");
+	sprintf (buff, "  %s ", tin_itoa(l, 4));
 
 	/*
 	 * Add the article flags, tag number, or whatever (3 chars)
@@ -88,7 +86,6 @@
 		strcat (buff, tin_itoa(art->tagged, 3));
 	else {
 		strcat(buff, "   ");
-
 		if (art->inrange) {
 			mark = art_marked_inrange;
 		} else if (art->status == ART_UNREAD) {
@@ -96,8 +93,10 @@
 		} else if (art->status == ART_WILL_RETURN) {
 			mark = art_marked_return;
 
-/* TODO - add kill_level		} else if (art->killed) {
- *			mark = 'K';
+/*
+ * TODO - add kill_level
+ * } else if (art->killed) {
+ *		mark = 'K';
  */
 
 		} else
@@ -541,7 +540,7 @@
 				erase_thread_arrow ();
 				scroll_lines = (full_page_scroll ? NOTESLINES : NOTESLINES / 2);
 
-				thread_index_point = (((n = thread_index_point % scroll_lines) > 0)? (thread_index_point - n) : (((thread_index_point - scroll_lines) / scroll_lines) * scroll_lines));
+				thread_index_point = (((n = thread_index_point % scroll_lines) > 0) ? (thread_index_point - n) : (((thread_index_point - scroll_lines) / scroll_lines) * scroll_lines));
 
 				if (thread_index_point < 0)
 					thread_index_point = 0;
diff -Nur tin-980202/src/trace.c tin-980226/src/trace.c
--- tin-980202/src/trace.c	Wed Dec 31 04:10:20 1997
+++ tin-980226/src/trace.c	Sun Feb 22 23:44:55 1998
@@ -2,8 +2,8 @@
  *  Project   : tin - a Usenet reader
  *  Module    : trace.c
  *  Author    : Thomas Dickey <dickey@clark.net>
- *  Created   : 22.03.1997
- *  Updated   : 31.12.1997
+ *  Created   : 1997-03-22
+ *  Updated   : 1997-12-31
  *  Notes     : debugging support via TRACE macro.
  *  Copyright : (c) Copyright 1997-98 by Thomas Dickey
  *	             You may  freely  copy or  redistribute  this software,
diff -Nur tin-980202/src/xref.c tin-980226/src/xref.c
--- tin-980202/src/xref.c	Fri Dec 26 03:45:13 1997
+++ tin-980226/src/xref.c	Tue Feb 24 19:57:51 1998
@@ -1,11 +1,11 @@
 /*
  *  Project   : tin - a Usenet reader
  *  Module    : xref.c
- *  Author    : I.Lea & H.Brugge
- *  Created   : 01-07-93
- *  Updated   : 02-12-94
+ *  Author    : I. Lea & H. Brugge
+ *  Created   : 1993-07-01
+ *  Updated   : 1998-20-24
  *  Notes     :
- *  Copyright : (c) Copyright 1991-94 by Iain Lea & Herman ten Brugge
+ *  Copyright : (c) Copyright 1991-98 by Iain Lea & Herman ten Brugge
  *              You may  freely  copy or  redistribute  this software,
  *              so  long as there is no profit made from its use, sale
  *              trade or  reproduction.  You may not change this copy-
@@ -23,6 +23,8 @@
 #	define BIT_AND(n,b,mask)	n[NOFFSET(b)] &= mask
 #endif /* USE_DBMALLOC */
 
+static void read_xref_header (struct t_article *art);
+
 /*
  *  Read NEWSLIBDIR/overview.fmt file to check if Xref:full is enabled/disabled
  *  Note: if the file cannot be found set the default Xref supported to TRUE
@@ -58,6 +60,54 @@
 }
 
 /*
+ * read xref reference for current article
+ * This enables crosspost marking even if the xref records are not
+ * part of the xover record.
+ */
+static void
+read_xref_header (struct t_article *art)
+{
+#ifdef NNTP_ABLE
+	/* xref_supported means already supported in xover record */
+	if (!xref_supported && read_news_via_nntp && art && !art->xref) {
+		char buf[HEADER_LEN];
+		char *ptr, *q;
+		long artnum = 0;
+
+		sprintf(buf, "xhdr xref %ld", art->artnum);
+		put_server (buf);
+		if (get_respcode (NULL) != OK_HEAD)
+			return;
+		while (tin_fgets (buf, sizeof (buf)-1, (FILE*)nntp_rd_fp)) {
+			ptr = buf;
+			while (*ptr && isspace(*ptr))
+				ptr++;
+			if (*ptr == '.')
+				break;
+			/*
+			 * read the article number
+			 */
+			artnum = atol (ptr);
+			if ((artnum == art->artnum) && !art->xref && !strstr (ptr, "(none)")) {
+				q = strchr (ptr, ' ');	/* skip artikel number */
+				if (q == NULL)
+					continue;
+				ptr = q;
+				while (*ptr && isspace(*ptr))
+					ptr++;
+				q = strchr (ptr, '\n');
+				if (q)
+					*q = '\0';
+				art->xref = my_strdup (ptr);
+			}
+		}
+
+	}
+#endif
+	return;
+}
+
+/*
  *  mark all other Xref: crossposted articles as read when one article read
  *  Xref: sitename newsgroup:artnum newsgroup:artnum [newsgroup:artnum ...]
  */
@@ -73,9 +123,10 @@
 	long artnum;
 	struct t_group *psGrp;
 
+	read_xref_header (art);
+
 	if (art->xref == '\0')
 		return;
-
 	xref_ptr = art->xref;
 
 	/*
