diff -Nur ispell-3.1/Makefile n/Makefile
--- ispell-3.1/Makefile	Fri Oct 13 04:04:06 1995
+++ n/Makefile	Tue Sep 18 23:11:38 2001
@@ -65,7 +65,7 @@
 #
 # Revision 1.98  1994/12/27  23:08:43  geoff
 # Use the new "iwhich" script to decide whether to install emacs-related
-# stuff.  Make correct.o depend on version.h so that "ispell -a" always
+# stuff.  Make correct.obj depend on version.h so that "ispell -a" always
 # reports the correct version.
 #
 # Revision 1.97  1994/11/21  07:02:51  geoff
@@ -77,7 +77,7 @@
 # Make the installation command configurable.
 #
 # Revision 1.95  1994/10/18  04:03:17  geoff
-# Get rid of DICTVARIANTS, which is obsolete.  Compile term.o first, so
+# Get rid of DICTVARIANTS, which is obsolete.  Compile term.obj first, so
 # that errors in it (which are common) will show up first.  Improve the
 # rules for generation of msgs.h.
 #
@@ -162,7 +162,7 @@
 #
 EXTRADICT = Use_config.sh
 
-SHELL = /bin/sh
+SHELL = sh
 MAKE = make
 
 #
@@ -171,29 +171,31 @@
 #
 SHELLDEBUG = +vx
 
+default: programs
+
 all:	unpacked
 all:	config.sh
 all:	programs showversion ispell.1 ispell.info
 all:	all-languages
 
-programs: buildhash findaffix tryaffix ispell
-programs: icombine ijoin munchlist
-programs: subset sq unsq zapdups
+programs: buildhash.exe findaffix tryaffix ispell.exe
+programs: icombine.exe ijoin.exe munchlist
+programs: subset sq.exe unsq.exe zapdups
 
 showversion:
-	./ispell -v | head -1
+	./ispell.exe -v | head -1
 
-.c.o:
+.c.obj:
 	@. ./config.sh; \
 	  set -x; \
 	  $$CC $$CFLAGS -c $<
 
-.y.o:
+.y.obj:
 	@. ./config.sh; \
 	  set -x; \
 	  $$YACC $<; \
 	  $$CC $$CFLAGS -c y.tab.c; \
-	  mv y.tab.o $@; \
+	  mv y.tab.obj $@; \
 	  rm -f y.tab.c
 
 all-languages:	munchable
@@ -208,15 +210,10 @@
 	  set -x; \
 	  [ -d $$BINDIR ]  ||  (mkdir $$BINDIR; chmod 755 $$BINDIR); \
 	  cd $$BINDIR; \
-	  rm -f ispell
+	  rm -f ispell.exe
 	@. ./config.sh; \
 	  set -x; \
-	  $$INSTALL ispell $$BINDIR
-	@. ./config.sh; \
-	  set -x; \
-	  cd $$BINDIR; \
-	  strip ispell; \
-	  chmod 755 ispell
+	  $$INSTALL ispell.exe $$BINDIR
 	@. ./config.sh; \
 	  set -x; \
 	  [ -d $$MAN1DIR ]  ||  (mkdir $$MAN1DIR; chmod 755 $$MAN1DIR); \
@@ -253,11 +250,11 @@
 	    set -ex; \
 	    rm -f $$ELISPDIR/ispell.el; \
 	    $$INSTALL ispell.el $$ELISPDIR; \
-	    if sh iwhich $$EMACS >/dev/null; then \
+	    if sh iwhich $$EMACS >nul; then \
 		echo '(byte-compile-file "'"$$ELISPDIR/ispell.el"'")' \
-		  > /tmp/emi$$$$; \
+		  > c:/temp/emi$$$$; \
 		$$EMACS -batch -l /tmp/emi$$$$; \
-		rm -f /tmp/emi$$$$; \
+		rm -f c:/temp/emi$$$$; \
 		chmod 644 $$ELISPDIR/ispell.el $$ELISPDIR/ispell.elc; \
 	    else \
 		chmod 644 $$ELISPDIR/ispell.el; \
@@ -271,22 +268,16 @@
 	  set -x; \
 	  [ -d $$BINDIR ]  ||  (mkdir $$BINDIR; chmod 755 $$BINDIR); \
 	  cd $$BINDIR; \
-	  rm -f buildhash icombine ijoin \
-	    munchlist findaffix tryaffix sq unsq; \
-	  rm -f $$LIBDIR/icombine
+	  rm -f buildhash.exe icombine.exe ijoin.exe \
+	    munchlist findaffix tryaffix sq.exe unsq.exe; \
+	  rm -f $$LIBDIR/icombine.exe
 	@. ./config.sh; \
 	  set -x; \
-	  $$INSTALL buildhash icombine ijoin munchlist findaffix tryaffix \
-	      sq unsq \
+	  $$INSTALL buildhash.exe icombine.exe ijoin.exe munchlist findaffix tryaffix \
+	      sq.exe unsq.exe \
 	    $$BINDIR
 	@. ./config.sh; \
 	  set -x; \
-	  cd $$BINDIR; \
-	  strip buildhash icombine ijoin sq unsq; \
-	  chmod 755 buildhash icombine ijoin \
-	    munchlist findaffix tryaffix sq unsq
-	@. ./config.sh; \
-	  set -x; \
 	  [ -d $$MAN1DIR ]  ||  (mkdir $$MAN1DIR; chmod 755 $$MAN1DIR); \
 	  [ -d $$MAN4DIR ]  ||  (mkdir $$MAN4DIR; chmod 755 $$MAN4DIR); \
 	  cd $$MAN1DIR; \
@@ -294,17 +285,12 @@
 	@. ./config.sh; \
 	  set -x; \
 	  $$INSTALL sq.1 $$MAN1DIR/sq$$MAN1EXT; \
-	  for m in buildhash munchlist findaffix tryaffix; do \
+	  for m in buildhash.exe munchlist findaffix tryaffix; do \
 	    echo ".so `basename $$MAN1DIR`/ispell$$MAN1EXT" \
 	      > $$MAN1DIR/$$m$$MAN1EXT; \
 	  done; \
 	  echo ".so `basename $$MAN1DIR`/sq$$MAN1EXT" \
 	    > $$MAN1DIR/unsq$$MAN1EXT 
-	@. ./config.sh; \
-	  set -x; \
-	  cd $$MAN1DIR; \
-	  chmod 644 sq$$MAN1EXT buildhash$$MAN1EXT \
-	    munchlist$$MAN1EXT findaffix$$MAN1EXT tryaffix$$MAN1EXT
 
 install-languages:
 	$(MAKE) LANGUAGE_TARGET=install SHELLDEBUG=$(SHELLDEBUG) \
@@ -323,10 +309,10 @@
 	  . ./config.sh; \
 	  set $(SHELLDEBUG); \
 	  if [ -d $$TEXINFODIR ]; then \
-	    if sh iwhich makeinfo >/dev/null \
-	      &&  makeinfo ispell.texinfo 2>/dev/null; then \
+	    if sh iwhich makeinfo >nul \
+	      &&  makeinfo ispell.texinfo 2>nul; then \
 		:; \
-	    elif sh iwhich $$EMACS >/dev/null; then \
+	    elif sh iwhich $$EMACS >nul; then \
 		set -e; \
 		$$EMACS -batch dummy -i ispell.texinfo \
 		  -f texinfo-format-buffer -f save-buffer; \
@@ -336,9 +322,10 @@
 	    : ; \
 	  fi
 
-munchable:	findaffix tryaffix munchlist buildhash ispell icombine
-munchable:	ijoin
-munchable:	sq unsq
+munchable:	findaffix tryaffix munchlist buildhash.exe \
+                ispell.exe icombine.exe
+munchable:	ijoin.exe
+munchable:	sq.exe unsq.exe
 
 #
 #	The following auxiliary dependency is used to make targets in
@@ -389,25 +376,26 @@
 	    done; \
 	    exit 0
 	    
-buildhash: config.sh buildhash.o hash.o makedent.o parse.o
+buildhash.exe: config.sh buildhash.obj hash.obj makedent.obj parse.obj
 	@. ./config.sh; \
 	  set -x; \
-	  $$CC $$CFLAGS -o buildhash buildhash.o hash.o makedent.o parse.o \
+	  $$CC $$CFLAGS -Febuildhash.exe buildhash.obj hash.obj \
+            makedent.obj parse.obj \
 	    $$LIBES
 
-icombine: config.sh icombine.o makedent.o parse.o
+icombine.exe: config.sh icombine.obj makedent.obj parse.obj
 	. ./config.sh; \
 	  set -x; \
-	  $$CC $$CFLAGS -o icombine icombine.o makedent.o parse.o \
+	  $$CC $$CFLAGS -Feicombine.exe icombine.obj makedent.obj parse.obj \
 	    $$LIBES
 
-ijoin: config.sh ijoin.o fields.o
+ijoin.exe: config.sh ijoin.obj fields.obj
 	@. ./config.sh; \
 	  set -x; \
-	  $$CC $$CFLAGS -o ijoin ijoin.o fields.o $$LIBES
+	  $$CC $$CFLAGS -Feijoin.exe ijoin.obj fields.obj $$LIBES
 
 EDITFILE	=	notthere
-OUTFILE		=	/dev/null
+OUTFILE		=	nul
 
 config.sh:  config.X local.h
 	set $(SHELLDEBUG); \
@@ -464,31 +452,33 @@
 	  doedit
 	chmod +x zapdups
 
-OBJS	=	term.o ispell.o correct.o defmt.o dump.o good.o lookup.o \
-		hash.o makedent.o tgood.o tree.o xgets.o
+OBJS	=	term.obj ispell.obj correct.obj defmt.obj dump.obj \
+                good.obj lookup.obj sleep.obj knj.obj \
+		hash.obj makedent.obj tgood.obj tree.obj xgets.obj
 
-ispell: config.sh $(OBJS)
+ispell.exe: config.sh $(OBJS)
 	@. ./config.sh; \
 	  set -x; \
-	  $$CC $$CFLAGS -o ispell $(OBJS) $$TERMLIB $$REGLIB $$LIBES
+	  $$CC $$CFLAGS -Feispell.exe $(OBJS) $$TERMLIB $$REGLIB $$LIBES
 
 #	Since some makes don't have appropriate built-in rules, here are
 #	dependencies for sq and unsq.  Sigh.
-sq:	config.sh msgs.h sq.c
+sq.exe:	config.sh msgs.h sq.c
 	@. ./config.sh; \
 	  set -x; \
-	  $$CC $$CFLAGS -o sq sq.c
+	  $$CC $$CFLAGS -Fesq.exe sq.c
 
-unsq:	config.sh msgs.h unsq.c
+unsq.exe:	config.sh msgs.h unsq.c
 	@. ./config.sh; \
 	  set -x; \
-	  $$CC $$CFLAGS -o unsq unsq.c
+	  $$CC $$CFLAGS -Feunsq.exe unsq.c
 
-$(OBJS) buildhash.o icombine.o hash.o parse.o: config.h ispell.h local.h
-$(OBJS) buildhash.o icombine.o hash.o parse.o: proto.h msgs.h
-ijoin.o: config.h ispell.h local.h
-ijoin.o: proto.h fields.h
-buildhash.o correct.o ispell.o: version.h
+$(OBJS) buildhash.obj icombine.obj hash.obj parse.obj: config.h ispell.h \
+                                                       local.h
+$(OBJS) buildhash.obj icombine.obj hash.obj parse.obj: proto.h msgs.h
+ijoin.obj: config.h ispell.h local.h
+ijoin.obj: proto.h fields.h
+buildhash.obj correct.obj ispell.obj: version.h
 
 config.h:	config.X local.h
 	cp config.X config.h
@@ -551,10 +541,10 @@
 	@. ./config.sh; \
 	  set -x; \
 	  rm -f $$DEFHASH $$FOREIGNHASHES
-	rm -f *.o core a.out mon.out hash.out y.tab.c *.stat *.cnt \
+	rm -f *.obj core a.out mon.out hash.out y.tab.c *.stat *.cnt \
 		config.h msgs.h
-	rm -f buildhash findaffix tryaffix ispell icombine ijoin \
-		munchlist subset sq unsq zapdups ispell.1 ispell.info
+	rm -f buildhash.exe findaffix tryaffix ispell.exe icombine.exe ijoin.exe \
+		munchlist subset sq.exe unsq.exe zapdups ispell.1 ispell.info
 
 clean-languages:
 	$(MAKE) LANGUAGE_TARGET=clean SHELLDEBUG=$(SHELLDEBUG) language-subdirs
@@ -566,7 +556,7 @@
 #	The following dependency can be executed when ispell is unpacked,
 #	to unpack the dictionaries.
 #
-unpack:	unsq
+unpack:	unsq.exe
 	$(MAKE) LANGUAGE_TARGET=unpack SHELLDEBUG=$(SHELLDEBUG) \
 	  language-subdirs
 
@@ -580,7 +570,7 @@
 #	have the combined files first, so it may take a little while
 #	to run.
 #
-kitclean:	unsq
+kitclean:	unsq.exe
 	$(MAKE) LANGUAGE_TARGET=kitclean SHELLDEBUG=$(SHELLDEBUG) \
 	  language-subdirs
 
diff -Nur ispell-3.1/config.h n/config.h
--- ispell-3.1/config.h	Thu Jan 01 09:00:00 1970
+++ n/config.h	Tue Sep 18 23:11:28 2001
@@ -0,0 +1,882 @@
+/*
+ * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All modifications to the source code must be clearly marked as
+ *    such.  Binary redistributions based on modified source code
+ *    must be clearly marked as modified versions in the documentation
+ *    and/or other materials provided with the distribution.
+ * 4. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgment:
+ *      This product includes software developed by Geoff Kuenning and
+ *      other unpaid contributors.
+ * 5. The name of Geoff Kuenning may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * This is the configuration file for ispell.  Thanks to Bob McQueer
+ * for creating it and making the necessary changes elsewhere to
+ * support it, and to George Sipe for figuring out how to make it easier
+ * to use.
+ *
+ * WARNING:  The Makefile edits this file (config.X) to produce config.h.
+ * If you are looking at config.h, you're in the wrong file.
+ *
+ * Look through this file from top to bottom.  If anything needs changing,
+ * create the header file "local.h" and define the correct values there;
+ * they will override this file.  If you don't make any changes to this
+ * file, future patching will be easier.
+ */
+
+/*
+ * $Id: config.X,v 1.71 1995/01/08 23:23:28 geoff Exp $
+ *
+ * $Log: config.X,v $
+ * Revision 1.71  1995/01/08  23:23:28  geoff
+ * Add some more configuration variables: HAS_RENAME, MSDOS_BINARY_OPEN,
+ * HOME, PDICTHOME, HASHSUFFIX, STATSUFFIX, and COUNTSUFFIX.  These are
+ * all to make it easier to port ispell to MS-DOS.  Change DEFPAFF back
+ * to "words" so that only .ispell_words will be independent of language.
+ *
+ * Revision 1.70  1994/10/25  05:45:57  geoff
+ * Fix a tiny typo in a comment.  Add a configurable install command.
+ *
+ * Revision 1.69  1994/09/01  06:06:30  geoff
+ * Improve the the documentation of LANGUAGES to include working examples.
+ *
+ * Revision 1.68  1994/07/28  05:11:34  geoff
+ * Log message for previous revision: force MASKBITS to greater than or
+ * equal to MASKTYPE_WIDTH (simplifies configuration for 64-bit
+ * machines).
+ *
+ * Revision 1.67  1994/07/28  04:53:34  geoff
+ *
+ * Revision 1.66  1994/04/27  02:50:46  geoff
+ * Change the documentation and defaults for the languages variable to
+ * reflect the new method of making American and British dictionary
+ * variants.
+ *
+ * Revision 1.65  1994/04/27  01:50:28  geoff
+ * Add MAX_CAPS.
+ *
+ * Revision 1.64  1994/02/07  08:10:42  geoff
+ * Add GENERATE_LIBRARY_PROTOS as a special variable for use only by me.
+ *
+ * Revision 1.63  1994/01/26  07:44:45  geoff
+ * Make yacc configurable through local.h.
+ *
+ * Revision 1.62  1994/01/25  07:11:20  geoff
+ * Get rid of all old RCS log lines in preparation for the 3.1 release.
+ *
+ */
+
+/* You may wish to specify your local definitions in this file: */
+
+#include "local.h"	/* local definitions for options */
+
+/*
+** Major-differences selection.  The default system is BSD;  for USG
+** or non-UNIX systems you should add the appropriate #define to local.h.
+*/
+#ifndef USG
+#define USG		/* Define this in local.h for System V machines */
+#endif /* USG */
+
+/*
+#include <sys/param.h>
+*/
+#include <sys/types.h>
+#ifndef USG
+#include <sys/dir.h>
+#endif /* USG */
+
+/*
+** Things that normally go in a Makefile.  Define these just like you
+** might in the Makefile, except you should use #define instead of
+** make's assignment syntax.  Everything must be double-quoted, and
+** (unlike make) you can't use any sort of $-syntax to pick up the
+** values of other definitions.
+*/
+#ifndef CC
+#define CC	"cl"
+#endif /* CC */
+#ifndef EMACS
+#define EMACS	"mule"
+#endif /* EMACS */
+#ifndef LINT
+#define LINT	"lint"
+#endif /* LINT */
+#define CFLAGS	"-nologo -QI0f -QIfdiv- -O2 -DWIN32=1 -I."
+#ifndef LINTFLAGS
+#define LINTFLAGS ""
+#endif /* LINTFLAGS */
+#ifndef YACC
+#define YACC	"bison -y"
+#endif /* YACC */
+
+/*
+** Libraries that may need to be added to the cc line to get ispell to
+** link.  Normally, this should be null.
+*/
+#ifndef LIBES
+#define LIBES	""
+#endif
+
+/*
+** TERMLIB - where to get the termcap library.  Should be -ltermcap or
+** -lcurses on most systems.
+*/
+#ifndef TERMLIB
+#define TERMLIB	""
+#endif
+
+/*
+** REGLIB - where to get the regular-expression routines, if
+** REGEX_LOOKUP is defined.  Should be -lPW on USG systems, null on
+** BSD systems.
+*/
+#ifndef REGLIB
+#define REGLIB	""
+#endif
+
+/*
+** Where to install various components of ispell.  BINDIR contains
+** binaries.  LIBDIR contains hash tables and affix files.  ELISPDIR
+** contains emacs lisp files (if any) and TEXINFODIR contains emacs
+** TeXinfo files.  MAN1DIR and MAN4DIR will hold the chapter-1 and
+** chapter-4 manual pages, respectively.
+**
+** If you intend to use multiple dictionary files, I would suggest
+** LIBDIR be a directory which will contain nothing else, so sensible
+** names can be constructed for the -d option without conflict.
+*/
+#ifndef BINDIR
+#define BINDIR	"c:/usr/local/bin"
+#endif
+#ifndef LIBDIR
+#define LIBDIR	"c:/usr/local/lib"
+#endif
+#ifndef ELISPDIR
+#define ELISPDIR "c:/usr/local/share/mule2/lisp"
+#endif
+#ifndef TEXINFODIR
+#define TEXINFODIR "c:/usr/local/share/mule2/info"
+#endif
+#ifndef MAN1DIR
+#define MAN1DIR	"c:/usr/local/man/man1"
+#endif
+#ifndef MAN4DIR
+#define MAN4DIR	"c:/usr/local/man/man4"
+#endif
+
+/*
+** Extensions to put on manual pages.  Usually these are ".1" or ".1l".
+*/
+#ifndef MAN1EXT
+#define MAN1EXT	".1"
+#endif
+#ifndef MAN4EXT
+#define MAN4EXT	".4"
+#endif
+
+/*
+** List of all hash files (languages) which will be supported by ispell.
+**
+** This variable has a complex format so that many options can be
+** specified.  The format is as follows:
+**
+**	<language>[,<make-options>...] [<language> [,<make-options> ...] ...]
+**
+** where
+**
+**	language	is the name of a subdirectory of the
+**			"languages" directory
+**	make-options	are options that are to be passed to "make" in
+**			the specified directory.  The make-options
+**			should not, in general, specify a target, as
+**			this will be provided by the make process.
+**
+** For example, if LANGUAGES is:
+**
+**	"{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=} {deutsch,DICTALWAYS=deutsch.sml,DICTOPTIONS=}"
+**
+** then the American-English and Deutsch (German) languages will be supported,
+** and the following variable settings will be passed to the two Makefiles:
+**
+**	American:
+**
+**	    MASTERDICTS='american.med+'
+**	    HASHFILES='americanmed+.hash'
+**	    EXTRADICT='/usr/dict/words /usr/dict/web2'
+**
+**	Deutsch:
+**
+**	    DICTALWAYS='deutsch.sml'
+**	    DICTOPTIONS=''
+**
+** Notes on the syntax: The makefile is not very robust.  If you have
+** make problems, or if make seems to fail in the language-subdirs
+** dependency, check your syntax.  The makefile adds single quotes to
+** the individual variables in the LANGUAGES specification, so don't
+** use quotes of any kind.
+**
+** In the future, the first language listed in this variable will
+** become the default, and the DEFHASH, DEFLANG, and DEFPAFF,
+** variables will all become obsolete.  So be sure to put your default
+** language first, to make later conversion easier!
+**
+** Notes on options for the various languages will be found in the
+** Makefiles for those languages.  Some of those languages may require
+** you to also change various limits limits like MASKBITS or the
+** length parameters.
+**
+** A special note on the English language: because the British and
+** American dialects use different spelling, you should usually select
+** one or the other of these.  If you select both, the setting of
+** MASTERHASH will determine which becomes the language linked to
+** DEFHASH (which will usually be named english.hash).
+*/
+#ifndef LANGUAGES
+#define LANGUAGES "{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=}"
+#endif /* LANGUAGES */
+
+/*
+** Master hash file for DEFHASH.  This is the name of a hash file
+** built by a language Makefile.  It should be the most-popular hash
+** file on your system, because it is the one that will be used by
+** default.  It must be listed in LANGUAGES, above.
+*/
+#ifndef MASTERHASH
+#define MASTERHASH	"americanmed+.hash"
+#endif
+
+/*
+** Default native-language hash file.  This is the name given to the
+** hash table that will be used if no language is specified to
+** ispell.  It is a link to MASTERHASH, above.
+*/
+#ifndef DEFHASH
+#define DEFHASH "english.hash"
+#endif
+
+/*
+** Language tables for the default language.  This must be the name of
+** the affix file that was used to generate the MASTERHASH/DEFHASH,
+** above.
+*/
+#ifndef DEFLANG
+#define DEFLANG	"english.aff"
+#endif
+
+/*
+** Language to use for error messages.  If there are no messages in this
+** language, English will be used instead.
+*/
+#ifndef MSGLANG
+#define MSGLANG	"english"
+#endif /* MSGLANG */
+
+/*
+** If your sort command accepts the -T switch to set temp file
+** locations (try it out; it exists but is undocumented on some
+** systems), make the following variable the null string.  Otherwise
+** leave it as the sed script.
+*/
+#ifndef SORTTMP
+#define SORTTMP	"-e '/!!SORTTMP!!/s/=.*$/=/'"
+#endif
+
+/*
+** If your sort command accepts the -T switch (see above), make the
+** following variable refer to a temporary directory with lots of
+** space.  Otherwise make it the null string.
+*/
+#ifndef MAKE_SORTTMP
+#define MAKE_SORTTMP "-T ${TMPDIR-c:/temp}"
+#endif
+
+/*
+** INSTALL program. Could be a copy program like cp or something fancier
+** like /usr/ucb/install -c
+*/
+#ifndef INSTALL
+#define INSTALL		"cp"
+#endif
+
+/*
+** If your system has the rename(2) system call, define HAS_RENAME and
+** ispell will use that call to rename backup files.  Otherwise, it
+** will use link/unlink.  There is no harm in this except on MS-DOS,
+** which doesn't support link/unlink.
+*/
+#ifndef HAS_RENAME
+#undef HAS_RENAME
+#endif /* HAS_RENAME */
+
+/* Aliases for some routines */
+#ifdef USG
+#define bcopy(s, d, n)	(void) memcpy (d, s, n)
+#define bzero(d, n)	(void) memset (d, 0, n)
+#define index strchr
+#define rindex strrchr
+#endif
+
+/* type given to signal() by signal.h */
+#ifndef SIGNAL_TYPE
+#define SIGNAL_TYPE void
+#endif
+
+/* environment variable for user's word list */
+#ifndef PDICTVAR
+#define PDICTVAR "WORDLIST"
+#endif
+
+/* prefix part of default word list */
+#ifndef DEFPDICT
+#define DEFPDICT ".ispell_"
+#endif
+
+/*
+** suffix part of default word list
+*/
+#ifndef DEFPAFF
+#define DEFPAFF "words"
+#endif
+
+/* old place to look for default word list */
+#ifndef OLDPDICT
+#define OLDPDICT ".ispell_"
+#endif /* OLDPDICT */
+#ifndef OLDPAFF
+#define OLDPAFF "words"
+#endif /* OLDPAFF */
+
+/* environment variable for include file string */
+#ifndef INCSTRVAR
+#define INCSTRVAR "INCLUDE_STRING"
+#endif
+
+/* default include string */
+#ifndef DEFINCSTR
+#define DEFINCSTR "&Include_File&"
+#endif
+
+/* mktemp template for temporary file - MUST contain 6 consecutive X's */
+#ifndef TEMPNAME
+#define TEMPNAME "ispellXXXXXX"
+#endif
+
+/*
+** If REGEX_LOOKUP is undefined, the lookup command (L) will use the look(1)
+** command (if available) or the egrep command.  If REGEX_LOOKUP is defined,
+** the lookup command will use the internal dictionary and the
+** regular-expression library (which you must supply separately.  There is
+** a public-domain library available;  libraries are also distributed with
+** both BSD and System V.
+**
+** The advantage of no REGEX_LOOKUP is that it is often much faster, especially
+** if the look(1) command is available, that the words found are presented
+** in alphabetical order, and that the list of words searched is larger.
+** The advantage of REGEX_LOOKUP is that ispell doesn't need to spawn another
+** program, and the list of words searched is exactly the list of (root) words
+** that ispell will accept.  (However, note that words formed with affixes will
+** not be found;  this can produce some artifacts.  For example, since
+** "brother" can be formed as "broth+er", a lookup command might fail to
+** find "brother.")
+*/
+#ifndef REGEX_LOOKUP
+#undef REGEX_LOOKUP
+#endif /* REGEX_LOOKUP */
+
+/*
+** Choose the proper type of regular-expression routines here.  BSD
+** and public-domain systems have routines called re_comp and re_exec;
+** System V uses regcmp and regex.
+*/
+#ifdef REGEX_LOOKUP
+#ifndef REGCMP
+#ifdef USG
+#define REGCMP(str)		regcmp (str, (char *) 0)
+#define REGEX(re, str, dummy)	regex (re, str, dummy, dummy, dummy, dummy, \
+				    dummy, dummy, dummy, dummy, dummy, dummy)
+#else /* USG */
+#define REGCMP(str)		re_comp (str)
+#define REGEX(re, str, dummy)	re_exec (str)
+#endif /* USG */
+#endif /* REGCMP */
+#endif /* REGEX_LOOKUP */
+
+/* look command (if look(1) MAY BE available - ignored if not) */
+#ifndef REGEX_LOOKUP
+#ifndef LOOK
+#define	LOOK	"look -df"
+#endif
+#endif /* REGEX_LOOKUP */
+
+/* path to egrep (use speeded up version if available) */
+#ifndef EGREPCMD
+#ifdef	USG
+#define EGREPCMD "egrep"
+#else
+#define EGREPCMD "egrep -i"
+#endif
+#endif
+
+/* path to wordlist for Lookup command (typically /usr/dict/{words|web2}) */
+/* note that /usr/dict/web2 is usually a bad idea due to obscure words */
+#ifndef WORDS
+#define WORDS	"c:/usr/dict/words"
+#endif
+
+/* buffer size to use for file names if not in sys/param.h */
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 240
+#endif
+
+/* max file name length (will truncate to fit BAKEXT) if not in sys/param.h */
+#ifndef MAXNAMLEN
+#define MAXNAMLEN 240
+#endif
+
+/* define if you want .bak file names truncated to MAXNAMLEN characters */
+#ifndef TRUNCATEBAK
+#undef TRUNCATEBAK
+#endif /* TRUNCATEBAK */
+
+/* largest word accepted from a file by any input routine, plus one */
+#ifndef	INPUTWORDLEN
+#define INPUTWORDLEN 100
+#endif
+
+/* largest amount that a word might be extended by adding affixes */
+#ifndef MAXAFFIXLEN
+#define MAXAFFIXLEN 20
+#endif
+
+/*
+** Define the following to suppress the 8-bit character feature.
+** Unfortunately, this doesn't work as well as it might, because ispell
+** only strips the 8th bit in some places.  For example, it calls strcmp()
+** quite often without first stripping parity.  However, I really wonder
+** about the utility of this option, so I haven't bothered to fix it.  If
+** you think the stripping feature of NO8BIT is useful, you might let me
+** (Geoff Kuenning) know.
+**
+** Nevertheless, NO8BIT is a useful option for other reasons.  If NO8BIT
+** is defined, ispell will probably use 8-bit characters internally;
+** this improves time efficiency and saves a small amount of space
+** in the hash file.  Thus, I recommend you specify NO8BIT unless you
+** actually expect to be spelling files which use a 256-character set.
+*/ 
+#ifndef NO8BIT
+#undef NO8BIT
+#endif /* NO8BIT */
+
+/*
+** Number of mask bits (affix flags) supported.  Must be 32, 64, 128, or
+** 256.  If MASKBITS is 32 or 64, there are really only 26 or 58 flags
+** available, respectively.  If it is 32, the flags are named with the
+** 26 English uppercase letters;  lowercase will be converted to uppercase.
+** If MASKBITS is 64, the 58 flags are named 'A' through 'z' in ASCII
+** order, including the 6 special characters from 'Z' to 'a': "[\]^_`".
+** If MASKBITS is 128 or 256, all the 7-bit or 8-bit characters,
+** respectively, are theoretically available, though a few (newline, slash,
+** null byte) are pretty hard to actually use successfully.
+**
+** Note that a number of non-English affix files depend on having a
+** larger value for MASKBITS.  See the affix files for more
+** information.
+*/
+#ifndef MASKBITS
+#define MASKBITS	64
+#endif
+
+/*
+** C type to use for masks.  This should be a type that the processor
+** accesses efficiently.
+**
+** MASKTYPE_WIDTH must correctly reflect the number of bits in a
+** MASKTYPE.  Unfortunately, it is also required to be a constant at
+** preprocessor time, which means you can't use the sizeof operator to
+** define it.
+**
+** Note that MASKTYPE *must* match MASKTYPE_WIDTH or you may get
+** division-by-zero errors! 
+*/
+#ifndef MASKTYPE
+#define MASKTYPE	int
+#endif
+#ifndef MASKTYPE_WIDTH
+#define MASKTYPE_WIDTH	32
+#endif
+#if MASKBITS < MASKTYPE_WIDTH
+#undef MASKBITS
+#define MASKBITS	MASKTYPE_WIDTH
+#endif /* MASKBITS < MASKTYPE_WIDTH */
+
+
+/* maximum number of include files supported by xgets;  set to 0 to disable */
+#ifndef MAXINCLUDEFILES
+#define MAXINCLUDEFILES	5
+#endif
+
+/*
+** Maximum hash table fullness percentage.  Larger numbers trade space
+** for time.
+**/
+#ifndef MAXPCT
+#define MAXPCT	70		/* Expand table when 70% full */
+#endif
+
+/*
+** Maximum number of "string" characters that can be defined in a
+** language (affix) file.  Don't forget that an upper/lower string
+** character counts as two!
+*/
+#ifndef MAXSTRINGCHARS
+#define MAXSTRINGCHARS 100
+#endif /* MAXSTRINGCHARS */
+
+/*
+** Maximum length of a "string" character.  The default is appropriate for
+** nroff-style characters starting with a backslash.
+*/
+#ifndef MAXSTRINGCHARLEN
+#define MAXSTRINGCHARLEN 10
+#endif /* MAXSTRINGCHARLEN */
+
+/*
+** the NO_PARITY mask is applied to user input characters from the terminal
+** in order to mask out the parity bit.
+*/
+#ifdef NO8BIT
+#define NO_PARITY 0x7f
+#else
+#define NO_PARITY 0xff
+#endif
+
+
+/*
+** the terminal mode for ispell, set to CBREAK or RAW
+**
+*/
+#ifndef TERM_MODE
+#define TERM_MODE	RAW
+#endif
+
+/*
+** Define this if you want your columns of words to be of equal length.
+** This will spread short word lists across the screen instead of down it.
+*/
+#ifndef EQUAL_COLUMNS
+#undef EQUAL_COLUMNS
+#endif /* EQUAL_COLUMNS */
+
+/*
+** This is the extension that will be added to backup files
+*/
+#ifndef	BAKEXT
+#define	BAKEXT	".bak"
+#endif
+
+/*
+** Define this if you want to suppress the capitalization-checking
+** feature.  This will reduce the size of the hashed dictionary on
+** most 16-bit and some 32-bit machines.  This option is not
+** recommended.
+*/
+#ifndef NO_CAPITALIZATION_SUPPORT
+#undef NO_CAPITALIZATION_SUPPORT
+#endif /* NO_CAPITALIZATION_SUPPORT */
+
+/*
+** Define this if you want your personal dictionary sorted.  This may take
+** a long time for very large dictionaries.  Dictionaries larger than
+** SORTPERSONAL words will not be sorted.  Define SORTPERSONAL as zero
+** to disable this feature.
+*/
+#ifndef SORTPERSONAL
+#define SORTPERSONAL	1000
+#endif
+
+/*
+** Define this if you want to use the shell for interpretation of commands
+** issued via the "L" command, "^Z" under System V, and "!".  If this is
+** not defined then a direct fork()/exec() will be used in place of the
+** normal system().  This may speed up these operations greately on some
+** systems.
+*/
+#ifndef USESH
+#undef USESH
+#endif /* USESH */
+
+/*
+** Maximum language-table search size.  Smaller numbers make ispell
+** run faster, at the expense of more memory (the lowest reasonable value
+** is 2).  If a given character appears in a significant position in
+** more than MAXSEARCH suffixes, it will be given its own index table.
+** If you change this, define INDEXDUMP in lookup.c to be sure your
+** index table looks reasonable.
+*/
+#ifndef MAXSEARCH
+#define MAXSEARCH 4
+#endif
+
+/*
+** Define this if you want to be able to type any command at a "type space
+** to continue" prompt.
+*/
+#ifndef COMMANDFORSPACE
+#undef COMMANDFORSPACE
+#endif /* COMMANDFORSPACE */
+
+/*
+** Memory-allocation increment.  Buildhash allocates memory in chunks
+** of this size, and then subdivides it to get its storage.  This saves
+** much malloc execution time.  A good number for this is the system
+** page size less the malloc storage overhead.
+**
+** Define this to zero to revert to using malloc/realloc.  This is normally
+** useful only on systems with limited memory.
+*/
+#ifndef MALLOC_INCREMENT
+#define MALLOC_INCREMENT	(4096 - 8)
+#endif
+
+/*
+** Maximum number of "hits" expected on a word.  This is basically the
+** number of different ways different affixes can produce the same word.
+** For example, with "english.aff", "brothers" can be produced 3 ways:
+** "brothers," "brother+s", or "broth+ers".  If this is too low, no major
+** harm will be done, but ispell may occasionally forget a capitalization.
+*/
+#ifndef MAX_HITS
+#define MAX_HITS	10
+#endif
+
+/*
+** Maximum number of capitalization variations expected in any word.
+** Besides the obvious all-lower, all-upper, and capitalized versions,
+** this includes followcase variants.  If this is too low, no real
+** harm will be done, but ispell may occasionally fail to suggest a
+** correct capitalization.
+*/
+#ifndef MAX_CAPS
+#define MAX_CAPS	10
+#endif /* MAX_CAPS */
+
+/* Define this to ignore spelling check of entire LaTeX bibliography listings */
+#ifndef IGNOREBIB
+#undef IGNOREBIB
+#endif
+
+/*
+** Default nroff and TeX special characters.  Normally, you won't want to
+** change this;  instead you would override it in the language-definition
+** file.
+*/
+#ifndef TEXSPECIAL
+#define TEXSPECIAL	"()[]{}<>\\$*.%"
+#endif
+
+#ifndef NRSPECIAL
+#define NRSPECIAL	"().\\*"
+#endif
+
+/*
+** Defaults for certain command-line flags.
+*/
+#ifndef DEFNOBACKUPFLAG
+#define DEFNOBACKUPFLAG	0		    /* Don't suppress backup file */
+#endif
+#ifndef DEFTEXFLAG
+#define DEFTEXFLAG	0		    /* Default to nroff mode */
+#endif
+
+/*
+** Define this if you want ispell to place a limitation on the maximum
+** size of the screen.  On windowed workstations with very large windows,
+** the size of the window can be too much of a good thing, forcing the
+** user to look back and forth between the bottom and top of the screen.
+** If MAX_SCREEN_SIZE is nonzero, screens larger than this will be treated
+** as if they have only MAX_SCREEN_SIZE lines.  A good value for this
+** variable is 24 or 30.  Define it as zero to suppress the feature.
+*/
+#ifndef MAX_SCREEN_SIZE
+#define MAX_SCREEN_SIZE 0
+#endif
+
+/*
+** The next three variables are used to provide a variable-size context
+** display at the bottom of the screen.  Normally, the user will see
+** a number of lines equal to CONTEXTPCT of his screen, rounded down
+** (thus, with CONTEXTPCT == 10, a 24-line screen will produce two lines
+** of context).  The context will never be greater than MAXCONTEXT or
+** less than MINCONTEXT.  To disable this feature entirely, set MAXCONTEXT
+** and MINCONTEXT to the same value.  To round context percentages up,
+** define CONTEXTROUNDUP.
+**
+** Warning: don't set MAXCONTEXT ridiculously large.  There is a
+** static buffer of size MAXCONTEXT*BUFSIZ; since BUFSIZ is frequently
+** 1K or larger, this can create a remarkably large executable.
+*/
+#ifndef CONTEXTPCT
+#define CONTEXTPCT	10	/* Use 10% of the screen for context */
+#endif
+#ifndef MINCONTEXT
+#define MINCONTEXT	2	/* Always show at least 2 lines of context */
+#endif
+#ifndef MAXCONTEXT
+#define MAXCONTEXT	10	/* Never show more than 10 lines of context */
+#endif
+#ifndef CONTEXTROUNDUP
+#undef CONTEXTROUNDUP		/* Don't round context up */
+#endif
+
+/*
+** Define this if you want the context lines to be displayed at the
+** bottom of the screen, the way they used to be, rather than at the top.
+*/
+#ifndef BOTTOMCONTEXT
+#undef BOTTOMCONTEXT
+#endif /* BOTTOMCONTEXT */
+
+/*
+** Define this if you want the "mini-menu," which gives the most important
+** options at the bottom of the screen, to be the default (in any case, it
+** can be controlled with the "-M" switch).
+*/
+#ifndef MINIMENU
+#undef MINIMENU
+#endif
+
+/*
+** You might want to change this to zero if your users want to check
+** single-letter words against the dictionary.  However, you should try
+** some sample runs using the -W switch before you try it out;  you'd
+** be surprised how many single letters appear in documents.  If you increase
+** MINWORD beyond 1, don't say I didn't warn you that it was a bad idea.
+*/
+#ifndef MINWORD
+#define MINWORD		1	/* Words this short and shorter are always ok */
+#endif
+
+/*
+** ANSI C compilers are supposed to provide an include file,
+** "stdlib.h", which gives function prototypes for all library
+** routines.  Define NO_STDLIB_H if you have a compiler that claims to
+** be ANSI, but doesn't provide this include file.
+*/
+#ifndef NO_STDLIB_H
+#ifndef __STDC__
+#define NO_STDLIB_H
+#endif /* __STDC__ */
+#endif /* NO_STDLIB_H */
+
+/*
+** The following define is used by the ispell developer to help
+** double-check the software.  Leave it undefined on other systems
+** unless you are especially fond of warning messages, or are pursuing
+** an inexplicable bug that might be related to a type mismatch.
+*/
+#ifndef GENERATE_LIBARARY_PROTOS
+#undef GENERATE_LIBARARY_PROTOS
+#endif /* GENERATE_LIBARARY_PROTOS */
+
+/*
+** Symbols below this point are generally intended to cater to
+** idiosyncracies of specific machines and operating systems.
+**
+** MS-DOS users should also define HAS_RENAME, above, if appropriate.
+**
+** Define PIECEMEAL_HASH_WRITES if your system can't handle huge write
+** operations.  This is known to be a problem on some MS-DOS systems.
+*/
+#ifndef PIECEMEAL_HASH_WRITES
+#undef PIECEMEAL_HASH_WRITES
+#endif /* PIECEMEAL_HASH_WRITES */
+
+/*
+** Redefine GETKEYSTROKE() to getkey() on some MS-DOS systems where
+** getchar() doesn't operate properly in raw mode.
+*/
+#ifndef GETKEYSTROKE
+#define GETKEYSTROKE()	getch()
+#endif /* GETKEYSTROKE */
+
+/*
+** Define MSDOS_BINARY_OPEN to 0x8000 on MS-DOS systems.  This can be
+** done by adding "#include fcntl.h" to your local.h file.
+*/
+#include <fcntl.h>
+#undef O_BINARY
+#define O_BINARY _O_BINARY
+#ifndef MSDOS_BINARY_OPEN
+#ifdef O_BINARY
+#define MSDOS_BINARY_OPEN   O_BINARY
+#else /* O_BINARY */
+#define MSDOS_BINARY_OPEN   0
+#endif /* O_BINARY */
+#endif /* MSDOS_BINARY_OPEN */
+
+/*
+** Environment variable to use to locate the home directory.  On DOS
+** systems you might want to set this to ISPELL_HOME to avoid
+** conflicts with other programs that look for a HOME environment
+** variable; on all other systems it should be just HOME.
+*/
+#ifndef HOME
+#define HOME	"HOME"
+#endif /* HOME */
+
+/*
+** On MS-DOS systems, define PDICTHOME to be the name of a directory
+** to be used to contain the personal dictionary (.ispell_english,
+** etc.).  On other systems, you can leave it undefined.
+*/
+#ifndef PDICTHOME
+#undef PDICTHOME 
+#endif /* PDICTHOME */
+
+/*
+** On MS-DOS systems, you can rename the following variables so that
+** ispell's files have 3-character suffixes.  Note that, if you do
+** this, you will have to redefine any variable above that
+** incorporates one of the suffixes.
+*/
+#ifndef HASHSUFFIX
+#define HASHSUFFIX	".hash"
+#endif /* HASHSUFFIX */
+#ifndef STATSUFFIX
+#define STATSUFFIX	".stat"
+#endif /* STATSUFFIX */
+#ifndef COUNTSUFFIX
+#define COUNTSUFFIX	".cnt"
+#endif /* COUNTSUFFIX */
+
+/* AUTOMATICALLY-GENERATED SYMBOLS */
+#define SIGNAL_TYPE_STRING "void"
+#define MASKTYPE_STRING "int"
diff -Nur ispell-3.1/sq.c n/sq.c
--- ispell-3.1/sq.c	Wed Jan 26 03:32:18 1994
+++ n/sq.c	Tue Sep 18 23:11:24 2001
@@ -76,12 +76,21 @@
 
 #define MAX_PREFIX	(sizeof (size_encodings) - 1)
 
+#ifdef WIN32
+#include <fcntl.h>
+#endif
+
 int main (argc, argv)
     int		argc;
     char *	argv[];
     {
     char	word[257];
     static char	prev[257] = "";
+
+#ifdef WIN32
+    strcpy(argv[0], "sq");
+    setmode(fileno(stdout), _O_BINARY);
+#endif
 
     while (gets (word) != NULL)
 	trunc (word, prev);
diff -Nur ispell-3.1/term.c n/term.c
--- ispell-3.1/term.c	Thu Nov 03 03:44:28 1994
+++ n/term.c	Tue Sep 18 23:11:24 2001
@@ -1,210 +1,58 @@
-#ifndef lint
-static char Rcs_Id[] =
-    "$Id: term.c,v 1.48 1994/10/25 05:46:11 geoff Exp $";
-#endif
-
-/*
- * term.c - deal with termcap, and unix terminal mode settings
- *
- * Pace Willisson, 1983
- *
- * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All modifications to the source code must be clearly marked as
- *    such.  Binary redistributions based on modified source code
- *    must be clearly marked as modified versions in the documentation
- *    and/or other materials provided with the distribution.
- * 4. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgment:
- *      This product includes software developed by Geoff Kuenning and
- *      other unpaid contributors.
- * 5. The name of Geoff Kuenning may not be used to endorse or promote
- *    products derived from this software without specific prior
- *    written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $Log: term.c,v $
- * Revision 1.48  1994/10/25  05:46:11  geoff
- * Fix a couple of places where ifdefs were omitted, though apparently
- * harmlessly.
- *
- * Revision 1.47  1994/09/01  06:06:32  geoff
- * Change erasechar/killchar to uerasechar/ukillchar to avoid
- * shared-library problems on HP systems.
- *
- * Revision 1.46  1994/01/25  07:12:11  geoff
- * Get rid of all old RCS log lines in preparation for the 3.1 release.
- *
- */
-
+/* Definitions for terminal functions on NT consoles */
 #include "config.h"
 #include "ispell.h"
-#include "proto.h"
 #include "msgs.h"
-#ifdef USG
-#include <termio.h>
-#else
-#include <sgtty.h>
-#endif
+#undef VOID
+#include <windows.h>
 #include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#undef putchar
+
+COORD cursor_coords;
+HANDLE cur_screen;
+USHORT char_attr_normal, char_attr_reverse;
+USHORT char_attr;
+int term_inited = 0;
 
 void		erase P ((void));
 void		move P ((int row, int col));
 void		inverse P ((void));
 void		normal P ((void));
 void		backup P ((void));
-static int	putch P ((int c));
 void		terminit P ((void));
 SIGNAL_TYPE	done P ((int signo));
-#ifdef SIGTSTP
-static SIGNAL_TYPE onstop P ((int signo));
-#endif /* SIGTSTP */
 void		stop P ((void));
 int		shellescape P ((char * buf));
-#ifdef USESH
-void		shescape P ((char * buf));
-#endif /* USESH */
-
-void erase ()
-    {
 
-    if (cl)
-	tputs (cl, li, putch);
-    else
-	{
-	if (ho)
-	    tputs (ho, 100, putch);
-	else if (cm)
-	    tputs (tgoto (cm, 0, 0), 100, putch);
-	tputs (cd, li, putch);
-	}
-    }
+CONSOLE_CURSOR_INFO cci;
 
-void move (row, col)
-    int		row;
-    int		col;
-    {
-    tputs (tgoto (cm, col, row), 100, putch);
-    }
+void terminit()
+{
+  char ch;
 
-void inverse ()
-    {
-    tputs (so, 10, putch);
-    }
+  CONSOLE_SCREEN_BUFFER_INFO info;
 
-void normal ()
-    {
-    tputs (se, 10, putch);
-    }
+  cursor_coords.X = cursor_coords.Y = 0;
+  cur_screen = GetStdHandle(STD_OUTPUT_HANDLE);
+  GetConsoleScreenBufferInfo(cur_screen, &info);
+  char_attr_normal = info.wAttributes & 0xFF;
+  char_attr_reverse = ((char_attr_normal & 0x0f) << 4)
+    + ((char_attr_normal & 0xf0) >> 4);
 
-void backup ()
-    {
-    if (BC)
-	tputs (BC, 1, putch);
-    else
-	(void) putchar ('\b');
-    }
+  char_attr = char_attr_normal;
 
-static int putch (c)
-    int			c;
-    {
+  (void)GetConsoleCursorInfo(cur_screen, &cci);
+  cci.bVisible = FALSE;
+  (void)SetConsoleCursorInfo(cur_screen, &cci);
 
-    return putchar (c);
-    }
-
-#ifdef USG
-static struct termio	sbuf;
-static struct termio	osbuf;
-#else
-static struct sgttyb	sbuf;
-static struct sgttyb	osbuf;
-#ifdef TIOCSLTC
-static struct ltchars	ltc;
-static struct ltchars	oltc;
-#endif
-#endif
-static int		termchanged = 0;
-static SIGNAL_TYPE	(*oldint) ();
-static SIGNAL_TYPE	(*oldterm) ();
-#ifdef SIGTSTP
-static SIGNAL_TYPE	(*oldttin) ();
-static SIGNAL_TYPE	(*oldttou) ();
-static SIGNAL_TYPE	(*oldtstp) ();
-#endif
-
-void terminit ()
-    {
-#ifdef TIOCPGRP
-    int			tpgrp;
-#else
-#ifdef TIOCGPGRP
-    int			tpgrp;
-#endif
-#endif
-#ifdef TIOCGWINSZ
-    struct winsize	wsize;
-#endif /* TIOCGWINSZ */
-
-    tgetent (termcap, getenv ("TERM"));
-    termptr = termstr;
-    BC = tgetstr ("bc", &termptr);
-    cd = tgetstr ("cd", &termptr);
-    cl = tgetstr ("cl", &termptr);
-    cm = tgetstr ("cm", &termptr);
-    ho = tgetstr ("ho", &termptr);
-    nd = tgetstr ("nd", &termptr);
-    so = tgetstr ("so", &termptr);	/* inverse video on */
-    se = tgetstr ("se", &termptr);	/* inverse video off */
-    if ((sg = tgetnum ("sg")) < 0)	/* space taken by so/se */
-	sg = 0;
-    ti = tgetstr ("ti", &termptr);	/* terminal initialization */
-    te = tgetstr ("te", &termptr);	/* terminal termination */
-    co = tgetnum ("co");
-    li = tgetnum ("li");
-#ifdef TIOCGWINSZ
-    if (ioctl (0, TIOCGWINSZ, (char *) &wsize) >= 0)
-	{
-	if (wsize.ws_col != 0)
-	    co = wsize.ws_col;
-	if (wsize.ws_row != 0)
-	    li = wsize.ws_row;
-	}
-#endif /* TIOCGWINSZ */
-    /*
-     * Let the variables "LINES" and "COLUMNS" override the termcap
-     * entry.  Technically, this is a terminfo-ism, but I think the
-     * vast majority of users will find it pretty handy.
-     */
-    if (getenv ("COLUMNS") != NULL)
-	co = atoi (getenv ("COLUMNS"));
-    if (getenv ("LINES") != NULL)
-	li = atoi (getenv ("LINES"));
+  li = info.dwSize.Y;
+  co = info.dwSize.X;
 #if MAX_SCREEN_SIZE > 0
-    if (li > MAX_SCREEN_SIZE)
-	li = MAX_SCREEN_SIZE;
+  if (li > MAX_SCREEN_SIZE)
+    li = MAX_SCREEN_SIZE;
 #endif /* MAX_SCREEN_SIZE > 0 */
 #if MAXCONTEXT == MINCONTEXT
     contextsize = MINCONTEXT;
@@ -235,333 +83,190 @@
     if (li < MINCONTEXT + 8)
 	(void) fprintf (stderr, TERM_C_SMALL_SCREEN, MINCONTEXT + 8);
 
-#ifdef SIGTSTP
-#ifdef TIOCPGRP
-retry:
-#endif /* SIGTSTP */
-#endif /* TIOCPGRP */
-
-#ifdef USG
-    if (!isatty (0))
-	{
-	(void) fprintf (stderr, TERM_C_NO_BATCH);
-	exit (1);
-	}
-    (void) ioctl (0, TCGETA, (char *) &osbuf);
-    termchanged = 1;
-
-    sbuf = osbuf;
-    sbuf.c_lflag &= ~(ECHO | ECHOK | ECHONL | ICANON);
-    sbuf.c_oflag &= ~(OPOST);
-    sbuf.c_iflag &= ~(INLCR | IGNCR | ICRNL);
-    sbuf.c_cc[VMIN] = 1;
-    sbuf.c_cc[VTIME] = 1;
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
-
-    uerasechar = osbuf.c_cc[VERASE];
-    ukillchar = osbuf.c_cc[VKILL];
-
-#endif
-
-#ifdef SIGTSTP
-#ifndef USG
-    (void) sigsetmask (1<<(SIGTSTP-1) | 1<<(SIGTTIN-1) | 1<<(SIGTTOU-1));
-#endif
-#endif
-#ifdef TIOCGPGRP
-    if (ioctl (0, TIOCGPGRP, (char *) &tpgrp) != 0)
-	{
-	(void) fprintf (stderr, TERM_C_NO_BATCH);
-	exit (1);
-	}
-#endif
-#ifdef SIGTSTP
-#ifdef TIOCPGRP
-    if (tpgrp != getpgrp(0)) /* not in foreground */
-	{
-#ifndef USG
-	(void) sigsetmask (1 << (SIGTSTP - 1) | 1 << (SIGTTIN - 1));
-#endif
-	(void) signal (SIGTTOU, SIG_DFL);
-	(void) kill (0, SIGTTOU);
-	/* job stops here waiting for SIGCONT */
-	goto retry;
-	}
-#endif
-#endif
+    erase();
+    term_inited = 1;
+}
+
+void cursoron(void)
+{
+  if(term_inited) {
+    cci.bVisible = TRUE;
+    (void)SetConsoleCursorInfo(cur_screen, &cci);
+    return;
+  }
+  else return;
+}
+
+void cursoroff(void)
+{
+  if(term_inited) {
+    cci.bVisible = FALSE;
+    (void)SetConsoleCursorInfo(cur_screen, &cci);
+    return;
+  }
+  else return;
+}
+
+void erase()
+{
+  COORD dest;
+  int n, r;
+
+  n = li * co;
+  dest.X = dest.Y = 0;
+
+  FillConsoleOutputAttribute(cur_screen, char_attr_normal, n, dest, &r);
+  FillConsoleOutputCharacter(cur_screen, ' ', n, dest, &r);
+  move(0, 0);
+}
+
+void move(int row,int col)
+{
+  cursor_coords.X = col;
+  cursor_coords.Y = row;
+  SetConsoleCursorPosition(cur_screen, cursor_coords);
+}
+
+void normal()
+{
+  char_attr = char_attr_normal;
+}
+
+void inverse()
+{
+  char_attr = char_attr_reverse;
+}
+
+void backup()
+{
+  putchar('\b');
+}
+
+void stop()
+{
+/* stop is not supported. */
+  return;
+}
+
+SIGNAL_TYPE done(int signo)
+{
+  /* Clean up temp files */
+  if (tempfile[0] != '\0')
+      remove(tempfile);
+
+  if(term_inited) {
+    cci.bVisible = TRUE;
+    (void)SetConsoleCursorInfo(cur_screen, &cci);
+  }
+
+  exit(0);
+}
+
+int putchar(unsigned char ch)
+{
+  int i;
+  char erase = ' ';
+
+  switch(ch)
+    {
+    case 7: /* Bell */
+      Beep(600, 100);
+      break;
+    case '\n':
+      cursor_coords.Y++;
+      cursor_coords.X = 0;
+      break;
+    case '\r':
+      cursor_coords.X = 0;
+      break;
+    case '\b':
+      cursor_coords.X--;
+      WriteConsoleOutputAttribute(cur_screen, &char_attr, 1,
+                                  cursor_coords, &i);
+      WriteConsoleOutputCharacter(cur_screen, &erase, 1, cursor_coords, &i);
+      break;
+    case '\t':
+      cursor_coords.X = ((cursor_coords.X / 8) + 1) * 8;
+      break;
+    default:
+      WriteConsoleOutputAttribute(cur_screen, &char_attr, 1,
+                                  cursor_coords, &i);
+      WriteConsoleOutputCharacter(cur_screen, &ch, 1, cursor_coords, &i);
+
+      cursor_coords.X++;
+    }
+
+  move(cursor_coords.Y, cursor_coords.X);
+
+  return ch;
+}
+
+/* Override printf to keep character placement correct.  */
+#define PRINTF_BUF_SZ 200
+int printf(const char *format_string, ... )
+{
+  va_list argp;
+  char output_data[PRINTF_BUF_SZ];
+  char *outp = output_data;
+  int retval, full_len, len, i = 0;
+
+  va_start(argp, format_string);
+
+  /* printf is called by both the default screen orientated code, and
+     by the line-by-line code of ispell -a etc. We can tell which one
+     this is by whether terminit was previously called  */
+  if (term_inited)
+    {
+      retval = _vsnprintf(output_data, PRINTF_BUF_SZ, format_string, argp);
+      full_len = strlen(outp);
+      while (outp < output_data + full_len)
+        {
+          if (iscntrl(*outp))
+            {
+              /* Output control characters one at a time via putchar */
+              putchar(*outp);
+              outp++;
+            }
+          else
+            {
+              int todo = full_len - (outp - output_data);
+              for (len = 0; len < todo; len++)
+                if (iscntrl(*(outp+len)))
+                  break;
+              /* Output all sequential non-control characters in one
+                 sweep (for speed of display) */
+              FillConsoleOutputAttribute(cur_screen, char_attr, len,
+                                         cursor_coords, &i);
+              WriteConsoleOutputCharacter(cur_screen, outp, len,
+                                          cursor_coords, &i);
+              outp += len;
+              cursor_coords.X += len;
+              move(cursor_coords.Y, cursor_coords.X);
+            }
+        }
+    }
+  else
+    retval = vprintf(format_string, argp);
+  va_end(argp);
+
+  return retval;
+}
+
+int shellescape(char *buf)
+{
+  int ret;
+
+  if (term_inited) erase();
+  ret = system(buf);
+
+  if (term_inited)
+    {
+      (void) fprintf (stdout, "\r\n");
+      (void) fprintf (stdout, CORR_C_HELP_TYPE_SPACE);
+      (void) fflush (stdout);
 
-#ifndef USG
-    (void) ioctl (0, TIOCGETP, (char *) &osbuf);
-#ifdef TIOCGLTC
-    (void) ioctl (0, TIOCGLTC, (char *) &oltc);
-#endif
-    termchanged = 1;
-
-    sbuf = osbuf;
-    sbuf.sg_flags &= ~ECHO;
-    sbuf.sg_flags |= TERM_MODE;
-    (void) ioctl (0, TIOCSETP, (char *) &sbuf);
-
-    uerasechar = sbuf.sg_erase;
-    ukillchar = sbuf.sg_kill;
-
-#ifdef TIOCSLTC
-    ltc = oltc;
-    ltc.t_suspc = -1;
-    (void) ioctl (0, TIOCSLTC, (char *) &ltc);
-#endif
-
-#endif /* USG */
-
-    if ((oldint = signal (SIGINT, SIG_IGN)) != SIG_IGN)
-	(void) signal (SIGINT, done);
-    if ((oldterm = signal (SIGTERM, SIG_IGN)) != SIG_IGN)
-	(void) signal (SIGTERM, done);
-
-#ifdef SIGTSTP
-#ifndef USG
-    (void) sigsetmask (0);
-#endif
-    if ((oldttin = signal (SIGTTIN, SIG_IGN)) != SIG_IGN)
-	(void) signal (SIGTTIN, onstop);
-    if ((oldttou = signal (SIGTTOU, SIG_IGN)) != SIG_IGN)
-	(void) signal (SIGTTOU, onstop);
-    if ((oldtstp = signal (SIGTSTP, SIG_IGN)) != SIG_IGN)
-	(void) signal (SIGTSTP, onstop);
-#endif
-    if (ti)
-	tputs (ti, 1, putch);
-    }
-
-/* ARGSUSED */
-SIGNAL_TYPE done (signo)
-    int		signo;
-    {
-    if (tempfile[0] != '\0')
-	(void) unlink (tempfile);
-    if (termchanged)
-	{
-	if (te)
-	    tputs (te, 1, putch);
-#ifdef USG
-	(void) ioctl (0, TCSETAW, (char *) &osbuf);
-#else
-	(void) ioctl (0, TIOCSETP, (char *) &osbuf);
-#ifdef TIOCSLTC
-	(void) ioctl (0, TIOCSLTC, (char *) &oltc);
-#endif
-#endif
-	}
-    exit (0);
-    }
-
-#ifdef SIGTSTP
-static SIGNAL_TYPE onstop (signo)
-    int		signo;
-    {
-#ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
-#else
-    (void) ioctl (0, TIOCSETP, (char *) &osbuf);
-#ifdef TIOCSLTC
-    (void) ioctl (0, TIOCSLTC, (char *) &oltc);
-#endif
-#endif
-    (void) signal (signo, SIG_DFL);
-#ifndef USG
-    (void) sigsetmask (sigblock (0) & ~(1 << (signo - 1)));
-#endif
-    (void) kill (0, signo);
-    /* stop here until continued */
-    (void) signal (signo, onstop);
-#ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
-#else
-    (void) ioctl (0, TIOCSETP, (char *) &sbuf);
-#ifdef TIOCSLTC
-    (void) ioctl (0, TIOCSLTC, (char *) &ltc);
-#endif
-#endif
-    }
-#endif
-
-void stop ()
-    {
-#ifdef SIGTSTP
-    onstop (SIGTSTP);
-#else
-    /* for System V */
-    move (li - 1, 0);
-    (void) fflush (stdout);
-    if (getenv ("SHELL"))
-	(void) shellescape (getenv ("SHELL"));
-    else
-	(void) shellescape ("sh");
-#endif
-    }
-
-/* Fork and exec a process.  Returns NZ if command found, regardless of
-** command's return status.  Returns zero if command was not found.
-** Doesn't use a shell.
-*/
-#ifndef USESH
-#define NEED_SHELLESCAPE
-#endif /* USESH */
-#ifndef REGEX_LOOKUP
-#define NEED_SHELLESCAPE
-#endif /* REGEX_LOOKUP */
-#ifdef NEED_SHELLESCAPE
-int shellescape	(buf)
-    char *	buf;
-    {
-    char *	argv[100];
-    char *	cp = buf;
-    int		i = 0;
-    int		termstat;
-
-    /* parse buf to args (destroying it in the process) */
-    while (*cp != '\0')
-	{
-	while (*cp == ' '  ||  *cp == '\t')
-	    ++cp;
-	if (*cp == '\0')
-	    break;
-	argv[i++] = cp;
-	while (*cp != ' '  &&  *cp != '\t'  &&  *cp != '\0')
-	    ++cp;
-	if (*cp != '\0')
-	    *cp++ = '\0';
-	}
-    argv[i] = NULL;
-
-#ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
-#else
-    (void) ioctl (0, TIOCSETP, (char *) &osbuf);
-#ifdef TIOCSLTC
-    (void) ioctl (0, TIOCSLTC, (char *) &oltc);
-#endif /* TIOCSLTC */
-#endif
-    (void) signal (SIGINT, oldint);
-    (void) signal (SIGTERM, oldterm);
-#ifdef SIGTSTP
-    (void) signal (SIGTTIN, oldttin);
-    (void) signal (SIGTTOU, oldttou);
-    (void) signal (SIGTSTP, oldtstp);
-#endif
-    if ((i = fork ()) == 0)
-	{
-	(void) execvp (argv[0], (char **) argv);
-	_exit (123);		/* Command not found */
-	}
-    else if (i > 0)
-	{
-	while (wait (&termstat) != i)
-	    ;
-	termstat = (termstat == (123 << 8)) ? 0 : -1;
-	}
-    else
-	{
-	(void) printf (TERM_C_CANT_FORK);
-	termstat = -1;		/* Couldn't fork */
-	}
-
-    if (oldint != SIG_IGN)
-	(void) signal (SIGINT, done);
-    if (oldterm != SIG_IGN)
-	(void) signal (SIGTERM, done);
-
-#ifdef SIGTSTP
-    if (oldttin != SIG_IGN)
-	(void) signal (SIGTTIN, onstop);
-    if (oldttou != SIG_IGN)
-	(void) signal (SIGTTOU, onstop);
-    if (oldtstp != SIG_IGN)
-	(void) signal (SIGTSTP, onstop);
-#endif
-
-#ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
-#else
-    (void) ioctl (0, TIOCSETP, (char *) &sbuf);
-#ifdef TIOCSLTC
-    (void) ioctl (0, TIOCSLTC, (char *) &ltc);
-#endif /* TIOCSLTC */
-#endif
-    if (termstat)
-	{
-	(void) printf (TERM_C_TYPE_SPACE);
-	(void) fflush (stdout);
-#ifdef COMMANDFORSPACE
-	i = GETKEYSTROKE ();
-	if (i != ' ' && i != '\n' && i != '\r')
-	    (void) ungetc (i, stdin);
-#else
-	while (GETKEYSTROKE () != ' ')
-	    ;
-#endif
-	}
-    return (termstat);
-    }
-#endif /* NEED_SHELLESCAPE */
-
-#ifdef	USESH
-void shescape (buf)
-    char *	buf;
-    {
-#ifdef COMMANDFORSPACE
-    int		ch;
-#endif
-
-#ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
-#else
-    (void) ioctl (0, TIOCSETP, (char *) &osbuf);
-#ifdef TIOCSLTC
-    (void) ioctl (0, TIOCSLTC, (char *) &oltc);
-#endif
-#endif
-    (void) signal (SIGINT, oldint);
-    (void) signal (SIGTERM, oldterm);
-#ifdef SIGTSTP
-    (void) signal (SIGTTIN, oldttin);
-    (void) signal (SIGTTOU, oldttou);
-    (void) signal (SIGTSTP, oldtstp);
-#endif
-
-    (void) system (buf);
-
-    if (oldint != SIG_IGN)
-	(void) signal (SIGINT, done);
-    if (oldterm != SIG_IGN)
-	(void) signal (SIGTERM, done);
-
-#ifdef SIGTSTP
-    if (oldttin != SIG_IGN)
-	(void) signal (SIGTTIN, onstop);
-    if (oldttou != SIG_IGN)
-	(void) signal (SIGTTOU, onstop);
-    if (oldtstp != SIG_IGN)
-	(void) signal (SIGTSTP, onstop);
-#endif
-
-#ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
-#else
-    (void) ioctl (0, TIOCSETP, (char *) &sbuf);
-#ifdef TIOCSLTC
-    (void) ioctl (0, TIOCSLTC, (char *) &ltc);
-#endif
-#endif
-    (void) printf (TERM_C_TYPE_SPACE);
-    (void) fflush (stdout);
-#ifdef COMMANDFORSPACE
-    ch = GETKEYSTROKE ();
-    if (ch != ' '  &&  ch != '\n'  &&  ch != '\r')
-	(void) ungetc (ch, stdin);
-#else
-    while (GETKEYSTROKE () != ' ')
+      while (GETKEYSTROKE () != ' ')
 	;
-#endif
     }
-#endif
+  return ret;
+}
diff -Nur ispell-3.1/tree.c n/tree.c
--- ispell-3.1/tree.c	Tue Jan 24 03:28:28 1995
+++ n/tree.c	Tue Sep 18 23:11:24 2001
@@ -111,7 +111,7 @@
     char *		h;		/* Home directory name */
     char		seconddict[MAXPATHLEN]; /* Name of secondary dict */
     FILE *		secondf;	/* Access to second dict file */
-
+    char *              pp;
     /*
     ** If -p was not specified, try to get a default name from the
     ** environment.  After this point, if p is null, the the value in
@@ -134,7 +134,10 @@
 	return;
 #endif /* PDICTHOME */
 	}
-
+    for(pp=h; *pp; pp++) {
+       if((*pp == '\\') && ((pp==h) || !isknj(*(pp-1))))
+           *pp = '/';
+    }
     if (p == NULL)
 	{
 	/*
@@ -193,12 +196,16 @@
 	}
     else
 	{
+        for(pp=p; *pp; pp++) {
+           if((*pp == '\\') && ((pp==p) || !isknj(*(pp-1))))
+               *pp = '/';
+	}
 	/*
 	** Figure out if p is an absolute path name.  Note that beginning
 	** with "./" and "../" is considered an absolute path, since this
 	** still means we can't prepend HOME.
 	*/
-	abspath = (*p == '/'  ||  strncmp (p, "./", 2) == 0
+	abspath = (*p == '/'  ||  *(p+1) == ':' || strncmp (p, "./", 2) == 0
 	  ||  strncmp (p, "../", 3) == 0);
 	if (abspath)
 	    {
@@ -526,7 +533,7 @@
     if (newwords == 0)
 	return;
 
-    if ((dictf = fopen (personaldict, "w")) == NULL)
+    if ((dictf = fopen (personaldict, "wb")) == NULL)
 	{
 	(void) fprintf (stderr, CANT_CREATE, personaldict);
 	return;
diff -Nur ispell-3.1/unsq.c n/unsq.c
--- ispell-3.1/unsq.c	Wed Jan 26 03:32:18 1994
+++ n/unsq.c	Tue Sep 18 23:11:24 2001
@@ -79,12 +79,21 @@
 
 extern void	exit P ((int status));
 
+#ifdef WIN32
+#include <fcntl.h>
+#endif
+
 int main (argc, argv)
     int			argc;
     char *		argv[];
     {
     char		word[257];
     static char		prev[257] = "";
+
+#ifdef WIN32
+    strcpy(argv[0], "unsq");
+    setmode(fileno(stdout), _O_BINARY);
+#endif
 
     while (!expand (word, prev))
         puts (word);
diff -Nur ispell-3.1/version.h n/version.h
--- ispell-3.1/version.h	Fri Oct 13 04:04:46 1995
+++ n/version.h	Tue Sep 18 23:11:28 2001
@@ -8,7 +8,7 @@
  */
 
 static char * Version_ID[] = {
-    "@(#) International Ispell Version 3.1.20 10/10/95",
+    "@(#) International Ispell Version 3.1.20 10/10/95, patch 1",
     "@(#) Copyright (c), 1983, by Pace Willisson",
     "@(#) International version Copyright (c) 1987, 1988, 1990-1995,",
     "@(#) by Geoff Kuenning, Granada Hills, CA.  All rights reserved.",
diff -Nur ispell-3.1/xgets.c n/xgets.c
--- ispell-3.1/xgets.c	Thu Nov 03 03:44:30 1994
+++ n/xgets.c	Tue Sep 18 23:11:24 2001
@@ -86,14 +86,20 @@
     static FILE **	current_F = F;
     char *		s = str;
     int			c;
+    char *              pp;
 
     /* read the environment variable if we havent already */
     if (Include_Len == 0)
 	{
 	char *		env_variable;
 
-	if ((env_variable = getenv (INCSTRVAR)) != NULL)
+	if ((env_variable = getenv (INCSTRVAR)) != NULL) {
+            for(pp=env_variable; *pp; pp++) {
+               if((*pp == '\\') && ((pp==env_variable) || !isknj(*(pp-1))))
+                   *pp = '/';
+	    }
 	    Include_File = env_variable;
+	}
 	Include_Len = strlen (Include_File);
 
 	/* initialise the file stack */
