This file contains diffs from version 2.1 of GNU diff to version 2.2
Changes in files that are generated by etags and TeX have been omitted.
NOTE: The file limits.h must be completely removed for correct compilation.
If you use the -E switch to GNU patch, then patch will do this for you.
Otherwise you should make sure the file is removed by doing "rm limits.h".


diff -rcN diff-2.1/ChangeLog diff-2.2/ChangeLog
*** diff-2.1/ChangeLog	Tue Feb  2 00:08:10 1993
--- diff-2.2/ChangeLog	Fri Feb 19 17:39:41 1993
***************
*** 1,3 ****
--- 1,34 ----
+ Fri Feb 19 17:31:32 1993  Roland McGrath  (roland@geech.gnu.ai.mit.edu)
+ 
+ 	* Version 2.2 released.
+ 
+ 	* system.h [HAVE_STRING_H || STDC_HEADERS] (index, rindex): Don't
+ 	define if already defined.
+ 
+ Wed Feb 17 17:08:00 1993  Roland McGrath  (roland@churchy.gnu.ai.mit.edu)
+ 
+ 	* Makefile.in (srcs): Remove limits.h.
+ 
+ Thu Feb 11 03:36:00 1993  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
+ 
+ 	* diff3.c (xmalloc): No longer static.
+ 
+ 	* sdiff.c (edit): Allocate buf dynamically.
+ 
+ 	* dir.c (dir_sort): Handle VOID_CLOSEDIR.
+ 
+ Wed Feb 10 00:15:54 1993  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
+ 
+ 	* limits.h: File deleted (should never have been there). 
+ 
+ Tue Feb  9 03:53:22 1993  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
+ 
+ 	* Makefile.in (.c.o, diff3.o, sdiff.o): Put $(CFLAGS) last.
+ 
+ Wed Feb  3 15:42:10 1993  David J. MacKenzie  (djm@goldman.gnu.ai.mit.edu)
+ 
+ 	* system.h: Don't #define const; let configure do it.
+ 
  Mon Feb  1 02:13:23 1993  Paul Eggert  (eggert@hal.gnu.ai.mit.edu)
  
  	* Version 2.1 released.
diff -rcN diff-2.1/Makefile.in diff-2.2/Makefile.in
*** diff-2.1/Makefile.in	Mon Feb  1 02:13:05 1993
--- diff-2.2/Makefile.in	Fri Feb 19 17:39:37 1993
***************
*** 1,5 ****
  # Makefile for GNU DIFF
! # Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
  #
  # This file is part of GNU DIFF.
  #
--- 1,5 ----
  # Makefile for GNU DIFF
! # Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
  #
  # This file is part of GNU DIFF.
  #
***************
*** 69,75 ****
  
  # The source files for all of the programs.
  srcs=diff.c analyze.c io.c context.c ed.c normal.c ifdef.c util.c dir.c \
! 	version.c diff.h regex.c regex.h side.c system.h limits.h \
  	diff3.c sdiff.c cmp.c error.c xmalloc.c getopt.c getopt1.c getopt.h \
  	fnmatch.c fnmatch.h alloca.c
  # Object files for diff only.
--- 69,75 ----
  
  # The source files for all of the programs.
  srcs=diff.c analyze.c io.c context.c ed.c normal.c ifdef.c util.c dir.c \
! 	version.c diff.h regex.c regex.h side.c system.h \
  	diff3.c sdiff.c cmp.c error.c xmalloc.c getopt.c getopt1.c getopt.h \
  	fnmatch.c fnmatch.h alloca.c
  # Object files for diff only.
***************
*** 83,89 ****
  all: diff diff3 sdiff cmp diff.info
  
  .c.o:
! 	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. $<
  
  diff: $(objs)
  	$(CC) -o $@ $(LDFLAGS) $(objs) $(LIBS)
--- 83,89 ----
  all: diff diff3 sdiff cmp diff.info
  
  .c.o:
! 	$(CC) -c $(DEFS) $(CPPFLAGS) $(CFLAGS) -I. $<
  
  diff: $(objs)
  	$(CC) -o $@ $(LDFLAGS) $(objs) $(LIBS)
***************
*** 107,116 ****
  diff.o fnmatch.o: fnmatch.h
  
  diff3.o: diff3.c
! 	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -DDIFF_PROGRAM=\"$(bindir)/$(binprefix)diff\" $(srcdir)/diff3.c
  
  sdiff.o: sdiff.c
! 	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -DDIFF_PROGRAM=\"$(bindir)/$(binprefix)diff\" $(srcdir)/sdiff.c
  
  TAGS: $(srcs)
  	etags $(srcs)
--- 107,116 ----
  diff.o fnmatch.o: fnmatch.h
  
  diff3.o: diff3.c
! 	$(CC) -c $(DEFS) $(CPPFLAGS) $(CFLAGS) -DDIFF_PROGRAM=\"$(bindir)/$(binprefix)diff\" $(srcdir)/diff3.c
  
  sdiff.o: sdiff.c
! 	$(CC) -c $(DEFS) $(CPPFLAGS) $(CFLAGS) -DDIFF_PROGRAM=\"$(bindir)/$(binprefix)diff\" $(srcdir)/sdiff.c
  
  TAGS: $(srcs)
  	etags $(srcs)
diff -rcN diff-2.1/configure diff-2.2/configure
*** diff-2.1/configure	Mon Feb  1 01:56:47 1993
--- diff-2.2/configure	Wed Feb  3 15:42:57 1993
***************
*** 275,280 ****
--- 275,301 ----
  fi
  rm -f conftest*
  
+ prog='/* Ultrix mips cc rejects this.  */
+ typedef int charset[2]; const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *p;
+ char **p2;
+ /* HPUX 7.0 cc rejects these. */
+ ++p;
+ p2 = (char const* const*) p;'
+ echo checking for working const
+ cat > conftest.c <<EOF
+ 
+ main() { exit(0); } 
+ t() { $prog }
+ EOF
+ if eval $compile; then
+   :
+ else
+   DEFS="$DEFS -Dconst="
+ fi
+ rm -f conftest*
+ 
  echo checking for ANSI C header files
  cat > conftest.c <<EOF
  #include <stdlib.h>
diff -rcN diff-2.1/configure.in diff-2.2/configure.in
*** diff-2.1/configure.in	Fri Dec 18 14:00:56 1992
--- diff-2.2/configure.in	Wed Feb  3 15:42:40 1993
***************
*** 6,11 ****
--- 6,12 ----
  AC_MINIX
  AC_ISC_POSIX
  AC_DIR_HEADER
+ AC_CONST
  AC_STDC_HEADERS
  AC_UNISTD_H
  AC_PID_T
diff -rcN diff-2.1/diff3.c diff-2.2/diff3.c
*** diff-2.1/diff3.c	Thu Nov 12 11:02:18 1992
--- diff-2.2/diff3.c	Thu Feb 11 13:48:31 1993
***************
*** 197,203 ****
  
  static struct diff3_block *reverse_diff3_blocklist ();
  
! static VOID *xmalloc ();
  static VOID *xrealloc ();
  
  static char diff_program[] = DIFF_PROGRAM;
--- 197,203 ----
  
  static struct diff3_block *reverse_diff3_blocklist ();
  
! VOID *xmalloc ();
  static VOID *xrealloc ();
  
  static char diff_program[] = DIFF_PROGRAM;
***************
*** 1638,1644 ****
    return result;
  }
  
! static VOID *
  xmalloc (size)
       unsigned size;
  {
--- 1638,1644 ----
    return result;
  }
  
! VOID *
  xmalloc (size)
       unsigned size;
  {
diff -rcN diff-2.1/dir.c diff-2.2/dir.c
*** diff-2.1/dir.c	Wed Nov 18 15:40:28 1992
--- diff-2.2/dir.c	Thu Feb 11 03:36:08 1993
***************
*** 97,104 ****
--- 97,108 ----
  	  errno = e;
  	  return -1;
  	}
+ #ifdef VOID_CLOSEDIR
+       closedir (reading);
+ #else
        if (closedir (reading) != 0)
  	return -1;
+ #endif
      }
  
    /* Create the `files' table from the `data' table.  */
diff -rcN diff-2.1/limits.h diff-2.2/limits.h
*** diff-2.1/limits.h	Thu Nov 29 16:16:02 1990
--- diff-2.2/limits.h
***************
*** 1,43 ****
- /* Number of bits in a `char'.  */
- #define CHAR_BIT 8
- 
- /* No multibyte characters supported yet.  */
- #define MB_LEN_MAX 1
- 
- /* Minimum and maximum values a `signed char' can hold.  */
- #define SCHAR_MIN (-128)
- #define SCHAR_MAX 127
- 
- /* Maximum value an `unsigned char' can hold.  (Minimum is 0).  */
- #define UCHAR_MAX 255U
- 
- /* Minimum and maximum values a `char' can hold.  */
- #ifdef __CHAR_UNSIGNED__
- #define CHAR_MIN 0
- #define CHAR_MAX 255U
- #else
- #define CHAR_MIN (-128)
- #define CHAR_MAX 127
- #endif
- 
- /* Minimum and maximum values a `signed short int' can hold.  */
- #define SHRT_MIN (-32768)
- #define SHRT_MAX 32767
- 
- /* Maximum value an `unsigned short int' can hold.  (Minimum is 0).  */
- #define USHRT_MAX 65535U
- 
- /* Minimum and maximum values a `signed int' can hold.  */
- #define INT_MIN (-INT_MAX-1)
- #define INT_MAX 2147483647
- 
- /* Maximum value an `unsigned int' can hold.  (Minimum is 0).  */
- #define UINT_MAX 4294967295U
- 
- /* Minimum and maximum values a `signed long int' can hold.
-    (Same as `int').  */
- #define LONG_MIN (-LONG_MAX-1)
- #define LONG_MAX 2147483647
- 
- /* Maximum value an `unsigned long int' can hold.  (Minimum is 0).  */
- #define ULONG_MAX 4294967295U
--- 0 ----
diff -rcN diff-2.1/sdiff.c diff-2.2/sdiff.c
*** diff-2.1/sdiff.c	Sun Nov  8 22:59:56 1992
--- diff-2.2/sdiff.c	Thu Feb 11 03:39:43 1993
***************
*** 856,867 ****
  	    if (fseek (tmp, 0L, SEEK_SET) != 0)
  	      perror_fatal ("fseek");
  	    {
! 	      char buf[SDIFF_BUFSIZE];
  	      size_t size;
  
  	      while ((size = ck_fread (buf, SDIFF_BUFSIZE, tmp)) != 0)
  		ck_fwrite (buf, size, outfile);
  	      ck_fclose (tmp);
  	    }
  	    return 1;
  	  }
--- 856,871 ----
  	    if (fseek (tmp, 0L, SEEK_SET) != 0)
  	      perror_fatal ("fseek");
  	    {
! 	      /* SDIFF_BUFSIZE is too big for a local var
! 		 in some compilers, so we allocate it dynamically.  */
! 	      char *buf = (char *) xmalloc (SDIFF_BUFSIZE);
  	      size_t size;
  
  	      while ((size = ck_fread (buf, SDIFF_BUFSIZE, tmp)) != 0)
  		ck_fwrite (buf, size, outfile);
  	      ck_fclose (tmp);
+ 
+ 	      free (buf);
  	    }
  	    return 1;
  	  }
diff -rcN diff-2.1/system.h diff-2.2/system.h
*** diff-2.1/system.h	Thu Nov 12 11:02:18 1992
--- diff-2.2/system.h	Fri Feb 19 17:32:33 1993
***************
*** 1,5 ****
  /* System dependent declarations.
!    Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.
  
  This file is part of GNU DIFF.
  
--- 1,5 ----
  /* System dependent declarations.
!    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  
  This file is part of GNU DIFF.
  
***************
*** 100,107 ****
--- 100,111 ----
  
  #if HAVE_STRING_H || STDC_HEADERS
  #include <string.h>
+ #ifndef index
  #define index	strchr
+ #endif
+ #ifndef rindex
  #define rindex	strrchr
+ #endif
  #define bcopy(s,d,n)	memcpy (d,s,n)
  #define bcmp(s1,s2,n)	memcmp (s1,s2,n)
  #define bzero(s,n)	memset (s,0,n)
***************
*** 142,148 ****
  #define	FALSE		0
  
  #if !__STDC__
- #define const
  #define volatile
  #endif
  
--- 146,151 ----
diff -rcN diff-2.1/version.c diff-2.2/version.c
*** diff-2.1/version.c	Sat Jan 30 21:38:35 1993
--- diff-2.2/version.c	Fri Feb 19 17:36:24 1993
***************
*** 1,3 ****
  /* Version number of GNU diff.  */
  
! char *version_string = "2.1";
--- 1,3 ----
  /* Version number of GNU diff.  */
  
! char *version_string = "2.2";
