diff -c2 -bBwp -r orig/config.dj ./config.dj
*** orig/config.dj	Tue Sep 26 13:00:40 1995
--- ./config.dj	Sun Sep 24 18:53:24 1995
***************
*** 0 ****
--- 1,2 ----
+ #include <sys/config.h>
+ #include <io.h>
diff -c2 -bBwp -r orig/configur.bat ./configur.bat
*** orig/configur.bat	Tue Sep 26 13:00:40 1995
--- ./configur.bat	Sun Sep 24 18:43:32 1995
***************
*** 0 ****
--- 1,4 ----
+ @echo off
+ echo Configuring for DJGPP...
+ copy makefile.dj makefile > nul
+ copy config.dj config.h > nul
diff -c2 -bBwp -r orig/dfa.c ./dfa.c
*** orig/dfa.c	Sun May 30 23:02:20 1993
--- ./dfa.c	Wed Aug 31 16:08:40 1994
*************** extern void free();
*** 52,55 ****
--- 52,56 ----
  #define ISPUNCT(C) (isascii(C) && ispunct(C))
  #define ISALNUM(C) (isascii(C) && isalnum(C))
+ #define ISLETTER(C) (isascii(C) && (isalnum(C) || (C) == '_'))
  #define ISPRINT(C) (isascii(C) && isprint(C))
  #define ISGRAPH(C) (isascii(C) && isgraph(C))
*************** static struct {
*** 322,337 ****
    int (*pred)();
  } prednames[] = {
!   ":alpha:]", is_alpha,
!   ":upper:]", is_upper,
!   ":lower:]", is_lower,
!   ":digit:]", is_digit,
!   ":xdigit:]", is_xdigit,
!   ":space:]", is_space,
!   ":punct:]", is_punct,
!   ":alnum:]", is_alnum,
!   ":print:]", is_print,
!   ":graph:]", is_graph,
!   ":cntrl:]", is_cntrl,
!   0
  };
  
--- 323,338 ----
    int (*pred)();
  } prednames[] = {
!     { ":alpha:]", is_alpha },
!     { ":upper:]", is_upper },
!     { ":lower:]", is_lower },
!     { ":digit:]", is_digit },
!     { ":xdigit:]", is_xdigit },
!     { ":space:]", is_space },
!     { ":punct:]", is_punct },
!     { ":alnum:]", is_alnum },
!     { ":print:]", is_print },
!     { ":graph:]", is_graph },
!     { ":cntrl:]", is_cntrl },
!     { 0,          0 }
  };
  
*************** lex()
*** 558,562 ****
  	  zeroset(ccl);
  	  for (c2 = 0; c2 < NOTCHAR; ++c2)
! 	    if (ISALNUM(c2))
  	      setbit(c2, ccl);
  	  if (c == 'W')
--- 559,563 ----
  	  zeroset(ccl);
  	  for (c2 = 0; c2 < NOTCHAR; ++c2)
! 	    if (ISLETTER(c2))
  	      setbit(c2, ccl);
  	  if (c == 'W')
*************** atom()
*** 768,771 ****
--- 769,773 ----
  static int
  nsubtoks(tindex)
+     int tindex;
  {
    int ntoks1;
*************** dfastate(s, d, trans)
*** 1468,1472 ****
        initialized = 1;
        for (i = 0; i < NOTCHAR; ++i)
! 	if (ISALNUM(i))
  	  setbit(i, letters);
        setbit('\n', newline);
--- 1470,1474 ----
        initialized = 1;
        for (i = 0; i < NOTCHAR; ++i)
! 	if (ISLETTER(i))
  	  setbit(i, letters);
        setbit('\n', newline);
*************** dfastate(s, d, trans)
*** 1603,1607 ****
  	if (i == '\n')
  	  trans[i] = state_newline;
! 	else if (ISALNUM(i))
  	  trans[i] = state_letter;
  	else
--- 1605,1609 ----
  	if (i == '\n')
  	  trans[i] = state_newline;
! 	else if (ISLETTER(i))
  	  trans[i] = state_letter;
  	else
*************** dfastate(s, d, trans)
*** 1664,1668 ****
  	      if (c == '\n')
  		trans[c] = state_newline;
! 	      else if (ISALNUM(c))
  		trans[c] = state_letter;
  	      else if (c < NOTCHAR)
--- 1666,1670 ----
  	      if (c == '\n')
  		trans[c] = state_newline;
! 	      else if (ISLETTER(c))
  		trans[c] = state_letter;
  	      else if (c < NOTCHAR)
*************** dfaexec(d, begin, end, newline, count, b
*** 1813,1817 ****
  	if (i == '\n')
  	  sbit[i] = 4;
! 	else if (ISALNUM(i))
  	  sbit[i] = 2;
  	else
--- 1815,1819 ----
  	if (i == '\n')
  	  sbit[i] = 4;
! 	else if (ISLETTER(i))
  	  sbit[i] = 2;
  	else
diff -c2 -bBwp -r orig/dosbuf.c ./dosbuf.c
*** orig/dosbuf.c	Tue Sep 26 13:00:40 1995
--- ./dosbuf.c	Tue Sep 26 12:55:20 1995
***************
*** 0 ****
--- 1,179 ----
+ /* Messy DOS-specific code for correctly treating binary, Unix text
+    and DOS text files.
+ 
+    This has several aspects:
+ 
+      * Guessing the file type (unless the user tells us);
+      * Stripping CR characters from DOS text files (otherwise regex
+        functions won't work correctly);
+      * Reporting correct byte count with -b for any kind of file.
+ 
+ */
+ 
+ typedef enum {
+   UNKNOWN, DOS_BINARY, DOS_TEXT, UNIX_TEXT
+ } File_type;
+ 
+ struct _dos_map {
+   size_t pos;       /* position in buffer passed to matcher */
+   int    add;       /* how much to add when reporting char position */
+ };
+ 
+ static int       dos_report_unix_offset = 0;
+ 
+ static File_type dos_file_type     = UNKNOWN;
+ static File_type dos_use_file_type = UNKNOWN;
+ static size_t    dos_stripped_crs  = 0;
+ static struct _dos_map *dos_pos_map;
+ static int       dos_pos_map_size  = 0;
+ static int       dos_pos_map_used  = 0;
+ static int       inp_map_idx = 0, out_map_idx = 1;
+ 
+ /* Guess DOS file type by looking at its contents.  */
+ static INLINE File_type
+ guess_type(char *buf, register size_t buflen)
+ {
+   int crlf_seen = 0;
+   /* Use unsigned char, so this will work with foreign characters.  */
+   register unsigned char *bp = buf;
+ 
+   while (buflen--)
+     {
+       /* Binary files have characters with ASCII code less then 32 decimal,
+          unless they are one of: BS (for man pages), TAB, LF, FF, CR, ^Z. */
+       if (*bp  < ' '  && !(*bp > '\a' && *bp <= '\n') &&
+           *bp != '\f' &&   *bp != '\r' && *bp != '\32')
+         return DOS_BINARY;
+ 
+       /* CR before LF means DOS text file (unless we later see
+          binary characters).  */
+       else if (*bp == '\r' && bp[1] == '\n')
+         crlf_seen++;
+ 
+       bp++;
+     }
+ 
+   return crlf_seen ? DOS_TEXT : UNIX_TEXT;
+ }
+ 
+ /* Convert external DOS file representation to internal.
+    Return the count of characters left in the buffer.
+    Build table to map character position when reporting byte counts.  */
+ static INLINE int
+ undossify_input(register char *buf, size_t buflen)
+ {
+   int chars_left = 0;
+ 
+   if (totalcc == 0)
+     {
+       /* New file: forget everything we knew about character
+          position mapping table and file type.  */
+       inp_map_idx = 0;
+       out_map_idx = 1;
+       dos_pos_map_used = 0;
+       dos_stripped_crs = 0;
+       dos_file_type = dos_use_file_type;
+     }
+ 
+   /* Guess if this file is binary, unless we already know that.  */
+   if (dos_file_type == UNKNOWN)
+     dos_file_type = guess_type(buf, buflen);
+ 
+   /* If this file is to be treated as DOS Text, strip the CR characters
+      and maybe build the table for character position mapping on output.  */
+   if (dos_file_type == DOS_TEXT)
+     {
+       char   *destp   = buf;
+ 
+       while (buflen--)
+         {
+           if (*buf != '\r')
+             {
+               *destp++ = *buf++;
+               chars_left++;
+             }
+           else
+             {
+               buf++;
+               if (out_byte && !dos_report_unix_offset)
+                 {
+                   dos_stripped_crs++;
+                   while (buflen && *buf == '\r')
+                     {
+                       dos_stripped_crs++;
+                       buflen--;
+                       buf++;
+                     }
+                   if (inp_map_idx >= dos_pos_map_size - 1)
+                     {
+                       dos_pos_map_size = inp_map_idx ? inp_map_idx * 2 : 1000;
+                       dos_pos_map =
+                         (struct _dos_map *)xrealloc(dos_pos_map,
+                                                     dos_pos_map_size *
+                                                     sizeof(struct _dos_map));
+                     }
+ 
+                   if (!inp_map_idx)
+                     {
+                       /* Add sentinel entry.  */
+                       dos_pos_map[inp_map_idx].pos = 0;
+                       dos_pos_map[inp_map_idx++].add = 0;
+ 
+                       /* Initialize first real entry.  */
+                       dos_pos_map[inp_map_idx].add = 0;
+                     }
+ 
+                   /* Put the new entry.  If the stripped CR characters
+                      preceed a Newline (the usual case), pretend that
+                      they were found *after* the Newline.  This makes
+                      displayed byte offsets more reasonable in some
+                      cases, and fits better the intuitive notion that
+                      the line ends *before* the CR, not *after* it.  */
+                   inp_map_idx++;
+                   dos_pos_map[inp_map_idx-1].pos =
+                     (*buf == '\n' ? destp + 1 : destp ) - bufbeg + totalcc;
+                   dos_pos_map[inp_map_idx].add = dos_stripped_crs;
+                   dos_pos_map_used = inp_map_idx;
+ 
+                   /* The following will be updated on the next pass.  */
+                   dos_pos_map[inp_map_idx].pos = destp - bufbeg + totalcc + 1;
+                 }
+             }
+         }
+ 
+       return chars_left;
+     }
+ 
+   return buflen;
+ }
+ 
+ /* Convert internal byte count into external.  */
+ static INLINE size_t
+ dossified_pos(size_t byteno)
+ {
+   size_t pos_lo;
+   size_t pos_hi;
+ 
+   if (dos_file_type != DOS_TEXT || dos_report_unix_offset)
+     return byteno;
+ 
+   pos_lo = dos_pos_map[out_map_idx-1].pos;
+   pos_hi = dos_pos_map[out_map_idx].pos;
+ 
+   if (byteno >= pos_hi)
+     {
+       out_map_idx++;
+       while (out_map_idx < dos_pos_map_used &&
+              byteno >= dos_pos_map[out_map_idx].pos)
+         out_map_idx++;
+     }
+ 
+   else if (byteno < pos_lo)
+     {
+       out_map_idx--;
+       while (out_map_idx > 1 && byteno < dos_pos_map[out_map_idx-1].pos)
+         out_map_idx--;
+     }
+ 
+   return byteno + dos_pos_map[out_map_idx].add;
+ }
diff -c2 -bBwp -r orig/grep.c ./grep.c
*** orig/grep.c	Sun May 23 05:52:52 1993
--- ./grep.c	Tue Sep 26 12:07:08 1995
***************
*** 18,23 ****
     Written July 1992 by Mike Haertel.  */
  
- #include <errno.h>
  #include <stdio.h>
  
  #ifndef errno
--- 18,31 ----
     Written July 1992 by Mike Haertel.  */
  
  #include <stdio.h>
+ #include <errno.h>
+ 
+ #ifdef  __GNUC__
+ #define __GNU_LIBRARY__
+ #endif
+ 
+ #include "config.h"
+ 
+ #include "getopt.h"
  
  #ifndef errno
*************** reset(fd)
*** 236,239 ****
--- 244,265 ----
  }
  
+ #ifdef  __MSDOS__
+ 
+ /* Sigh...  I wanted to make source-level changes to the original
+    files minimal, but the arrangement of the functions and static
+    variables' declarations is such that I cannot #include dosbuf.c
+    here (it uses some variables declared only later), and I must
+    have the prototype of undossify_input() here, lest gcc -Wall
+    complains about it being implicitly declared.  */
+ #ifdef  __GNUC__
+ #define INLINE  __inline__
+ #else
+ #define INLINE
+ #endif
+ 
+ static INLINE int undossify_input(char *, size_t);
+ 
+ #endif
+ 
  /* Read new stuff into the buffer, saving the specified
     amount of old stuff.  When we're done, 'bufbeg' points
*************** fillbuf(save)
*** 314,317 ****
--- 340,347 ----
  #else
    cc = read(bufdesc, buffer + bufsalloc, bufalloc - bufsalloc);
+ #ifdef  __MSDOS__
+   if (cc > 0)
+     cc = undossify_input(buffer + bufsalloc, cc);
+ #endif  /* __MSDOS__ */
  #endif
    if (cc > 0)
*************** static size_t totalnl;		/* Total newline
*** 340,343 ****
--- 370,377 ----
  static int pending;             /* Pending lines of output. */
  
+ #ifdef  __MSDOS__
+ #include "dosbuf.c"
+ #endif
+ 
  static void
  nlscan(lim)
*************** prline(beg, lim, sep)
*** 363,371 ****
      {
        nlscan(beg);
!       printf("%d%c", ++totalnl, sep);
        lastnl = lim;
      }
    if (out_byte)
      printf("%lu%c", totalcc + (beg - bufbeg), sep);
    fwrite(beg, 1, lim - beg, stdout);
    if (ferror(stdout))
--- 397,409 ----
      {
        nlscan(beg);
!       printf("%ld%c", ++totalnl, sep);
        lastnl = lim;
      }
    if (out_byte)
+ #ifdef  __MSDOS__
+     printf("%lu%c", dossified_pos(totalcc + (beg - bufbeg)), sep);
+ #else
      printf("%lu%c", totalcc + (beg - bufbeg), sep);
+ #endif
    fwrite(beg, 1, lim - beg, stdout);
    if (ferror(stdout))
*************** grep(fd)
*** 566,571 ****
--- 604,614 ----
  static char version[] = "GNU grep version 2.0";
  
+ #ifdef  __MSDOS__
+ #define USAGE \
+   "usage: %s [-[[AB] ]<num>] [-[CEFGVchilnqsvwxUu]] [-[ef]] <expr> [<files...>]\n"
+ #else
  #define USAGE \
    "usage: %s [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr> [<files...>]\n"
+ #endif
  
  static void
*************** main(argc, argv)
*** 610,613 ****
--- 653,660 ----
    if (prog && strrchr(prog, '/'))
      prog = strrchr(prog, '/') + 1;
+ #ifdef  __MSDOS__
+   if (prog && strrchr(prog, '.'))
+     *strrchr(prog, '.') = '\0';
+ #endif
  
    keys = NULL;
*************** main(argc, argv)
*** 620,625 ****
--- 667,677 ----
    matcher = NULL;
  
+ #ifdef  __MSDOS__
+   while ((opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxyUu"))
+ 	 != EOF)
+ #else
    while ((opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxy"))
  	 != EOF)
+ #endif
      switch (opt)
        {
*************** main(argc, argv)
*** 665,668 ****
--- 717,728 ----
  	matcher = "grep";
  	break;
+ #ifdef  __MSDOS__
+       case 'U':
+         dos_use_file_type = DOS_BINARY;
+         break;
+       case 'u':
+         dos_report_unix_offset = 1;
+         break;
+ #endif
        case 'V':
  	fprintf(stderr, "%s\n", version);
*************** main(argc, argv)
*** 786,789 ****
--- 846,853 ----
  	else
  	  {
+ #ifdef  __MSDOS__
+             /* This allows to grep through binary files, even from a pipe. */
+             setmode(desc, O_BINARY);
+ #endif
  	    filename = desc == 0 ? "(standard input)" : argv[optind];
  	    count = grep(desc);
*************** main(argc, argv)
*** 810,813 ****
--- 874,880 ----
      {
        filename = "(standard input)";
+ #ifdef  __MSDOS__
+       setmode(0, O_BINARY);
+ #endif
        count = grep(0);
        if (count_matches)
diff -c2 -bBwp -r orig/grep.man ./grep.man
*** orig/grep.man	Fri Oct 16 19:08:16 1992
--- ./grep.man	Mon Sep 25 19:39:54 1995
*************** grep, egrep, fgrep \- print lines matchi
*** 9,13 ****
  ]
  [
! .BR \- [ CEFGVBchilnsvwx ]
  ]
  [
--- 9,13 ----
  ]
  [
! .BR \- [ CEFGVchilnqsvwxUu ]
  ]
  [
*************** are available.
*** 63,72 ****
  .B Egrep
  is similiar (but not identical) to
! .BR "grep\ \-E" ,
  and is compatible with the historical Unix
  .BR egrep .
  .B Fgrep
  is the same as
! .BR "grep\ \-F" .
  .PD
  .LP
--- 63,72 ----
  .B Egrep
  is similiar (but not identical) to
! .BR "grep \-E" ,
  and is compatible with the historical Unix
  .BR egrep .
  .B Fgrep
  is the same as
! .BR "grep \-F" .
  .PD
  .LP
*************** characters are letters, digits, and the 
*** 166,169 ****
--- 166,201 ----
  .B \-x
  Select only those matches that exactly match the whole line.
+ .TP
+ .B \-U
+ Treat the file(s) as binary.  By default, under MS-DOS,
+ .BR grep
+ guesses the file type by looking at the contents of the first 32KB
+ read from the file.  If
+ .BR grep
+ decides the file is DOS text file, it strips the CR characters from the
+ original file contents (to make regular expressions with
+ .B ^
+ and
+ .B $
+ work correctly), but the byte offsets under the
+ .B \-b
+ option are by default reported as true byte offsets into the original
+ file, unless
+ .B \-u
+ option is in effect (see below).  Specifying
+ .B \-U
+ overrules this guesswork, causing all files to be read and passed to the
+ matching mechanism verbatim; if the file is DOS text file, this will
+ cause some regular expressions to fail.
+ .TP
+ .B \-u
+ Report Unix-style byte offsets.  This switch causes
+ .B grep
+ to report byte offsets as if the file were Unix-style text file, i.e. with
+ CR characters stripped off.  This will produce results identical to running
+ .B grep
+ on a Unix machine.  This option has no effect unless
+ .B \-b
+ is also given.
  .PD
  .SH "REGULAR EXPRESSIONS"
*************** expressions, by using various operators 
*** 176,180 ****
  understands two different versions of regular expression syntax:
  ``basic'' and ``extended.''  In
! .RB "GNU\ " grep ,
  there is no difference in available functionality using either syntax.
  In other implementations, basic regular expressions are less powerful.
--- 208,212 ----
  understands two different versions of regular expression syntax:
  ``basic'' and ``extended.''  In
! .RB "GNU " grep ,
  there is no difference in available functionality using either syntax.
  In other implementations, basic regular expressions are less powerful.
diff -c2 -bBwp -r orig/makefile.dj ./makefile.dj
*** orig/makefile.dj	Tue Sep 26 13:00:40 1995
--- ./makefile.dj	Mon Sep 25 17:19:38 1995
***************
*** 0 ****
--- 1,126 ----
+ # Makefile for GNU grep
+ # Copyright (C) 1992 Free Software Foundation, Inc.
+ 
+ # This Makefile is for DJGPP v2.0
+ 
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ 
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ 
+ # You should have received a copy of the GNU General Public License
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+ # SHELL = /bin/sh
+ 
+ #### Start of system configuration section. ####
+ 
+ srcdir=.
+ VPATH=.
+ 
+ AWK=gawk
+ INSTALL=xcopy
+ INSTALL_PROGRAM=$(INSTALL)
+ INSTALL_DATA=$(INSTALL)
+ 
+ CC=gcc
+ LINT=lint
+ 
+ DEFS=-DGREP -DHAVE_CONFIG_H
+ 
+ # Extra libraries.
+ LIBS=
+ ALLOCA=
+ 
+ CFLAGS=-O3 -Wall -g
+ LDFLAGS=-s
+ 
+ prefix=c:/djgpp
+ exec_prefix=$(prefix)
+ 
+ # Prefix for installed program, normally empty or `g'.
+ binprefix=
+ # Prefix for installed man page, normally empty or `g'.
+ manprefix=
+ 
+ # Where to install executables.
+ bindir=$(exec_prefix)/bin
+ 
+ # Where to install man pages.
+ mandir=$(prefix)/man/man1
+ 
+ # Extension for man pages.
+ manext=1
+ 
+ # How to make a hard link.
+ LN=lns.bat
+ 
+ #### End of system configuration section. ####
+ 
+ SRCS=grep.c getopt.c regex.c dfa.c kwset.c obstack.c search.c
+ OBJS=grep.o getopt.o regex.o dfa.o kwset.o obstack.o search.o
+ 
+ .c.o:
+ 	$(CC) $(CFLAGS) $(DEFS) -I$(srcdir) -c $<
+ 
+ all: grep check
+ 
+ # For Saber C.
+ grep.load: $(SRCS)
+ 	#load $(CFLAGS) $(DEFS) -I$(srcdir) (SRCS)
+ 
+ # For Lint.
+ grep.lint: $(SRCS)
+ 	$(LINT) $(CFLAGS) $(DEFS) -I$(srcdir) $(SRCS)
+ 
+ install: all
+ 	$(LN) grep egrep
+ 	$(LN) grep fgrep
+ 	for %%p in (grep.exe egrep.exe fgrep.exe) do $(INSTALL_PROGRAM) %%p $(bindir)\$(binprefix)
+ 	copy $(srcdir)\grep.man $(srcdir)\grep.$(manext)
+ 	$(INSTALL_DATA) $(srcdir)\grep.$(manext) $(mandir)
+ 
+ check: check.done
+ 
+ check.done: grep
+ 	grep -E -f tests/khadafy.reg tests/khadafy.lin > khadafy.out
+ 	cmp tests/khadafy.lin khadafy.out
+ 	$(AWK) -F: -f tests/scriptge.dos tests/spencer.tes > script.bat
+ 	script.bat
+ 	touch check.done
+ 
+ grep: $(OBJS) $(LIBOBJS) $(ALLOCA)
+ 	$(CC) $(LDFLAGS) -o grep $(OBJS) $(LIBOBJS) $(LIBS) $(ALLOCA)
+ 
+ clean:
+ 	for %%f in (grep *.o *.exe check.don script.bat khadafy.out) do del %%f
+ 
+ mostlyclean: clean
+ 
+ distclean: clean
+ 	if exist Makefile del Makefile
+ 	if exist config.h del config.h
+ 
+ realclean: distclean
+ 	del TAGS
+ 
+ grep.ii: grep.c
+ 	$(CC) $(CFLAGS) $(DEFS) -I$(srcdir) -E -c $< -o grep.ii
+ 
+ Makefile: $(srcdir)/Makefile.dj
+ 	copy Makefile.dj Makefile
+ 
+ # Some header file dependencies that really ought to be automatically deduced.
+ grep.o: dosbuf.c
+ dfa.o search.o: dfa.h
+ grep.o search.o: grep.h
+ kwset.o search.o: kwset.h
+ kwset.o obstack.o: obstack.h
+ regex.o search.o: regex.h
+ grep.o regex.o search.o getopt.o alloca.o: config.h
diff -c2 -bBwp -r orig/readme.dj ./readme.dj
*** orig/readme.dj	Tue Sep 26 13:00:40 1995
--- ./readme.dj	Tue Sep 26 13:15:48 1995
***************
*** 0 ****
--- 1,59 ----
+ This is GNU Grep 2.0 ported to DJGPP 2.0
+ 
+ The package was actually almost 100% functional under MS-DOS right out of
+ the box, but several changes were nevertheless introduced to make it more
+ capable in the MS-DOS environment (isn't this unnecessary hacking *the*
+ taste of life??):
+ 
+   1. One change was necessary to make GREP correctly deduce the type
+      of matcher from the name it was invoked with.  The ".exe"
+      extension has to be removed from argv[0] for this to work.
+ 
+   2. A bug reported to gnu by one of the users about word matches not
+      considering `_' to be a word character was corrected.
+ 
+   3. This ported version reads its input in BINARY mode, so it can
+      also be used for searching binary files (ala STRINGS).  However,
+      you would be better off to use -l switch when searching binaries,
+      lest your screen is filled with garbage.
+ 
+   4. Special code was introduced to correctly report byte offsets in both
+      binary and text files.  This code recognizes the file type by looking
+      at the contents of its first 32KB, and if the file is a DOS text
+      file, it memorizes the positions of stripped CR characters and uses
+      this information when reporting byte offsets.  (The CR characters
+      have to be stripped from text files, or else regular expressions
+      which refer to beginning or end of the line won't work.)  Files which
+      are recognized as binary are left intact, i.e. their contents aren't
+      stripped from the CR characters.  Two special options, -U and -u,
+      were added to allow further control over this feature; see the man
+      page for details.
+ 
+   5. Several minor changes were done merely to shut off gcc -Wall.
+ 
+   6. The file CONFIG.H is now #include'd by several source files, to
+      minimize the amount of -D.... switches passed to the compiler.
+ 
+   7. For the regression test to work under plain COMMAND.COM, the test
+      scripts had to be extensively rewritten.  You'll need a version of
+      GNU Awk or any other Awk port to run the tests.  COMMAND.COM cannot
+      redirect standard error of its children, so some error messages will
+      be seen during the test (some tests were deliberately designed to
+      fail).  Only `Spencer test #N failed' messages are real failures,
+      others should be ignored.
+ 
+ The file DIFFS shows exactly what I've changed and/or added in the source
+ files.  The ORIG/ directory holds the original versions of the changed
+ files, if they existed.  The file GREP.1 is a formatted man page for GNU
+ Grep programs; it was produced by CAWF.
+ 
+ If you want to recompile the package, run the CONFIGURE.BAT batch file,
+ then run Make.  I include here the LNS.BAT batch file which I use to make
+ ``symbolic links'' to programs under DJGPP.  It is used by the Makefile
+ when you say ``make install''.
+ 
+ Please bring any problems in the DOS version to my attention, especially
+ if they have something to do with the changes I introduced.
+ 
+ Enjoy,
+ 				Eli Zaretskii <eliz@is.elta.co.il>
diff -c2 -bBwp -r orig/search.c ./search.c
*** orig/search.c	Sun May  2 21:02:00 1993
--- ./search.c	Wed Aug 31 16:07:36 1994
***************
*** 18,21 ****
--- 18,23 ----
     Written August 1992 by Mike Haertel. */
  
+ #include "config.h"
+ 
  #include <ctype.h>
  
