home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-25 | 50.4 KB | 1,728 lines |
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!utgpu!attcan!sobeco!philmtl!altitude!matrox!IRO.UMontreal.CA!pinard
- From: pinard@IRO.UMontreal.CA (Francois Pinard)
- Newsgroups: alt.sources
- Subject: wdiff - Patch 4, Part (2/3) - brings 0.03 to 0.04
- Message-ID: <PINARD.92Dec24003610@kovic.IRO.UMontreal.CA>
- Date: 24 Dec 92 05:36:10 GMT
- Sender: news@IRO.UMontreal.CA
- Distribution: alt
- Organization: Universite' de Montre'al
- Lines: 1716
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is x.02 (part 2 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file Patch4 continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping Patch4'
- else
- echo 'x - continuing file Patch4'
- sed 's/^X//' << 'SHAR_EOF' >> 'Patch4' &&
- X- saveifs="$IFS"; IFS="${IFS}:"
- X- for dir in $PATH; do
- X- test -z "$dir" && dir=.
- X- if test -f $dir/flex; then
- X- LEX="flex"
- X- break
- X- fi
- X- done
- X- IFS="$saveifs"
- X-fi
- X-test -z "$LEX" && LEX="lex"
- X-
- X-if test -z "$LEXLIB"
- X-then
- X- case "$LEX" in
- X- flex*)
- X- if test -r /usr/local/lib/libfl.a
- X- then LEXLIB=/usr/local/lib/libfl.a
- X- elif test -r ${prefix}/lib/libfl.a
- X- then LEXLIB=${prefix}/lib/libfl.a
- X- else LEXLIB="-lfl"
- X- fi
- X- ;;
- X- *) LEXLIB="-ll" ;;
- X- esac
- X-fi
- X # Make sure to not get the incompatible SysV /etc/install and
- X # /usr/sbin/install, which might be in PATH before a BSD-like install,
- X-# or the SunOS /usr/etc/install directory.
- X+# or the SunOS /usr/etc/install directory, or the AIX /bin/install.
- X if test -z "$INSTALL"; then
- X echo checking for install
- X saveifs="$IFS"; IFS="${IFS}:"
- X@@ -163,10 +141,14 @@
- X /etc|/usr/sbin|/usr/etc) ;;
- X *)
- X if test -f $dir/install; then
- X- INSTALL="$dir/install -c"
- X- INSTALL_PROGRAM='$(INSTALL)'
- X- INSTALL_DATA='$(INSTALL) -m 644'
- X- break
- X+ if grep dspmsg $dir/install >/dev/null 2>&1; then
- X+ : AIX
- X+ else
- X+ INSTALL="$dir/install -c"
- X+ INSTALL_PROGRAM='$(INSTALL)'
- X+ INSTALL_DATA='$(INSTALL) -m 644'
- X+ break
- X+ fi
- X fi
- X ;;
- X esac
- X@@ -177,7 +159,7 @@
- X INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
- X INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
- X
- X-for p in gdiff diff
- X+for p in gnudiff diffgnu gdiff
- X do
- X if test -z "$DIFF"; then
- X echo checking for $p
- X@@ -196,10 +178,11 @@
- X test -n "$DIFF" && break
- X done
- X
- X-if test -z "$DIFF"; then
- X- echo "No diff program found. Cannot continue."
- X- exit 1
- X+if test "$DIFF" = gdiff; then
- X+ # Carefully avoid gdiff for X as found on SGI systems.
- X+ DISPLAY= gdiff /dev/null /dev/null > /dev/null 2>&1 || DIFF=
- X fi
- X+test -n "$DIFF" || DIFF=diff
- X for p in less more
- X do
- X if test -z "$PAGER"; then
- X@@ -256,18 +239,60 @@
- X LIBS="$LIBS -ltermcap"
- X fi
- X
- X-echo checking if __STDC__ defined
- X+echo checking for malloc library
- X+# Irix requires -lmalloc for some unknown reason.
- X+if test -r /usr/lib/libmalloc.a; then
- X+ LIBS="$LIBS -lmalloc"
- X+fi
- X+
- X+echo checking for POSIXized ISC
- X+if test -d /etc/conf/kconfig.d &&
- X+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
- X+then
- X+ ISC=1 # If later tests want to check for ISC.
- X+ DEFS="$DEFS -D_POSIX_SOURCE=1"
- X+ if test -n "$GCC"; then
- X+ CC="$CC -posix"
- X+ else
- X+ CC="$CC -Xp"
- X+ fi
- X+fi
- X+
- X+echo checking for working const
- X+echo "
- X+main() { exit(0); } t() { /* Ultrix mips cc rejects this. */
- X+typedef int charset[2]; const charset x;
- X+/* SunOS 4.1.1 cc rejects this. */
- X+char const *const *p;
- X+char **p2;
- X+/* HPUX 7.0 cc rejects these. */
- X+++p;
- X+p2 = (char const* const*) p;
- X+ }" > conftest.c
- X+if eval $compile; then
- X+ :
- X+else
- X+ DEFS="$DEFS -Dconst="
- X+fi
- X+rm -f conftest*
- X+
- X+echo checking for ANSI prototypes
- X cat <<EOF > conftest.c
- X
- X #ifdef __STDC__
- X-#include <nonexistent.h>
- X+ yes
- X #endif
- X+
- X EOF
- X-err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
- X-if test -z "$err"; then
- X+eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
- X+if egrep "yes" conftest.out >/dev/null 2>&1; then
- X+ :
- X+else
- X U=_
- X fi
- X rm -f conftest*
- X+
- X+
- X echo checking for ANSI C header files
- X cat <<EOF > conftest.c
- X
- X@@ -274,6 +299,7 @@
- X #include <stdlib.h>
- X #include <stdarg.h>
- X #include <string.h>
- X+#include <float.h>
- X #include <limits.h>
- X EOF
- X err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
- X@@ -282,7 +308,18 @@
- X fi
- X rm -f conftest*
- X
- X-for hdr in termcap.h
- X+echo checking for unistd.h
- X+cat <<EOF > conftest.c
- X+
- X+#include <unistd.h>
- X+EOF
- X+err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
- X+if test -z "$err"; then
- X+ DEFS="$DEFS -DHAVE_UNISTD_H=1"
- X+fi
- X+rm -f conftest*
- X+
- X+for hdr in string.h termcap.h
- X do
- X trfrom='[a-z]./' trto='[A-Z]__'
- X echo checking for $hdr
- X@@ -297,18 +334,7 @@
- X rm -f conftest*
- X done
- X
- X-echo checking for working const
- X-echo "
- X-main() { exit(0); } t() { /* Ultrix mips cc rejects this. */
- X-typedef int charset[2]; const charset x;
- X- }" > conftest.c
- X-if eval $compile; then
- X- :
- X-else
- X- DEFS="$DEFS -Dconst="
- X-fi
- X-rm -f conftest*
- X-
- X+echo checking return type of signal handlers
- X echo '#include <signal.h>' > conftest.c
- X eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
- X if egrep "(void|sighandler_t).*signal" conftest.out >/dev/null 2>&1; then
- X@@ -349,13 +375,12 @@
- X
- X done
- X
- X-echo checking for alloca.h
- X-cat <<EOF > conftest.c
- X-
- X-#include <alloca.h>
- X-EOF
- X-err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
- X-if test -z "$err"; then
- X+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
- X+# for constant arguments. Useless!
- X+echo checking for working alloca.h
- X+echo "#include <alloca.h>
- X+main() { exit(0); } t() { char *p = alloca(2 * sizeof(int)); }" > conftest.c
- X+if eval $compile; then
- X DEFS="$DEFS -DHAVE_ALLOCA_H=1"
- X fi
- X rm -f conftest*
- X@@ -412,23 +437,13 @@
- X fi
- X fi
- X
- X-echo checking for BSD string and memory functions
- X-echo "#include <strings.h>
- X-main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
- X-if eval $compile; then
- X- :
- X-else
- X- DEFS="$DEFS -DUSG=1"
- X-fi
- X-rm -f conftest*
- X-
- X if test -n "$prefix"; then
- X test -z "$exec_prefix" && exec_prefix='$(prefix)'
- X- prsub="s,^prefix[ ]*=.*$,prefix = $prefix,"
- X+ prsub="s%^prefix[ ]*=.*$%prefix = $prefix%"
- X fi
- X if test -n "$exec_prefix"; then
- X prsub="$prsub
- X-s,^exec_prefix[ ]*=.*$,exec_prefix = $exec_prefix,"
- X+s%^exec_prefix[ ]*=.*$%exec_prefix = $exec_prefix%"
- X fi
- X
- X trap 'rm -f config.status; exit 1' 1 3 15
- X@@ -438,7 +453,9 @@
- X #!/bin/sh
- X # Generated automatically by configure.
- X # Run this file to recreate the current configuration.
- X-# This directory was configured as follows:
- X+# This directory was configured as follows,
- X+# on host `(hostname || uname -n) 2>/dev/null`:
- X+#
- X # $0 $*
- X
- X case "\$1" in
- X@@ -448,8 +465,6 @@
- X
- X trap 'rm -f Makefile; exit 1' 1 3 15
- X CC='$CC'
- X-LEX='$LEX'
- X-LEXLIB='$LEXLIB'
- X INSTALL='$INSTALL'
- X INSTALL_PROGRAM='$INSTALL_PROGRAM'
- X INSTALL_DATA='$INSTALL_DATA'
- X@@ -472,7 +487,7 @@
- X for file in Makefile; do
- X srcdir=$top_srcdir
- X # Remove last slash and all that follows it. Not all systems have dirname.
- X- dir=`echo $file|sed 's,/[^/][^/]*$,,'`
- X+ dir=`echo $file|sed 's%/[^/][^/]*$%%'`
- X if test "$dir" != "$file"; then
- X test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
- X test ! -d $dir && mkdir $dir
- X@@ -482,21 +497,19 @@
- X echo "# Generated automatically from `basename $file`.in by configure." > $file
- X sed -e "
- X $prsub
- X-s,@CC@,$CC,
- X-s,@LEX@,$LEX,
- X-s,@LEXLIB@,$LEXLIB,
- X-s,@INSTALL@,$INSTALL,
- X-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,
- X-s,@INSTALL_DATA@,$INSTALL_DATA,
- X-s,@DIFF@,$DIFF,
- X-s,@PAGER@,$PAGER,
- X-s,@CPP@,$CPP,
- X-s,@U@,$U,
- X-s,@LIBOBJS@,$LIBOBJS,
- X-s,@ALLOCA@,$ALLOCA,
- X-s,@LIBS@,$LIBS,
- X-s,@srcdir@,$srcdir,
- X-s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
- X+s%@CC@%$CC%g
- X+s%@INSTALL@%$INSTALL%g
- X+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
- X+s%@INSTALL_DATA@%$INSTALL_DATA%g
- X+s%@DIFF@%$DIFF%g
- X+s%@PAGER@%$PAGER%g
- X+s%@CPP@%$CPP%g
- X+s%@U@%$U%g
- X+s%@LIBOBJS@%$LIBOBJS%g
- X+s%@ALLOCA@%$ALLOCA%g
- X+s%@LIBS@%$LIBS%g
- X+s%@srcdir@%$srcdir%g
- X+s%@DEFS@%$DEFS%" $top_srcdir/${file}.in >> $file
- X done
- X
- X EOF
- X--- wdiff-0.03/configure.in Tue Aug 18 04:24:43 1992
- X+++ wdiff-0.04/configure.in Wed Dec 23 20:53:57 1992
- X@@ -1,21 +1,14 @@
- X dnl Process this file with autoconf to produce a configure script.
- X dnl
- X-define(FP_STDC_CHECK,
- X-[echo checking if __STDC__ defined
- X-AC_TEST_CPP([#ifdef __STDC__
- X-#include <nonexistent.h>
- X-#endif], [U=_])AC_SUBST(U)])
- X-dnl
- X-dnl
- X AC_INIT(wdiff.c)
- X AC_PROG_CC
- X-AC_PROG_LEX
- X AC_PROG_INSTALL
- X-AC_PROGRAMS_CHECK(DIFF, gdiff diff)
- X-if test -z "$DIFF"; then
- X- echo "No diff program found. Cannot continue."
- X- exit 1
- X+AC_PROGRAMS_CHECK(DIFF, gnudiff diffgnu gdiff)
- X+if test "$DIFF" = gdiff; then
- X+ # Carefully avoid gdiff for X as found on SGI systems.
- X+ DISPLAY= gdiff /dev/null /dev/null > /dev/null 2>&1 || DIFF=
- X fi
- X+test -n "$DIFF" || DIFF=diff
- X AC_PROGRAMS_CHECK(PAGER, less more)
- X
- X echo checking for Xenix
- X@@ -30,13 +23,20 @@
- X LIBS="$LIBS -ltermcap"
- X fi
- X
- X-FP_STDC_CHECK
- X-AC_STDC_HEADERS
- X-AC_HAVE_HEADERS(termcap.h)
- X+echo checking for malloc library
- X+# Irix requires -lmalloc for some unknown reason.
- X+if test -r /usr/lib/libmalloc.a; then
- X+ LIBS="$LIBS -lmalloc"
- X+fi
- X+
- X+AC_ISC_POSIX
- X AC_CONST
- X+FP_PROTOTYPES
- X+AC_STDC_HEADERS
- X+AC_UNISTD_H
- X+AC_HAVE_HEADERS(string.h termcap.h)
- X AC_RETSIGTYPE
- X AC_HAVE_FUNCS(tputs)
- X AC_REPLACE_FUNCS(strstr)
- X AC_ALLOCA
- X-AC_USG
- X AC_OUTPUT(Makefile)
- X--- wdiff-0.03/getopt.c Tue Jun 16 19:43:34 1992
- X+++ wdiff-0.04/getopt.c Tue Dec 1 13:22:16 1992
- X@@ -6,20 +6,24 @@
- X Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc.
- X
- X This program is free software; you can redistribute it and/or modify it
- X- under the terms of the GNU Library General Public License as published
- X- by the Free Software Foundation; either version 2, or (at your option)
- X- any later version.
- X-
- X+ under the terms of the GNU General Public License as published by the
- X+ Free Software Foundation; either version 2, or (at your option) any
- X+ later version.
- X+
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X-
- X- You should have received a copy of the GNU Library General Public
- X- License along with this program; if not, write to the Free Software
- X- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with this program; if not, write to the Free Software
- X+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- X
- X-/* AIX requires this to be the first thing in the file. */
- X+#ifdef HAVE_CONFIG_H
- X+#include "config.h"
- X+#endif
- X+
- X+/* AIX requires this to be the first thing in the file. */
- X #ifdef __GNUC__
- X #define alloca __builtin_alloca
- X #else /* not __GNUC__ */
- X@@ -34,6 +38,10 @@
- X #endif /* alloca.h */
- X #endif /* not __GNUC__ */
- X
- X+#if !__STDC__ && !defined(const)
- X+#define const
- X+#endif
- X+
- X #include <stdio.h>
- X
- X /* This needs to come after some library #include
- X@@ -40,20 +48,16 @@
- X to get __GNU_LIBRARY__ defined. */
- X #ifdef __GNU_LIBRARY__
- X #undef alloca
- X+/* Don't include stdlib.h for non-GNU C libraries because some of them
- X+ contain conflicting prototypes for getopt. */
- X #include <stdlib.h>
- X-#include <string.h>
- X #else /* Not GNU C library. */
- X #define __alloca alloca
- X #endif /* GNU C library. */
- X
- X-
- X-#ifndef __STDC__
- X-#define const
- X-#endif
- X-
- X /* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
- X long-named option. Because this is not POSIX.2 compliant, it is
- X- being phased out. */
- X+ being phased out. */
- X #define GETOPT_COMPAT
- X
- X /* This version of `getopt' appears to the caller like standard Unix `getopt'
- X@@ -143,6 +147,10 @@
- X } ordering;
- X
- X #ifdef __GNU_LIBRARY__
- X+/* We want to avoid inclusion of string.h with non-GNU libraries
- X+ because there are many ways it can cause trouble.
- X+ On some systems, it contains special magic macros that don't work
- X+ in GCC. */
- X #include <string.h>
- X #define my_index strchr
- X #define my_bcopy(src, dst, n) memcpy ((dst), (src), (n))
- X@@ -205,10 +213,12 @@
- X
- X /* Interchange the two blocks of data in ARGV. */
- X
- X- my_bcopy (&argv[first_nonopt], temp, nonopts_size);
- X- my_bcopy (&argv[last_nonopt], &argv[first_nonopt],
- X+ my_bcopy ((char *) &argv[first_nonopt], (char *) temp, nonopts_size);
- X+ my_bcopy ((char *) &argv[last_nonopt], (char *) &argv[first_nonopt],
- X (optind - last_nonopt) * sizeof (char *));
- X- my_bcopy (temp, &argv[first_nonopt + optind - last_nonopt], nonopts_size);
- X+ my_bcopy ((char *) temp,
- X+ (char *) &argv[first_nonopt + optind - last_nonopt],
- X+ nonopts_size);
- X
- X /* Update records for the slots the non-options now occupy. */
- X
- X@@ -452,7 +462,7 @@
- X if (*s)
- X {
- X /* Don't test has_arg with >, because some C compilers don't
- X- allow it to be used on enums. */
- X+ allow it to be used on enums. */
- X if (pfound->has_arg)
- X optarg = s + 1;
- X else
- X@@ -500,7 +510,7 @@
- X /* Can't find it as a long option. If this is not getopt_long_only,
- X or the option starts with '--' or is not a valid short
- X option, then it's an error.
- X- Otherwise interpret it as a short option. */
- X+ Otherwise interpret it as a short option. */
- X if (!long_only || argv[optind][1] == '-'
- X #ifdef GETOPT_COMPAT
- X || argv[optind][0] == '+'
- X--- wdiff-0.03/getopt.h Sat May 23 22:29:47 1992
- X+++ wdiff-0.04/getopt.h Fri Oct 16 17:41:24 1992
- X@@ -2,18 +2,18 @@
- X Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- X
- X This program is free software; you can redistribute it and/or modify it
- X- under the terms of the GNU Library General Public License as published
- X- by the Free Software Foundation; either version 2, or (at your option)
- X- any later version.
- X-
- X+ under the terms of the GNU General Public License as published by the
- X+ Free Software Foundation; either version 2, or (at your option) any
- X+ later version.
- X+
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X-
- X- You should have received a copy of the GNU Library General Public
- X- License along with this program; if not, write to the Free Software
- X- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with this program; if not, write to the Free Software
- X+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- X
- X #ifndef _GETOPT_H
- X #define _GETOPT_H 1
- X@@ -86,15 +86,19 @@
- X
- X /* Names for the values of the `has_arg' field of `struct option'. */
- X
- X-enum _argtype
- X-{
- X- no_argument,
- X- required_argument,
- X- optional_argument
- X-};
- X+#define no_argument 0
- X+#define required_argument 1
- X+#define optional_argument 2
- X
- X #if __STDC__
- X+#if defined(__GNU_LIBRARY__)
- X+/* Many other libraries have conflicting prototypes for getopt, with
- X+ differences in the consts, in stdlib.h. To avoid compilation
- X+ errors, only prototype getopt for the GNU C library. */
- X extern int getopt (int argc, char *const *argv, const char *shortopts);
- X+#else /* not __GNU_LIBRARY__ */
- X+extern int getopt ();
- X+#endif /* not __GNU_LIBRARY__ */
- X extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- X const struct option *longopts, int *longind);
- X extern int getopt_long_only (int argc, char *const *argv,
- X--- wdiff-0.03/getopt1.c Sat May 23 22:29:48 1992
- X+++ wdiff-0.04/getopt1.c Tue Dec 1 13:22:38 1992
- X@@ -2,37 +2,40 @@
- X Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc.
- X
- X This program is free software; you can redistribute it and/or modify it
- X- under the terms of the GNU Library General Public License as published
- X- by the Free Software Foundation; either version 2, or (at your option)
- X- any later version.
- X-
- X+ under the terms of the GNU General Public License as published by the
- X+ Free Software Foundation; either version 2, or (at your option) any
- X+ later version.
- X+
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X-
- X- You should have received a copy of the GNU Library General Public
- X- License along with this program; if not, write to the Free Software
- X- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with this program; if not, write to the Free Software
- X+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- X
- X-#ifdef LIBC
- X-/* For when compiled as part of the GNU C library. */
- X-#include <ansidecl.h>
- X+#ifdef HAVE_CONFIG_H
- X+#include "config.h"
- X #endif
- X
- X #include "getopt.h"
- X
- X-#ifndef __STDC__
- X+#if !__STDC__ && !defined(const)
- X #define const
- X #endif
- X
- X-#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) || defined (LIBC)
- X+#include <stdio.h>
- X+
- X+/* This needs to come after some library #include
- X+ to get __GNU_LIBRARY__ defined. */
- X+#ifdef __GNU_LIBRARY__
- X #include <stdlib.h>
- X-#else /* STDC_HEADERS or __GNU_LIBRARY__ */
- X+#else
- X char *getenv ();
- X-#endif /* STDC_HEADERS or __GNU_LIBRARY__ */
- X+#endif
- X
- X-#if !defined (NULL)
- X+#ifndef NULL
- X #define NULL 0
- X #endif
- X
- X@@ -50,7 +53,7 @@
- X /* Like getopt_long, but '-' as well as '--' can indicate a long option.
- X If an option that starts with '-' (not '--') doesn't match a long option,
- X but does match a short option, it is parsed as a short option
- X- instead. */
- X+ instead. */
- X
- X int
- X getopt_long_only (argc, argv, options, long_options, opt_index)
- X--- wdiff-0.03/gpl.texinfo Fri Jun 12 18:18:24 1992
- X+++ wdiff-0.04/gpl.texinfo Mon Jul 6 20:09:42 1992
- X@@ -378,6 +378,7 @@
- X necessary. Here is a sample; alter the names:
- X
- X @example
- X+@group
- X Yoyodyne, Inc., hereby disclaims all copyright
- X interest in the program `Gnomovision'
- X (which makes passes at compilers) written
- X@@ -385,6 +386,7 @@
- X
- X @var{signature of Ty Coon}, 1 April 1989
- X Ty Coon, President of Vice
- X+@end group
- X @end example
- X
- X This General Public License does not permit incorporating your program into
- X--- wdiff-0.03/pathmax.h
- X+++ wdiff-0.04/pathmax.h Thu Oct 1 23:33:48 1992
- X@@ -0,0 +1,53 @@
- X+/* Define PATH_MAX somehow. Requires sys/types.h.
- X+ Copyright (C) 1992 Free Software Foundation, Inc.
- X+
- X+ This program is free software; you can redistribute it and/or modify
- X+ it under the terms of the GNU General Public License as published by
- X+ the Free Software Foundation; either version 2, or (at your option)
- X+ any later version.
- X+
- X+ This program is distributed in the hope that it will be useful,
- X+ but WITHOUT ANY WARRANTY; without even the implied warranty of
- X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X+ GNU General Public License for more details.
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with this program; if not, write to the Free Software
- X+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+#ifndef _PATHMAX_H
- X+#define _PATHMAX_H
- X+
- X+#ifdef HAVE_UNISTD_H
- X+#include <unistd.h>
- X+#endif
- X+
- X+/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
- X+ PATH_MAX but might cause redefinition warnings when sys/param.h is
- X+ later included (as on MORE/BSD 4.3). */
- X+#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && defined(USG))
- X+#include <limits.h>
- X+#endif
- X+
- X+#ifndef _POSIX_PATH_MAX
- X+#define _POSIX_PATH_MAX 255
- X+#endif
- X+
- X+#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
- X+#define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
- X+#endif
- X+
- X+/* Don't include sys/param.h if it already has been. */
- X+#if !defined(PATH_MAX) && !defined(MAXPATHLEN) && !defined(__MSDOS__)
- X+#include <sys/param.h>
- X+#endif
- X+
- X+#if !defined(PATH_MAX) && defined(MAXPATHLEN)
- X+#define PATH_MAX MAXPATHLEN
- X+#endif
- X+
- X+#ifndef PATH_MAX
- X+#define PATH_MAX _POSIX_PATH_MAX
- X+#endif
- X+
- X+#endif /* _PATHMAX_H */
- X--- wdiff-0.03/readpipe.c Mon Aug 17 14:19:10 1992
- X+++ wdiff-0.04/readpipe.c Sat Dec 5 18:47:47 1992
- X@@ -20,6 +20,10 @@
- X #include <stdio.h>
- X #include <varargs.h>
- X
- X+#if defined (HAVE_UNISTD_H)
- X+#include <unistd.h>
- X+#endif
- X+
- X /* Open a pipe to read from a program without intermediary sh.
- X Checks PATH.
- X Sample use:
- X@@ -38,7 +42,7 @@
- X
- X /* Copy arguments into `args'. */
- X va_start (ap);
- X- while (args[argno++] = va_arg (ap, char *))
- X+ while ((args[argno++] = va_arg (ap, char *)) != NULL)
- X /* Do nothing. */ ;
- X va_end (ap);
- X
- X@@ -49,13 +53,16 @@
- X {
- X case 0: /* Child. Write to pipe. */
- X close (fds[0]); /* Not needed. */
- X- close (1); /* We don't want the old stdout. */
- X- if (dup (fds[1]) == 0) /* Maybe stdin was closed. */
- X+ if (fds[1] != 1) /* Redirect 1 (stdout) only if needed. */
- X {
- X- dup (fds[1]); /* Guaranteed to dup to 1 (stdout). */
- X- close (0);
- X+ close (1); /* We don't want the old stdout. */
- X+ if (dup (fds[1]) == 0)/* Maybe stdin was closed. */
- X+ {
- X+ dup (fds[1]); /* Guaranteed to dup to 1 (stdout). */
- X+ close (0);
- X+ }
- X+ close (fds[1]); /* No longer needed. */
- X }
- X- close (fds[1]); /* No longer needed. */
- X execvp (args[0], args);
- X _exit (2); /* 2 for `cmp'. */
- X case -1: /* Error. */
- X--- wdiff-0.03/strstr.c Fri Jul 19 21:40:32 1991
- X+++ wdiff-0.04/strstr.c Sat Nov 21 20:47:18 1992
- X@@ -30,20 +30,16 @@
- X char *s1;
- X char *s2;
- X {
- X- int i;
- X char *p1;
- X char *p2;
- X- char *s = s1;
- X+ char *s;
- X
- X- for (p2 = s2, i = 0; *s; p2 = s2, i++, s++)
- X- {
- X- for (p1 = s; *p1 && *p2 && *p1 == *p2; p1++, p2++)
- X- ;
- X+ for (s = s1; ; s++)
- X+ for (p1 = s, p2 = s2; ; p1++, p2++)
- X if (!*p2)
- X+ return s;
- X+ else if (!*p1)
- X+ return 0;
- X+ else if (*p1 != *p2)
- X break;
- X- }
- X- if (!*p2)
- X- return s1 + i;
- X-
- X- return 0;
- X }
- X--- wdiff-0.03/wdiff.1
- X+++ wdiff-0.04/wdiff.1 Mon Dec 21 21:35:53 1992
- X@@ -0,0 +1,427 @@
- X+.\" ------------------------------------------------------------
- X+.\" Manual page for the wdiff program, based on the texinfo manual.
- X+.\"
- X+.\" Colin Brough, December 1992.
- X+.\" ------------------------------------------------------------
- X+.de Id
- X+.ds Rv \\$3
- X+.ds Dt \\$4
- X+..
- X+.Id $Id: wdiff.1,v 0.4 1992/12/21 22:34:46 cmb Exp $
- X+.ds r \s-1RCS\s0
- X+.if n .ds - \%--
- X+.if t .ds - \(em
- X+.TH WDIFF 1 \*(Dt GNU
- X+.SH NAME
- X+wdiff \- display word differences between text files
- X+
- X+.SH SYNOPSIS
- X+.B wdiff
- X+[
- X+.B option \&.\|.\|.
- X+]
- X+.I old\_file new_file
- X+
- X+.SH COPYRIGHT
- X+Copyright (C) 1992 by the Free Software Foundation, Inc.
- X+
- X+.\" --------------------------------------------------
- X+.\" Now the body of the text...
- X+.\" --------------------------------------------------
- X+.SH DESCRIPTION
- X+
- X+.B wdiff
- X+compares two files, finding which words have been deleted or added to
- X+.I old_file
- X+to get
- X+.I new_file.
- X+A word is anything between whitespace. The output is collected and
- X+used to produce an annotated copy of
- X+.I new_file
- X+on standard output. Suitable annotations produce a nice display of
- X+word differences between the original files.
- X+
- X+.B wdiff
- X+will exit with a status of 0 if no differences were found, a status of
- X+1 if any differences were found, or a status of 2 for any error.
- X+
- X+Usually underlining is used to mark deleted text, while bold or
- X+reverse video is used to mark inserted text; these defaults may be
- X+over-ridden by command line options.
- X+.I deleted text
- X+refers to text in
- X+.I old_file
- X+which is not in
- X+.I new_file,
- X+while
- X+.I inserted text
- X+refers to text on
- X+.I new_file
- X+which is not in
- X+.I old_file.
- X+
- X+.\" --------------------------------------------------
- X+.\" Now the command line options.
- X+.\" --------------------------------------------------
- X+.SH OPTIONS
- X+.\" ------------------------------
- X+.TP
- X+.B \-\-help
- X+Has the same effect as \-h.
- X+.TP
- X+.B \-h
- X+Print an informative help message describing the options.
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-version
- X+Has the same effect as \-v.
- X+.TP
- X+.B \-v
- X+Print the version number of
- X+.B wdiff
- X+on the standard error output.
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-no\-deleted
- X+Has the same effect as \-1.
- X+.TP
- X+.B \-1
- X+Avoid producing deleted words on the output. If neither
- X+.B \-1
- X+or
- X+.B \-2
- X+is selected, the original right margin may be exceeded for some lines.
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-no\-inserted
- X+Has the same effect as \2.
- X+.TP
- X+.B \-2
- X+Avoid producing inserted words on the output. If neither
- X+.B \-1
- X+or
- X+.B \-2
- X+is selected, the original right margin may be exceeded for some lines.
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-no\-common
- X+Has the same effect as \-3.
- X+.TP
- X+.B \-3
- X+Avoid producing common words on the output. When this option is not
- X+selected, common words and whitespace are taken from
- X+.I new_file.
- X+When selected, differences are separated from one another by lines of
- X+dashes. Moreover, if this option is selected at the same time as
- X+.B \-1
- X+or
- X+.B \-2,
- X+then none of the output will have any emphasis \- i.e. no bold or
- X+underlining. Finally, if this option is not selected, but both
- X+.B \-1
- X+and
- X+.B \-2
- X+are, then sections of common words between differences are separated
- X+by lines of dashes.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-statistics
- X+Has the same effect as \-s.
- X+.TP
- X+.B \-s
- X+On completion, for each file, the total number of words, the number of
- X+common words between the files, the number of words deleted or
- X+inserted and the number of words that have changed is output. (A
- X+changed word is one that has been replaced or is part of a
- X+replacement.) Except for the total number of words, all of the
- X+numbers are followed by a percentage relative to the total number of
- X+words in the file.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-auto-pager
- X+Has the same effect as \-a.
- X+.TP
- X+.B \-a
- X+A pager is interposed whenever the
- X+.B wdiff
- X+output is directed to the user's terminal. Without this option, no
- X+pager will be called; the user is then responsible for explicitly
- X+piping
- X+.B wdiff
- X+output into a pager if required.
- X+
- X+The pager is selected by the value of the
- X+.B PAGER
- X+environment
- X+variable when
- X+.B wdiff
- X+is run. If
- X+.B PAGER
- X+is not defined at run time, then a default pager, selected at
- X+installation time, will be used instead. A defined but empty value of
- X+.B PAGER
- X+means no pager at all.
- X+
- X+When a pager is interposed through the use of this option, one of the
- X+options \-l or \-t is also selected, depending on whether the string
- X+"less" appears in the pager's name or not.
- X+
- X+It is often useful to define
- X+.I wdiff
- X+as an alias for
- X+.I wdiff -a.
- X+However, this "hides" the normal
- X+.B wdiff
- X+behaviour. The default behaviour may be restored simply by piping the
- X+output from
- X+.B wdiff
- X+through
- X+.B cat.
- X+This dissociates the output from the user terminal.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-printer
- X+Has the same effect as \-p.
- X+.TP
- X+.B \-p
- X+Use over-striking to emphasize parts of the output. Each character of
- X+the deleted text is underlined by writing an underscore \_ first, then
- X+a backspace and then the letter to be underlined. Each character of
- X+the inserted text is emboldened by writing it twice, with a backspace
- X+in between. This option is not selected by default.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-less-mode
- X+Has the same effect as \-l.
- X+.TP
- X+.B \-l
- X+Use over-striking to emphasize parts of output. This option works as
- X+option \-p, but also over-strikes whitespace associated with
- X+inserted text.
- X+.B less
- X+shows such whitespace using reverse video. This option is not
- X+selected by default. However, it is automatically turned on whenever
- X+.B wdiff
- X+launches
- X+.B less.
- X+(See option \-a.)
- X+
- X+This option is commonly used in conjunction with
- X+.B less:
- X+
- X+.B wdiff -l
- X+.I old_file
- X+.I new_file
- X+.B | less
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-terminal
- X+Has the same effect as \-t.
- X+.TP
- X+.B \-t
- X+Force the production of
- X+.I termcap
- X+strings for emphasising parts of output, even if the standard output
- X+is not associated with a terminal. The
- X+.B TERM
- X+environment variable must contain the name of a valid
- X+.I termcap
- X+entry. If the terminal description permits, underlining is used for
- X+marking deleted text, while bold or reverse video is used for
- X+marking inserted text. This option is not selected by default.
- X+However, it is automatically turned on whenever
- X+.B wdiff
- X+launches a pager, and it is known that the pager is
- X+.I not
- X+.B less.
- X+(See option \-a.)
- X+
- X+This option is commonly used when
- X+.B wdiff
- X+output is not redirected, but sent directly to the user's terminal, as
- X+in:
- X+
- X+.B wdiff -t
- X+.I old_file
- X+.I new_file
- X+
- X+A common kludge uses
- X+.B wdiff
- X+together with the pager
- X+.B more,
- X+as in:
- X+
- X+.B wdiff -t
- X+.I old_file
- X+.I new_file
- X+.B | more
- X+
- X+
- X+However, some versions of
- X+.B more
- X+use
- X+.B termcap
- X+emphasis for their own purposes, so strange interactions are possible.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-start\-delete argument
- X+Has the same effect as \-w.
- X+.TP
- X+.B \-w argument
- X+Use
- X+.I argument
- X+as the "start delete" string. This string will be output prior to
- X+every sequence of deleted text, to mark where it starts. By default,
- X+no start delete string is used unless there is no other means of
- X+distinguishing where such text starts; in this case the default start
- X+delete string is
- X+.B [\-.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-end\-delete argument
- X+Has the same effect as \-x.
- X+.TP
- X+.B \-x argument
- X+Use
- X+.I argument
- X+as the "end delete" string. This string will be output after every
- X+sequence of deleted text, to mark where it ends. By default, no end
- X+delete string is used unless there is no other means of distinguishing
- X+where such text ends; in this case the default end delete string is
- X+.B \-].
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-start\-insert argument
- X+Has the same effect as \-y.
- X+.TP
- X+.B \-y argument
- X+Use
- X+.I argument
- X+as the "start insert" string. This string will be output prior to any
- X+sequence of inserted text, to mark where it starts. By default, no
- X+start insert string is used unless there is no other means of
- X+distinguishing where such text starts; in this case the default start
- X+insert string is
- X+.B {+.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-end\-insert argument
- X+Has the same effect as \-z.
- X+.TP
- X+.B \-z argument
- X+Use
- X+.I argument
- X+as the "end insert" string. This string will be output after any
- X+sequence of inserted text, to mark where it ends. By default, no end
- X+insert string is used unless there is no other means of distinguishing
- X+where such text ends; in this case the default end insert string is
- X+.B +}.
- X+
- X+.\" ------------------------------------------------------------
- X+.TP
- X+.B \-\-avoid\-wraps
- X+Has the same effect as \-n.
- X+.TP
- X+.B \-n
- X+Avoid spanning the end of line while showing deleted or inserted text.
- X+Any single fragment of deleted or inserted text spanning many lines
- X+will be considered as being made up of many smaller fragments not
- X+containing a newline. So deleted text, for example, will have an end
- X+delete string at the end of each line, just before the new line, and a
- X+start delete string at the beginning of the next line. A long
- X+paragraph of inserted text will have each line bracketed between start
- X+insert and end insert strings. This behaviour is not selected by
- X+default.
- X+
- X+.\" ------------------------------------------------------------
- X+.LP
- X+.\" --------------------------------------------------
- X+.\" Some text to round things off, after the command line options.
- X+.\" --------------------------------------------------
- X+
- X+Note that options
- X+.B \-p, \-t,
- X+and
- X+.B \-[wxyz]
- X+are not mutually exclusive. If you use a combination of them, you will
- X+merely accumulate the effect of each. Option
- X+.B \-l
- X+is a variant of option
- X+.B \-p.
- X+
- X+.\" --------------------------------------------------
- X+.\" Some useful example of the use of the options above
- X+.\" --------------------------------------------------
- X+.SH EXAMPLES
- X+
- X+The following command produces a copy of
- X+.I new_file,
- X+shifted right one space to accommodate change bars since the last
- X+revision, ignoring those changes coming only from paragraph refilling.
- X+Any line with new or changed text will get a
- X+.B |
- X+in column 1. However, deleted text is not shown nor marked.
- X+
- X+.B wdiff -1n
- X+.I old_file new_file
- X+.B | sed -e 's/^/ /;/{+/s/^ /|/;s/{+//g;s/+}//g'
- X+
- X+
- X+.\" --------------------------------------------------
- X+.\" Now the bugs section.
- X+.\" --------------------------------------------------
- X+.SH BUGS
- X+If you find a bug in
- X+.B wdiff,
- X+please send electronic mail to
- X+.I pinard@iro.umontreal.ca.
- X+Include the version number, which you can find by running
- X+.B wdiff \-\-version.
- X+Include in your message sufficient input to reproduce the problem and
- X+also, the output you expected.
- X+
- X+.B wdiff
- X+currently calls
- X+.B diff.
- X+.B wdiff
- X+would be quicker and cleaner to implement if it were part of the
- X+.B diff
- X+suite of programs.
- X+
- X+Here are some (un-processed) suggestions:
- X+.TP
- X+\-
- X+Make an MS-DOS port.
- X+.TP
- X+\-
- X+Select by options exactly what is whitespace.
- X+.TP
- X+\-
- X+Have a
- X+.B wpatch
- X+program. Hard to see a good way of doing this.
- X+.LP
- X+
- X+.\" --------------------------------------------------
- X+.\" Some final sections
- X+.\" --------------------------------------------------
- X+.SH IDENTIFICATION
- X+Author: Francois Pinard,
- X+.I pinard@iro.umontreal.ca
- X+.br
- X+Manual Page: Colin M. Brough,
- X+.I cmb@epcc.ed.ac.uk
- X+.br
- X+Revision Number: \*(Rv; Release Date: \*(Dt.
- X+
- X+.SH SEE ALSO
- X+diff(1), less(1), cat(1), more(1), termcap(3).
- X--- wdiff-0.03/wdiff.c Mon Aug 17 14:17:20 1992
- X+++ wdiff-0.04/wdiff.c Wed Dec 23 21:10:28 1992
- X@@ -27,9 +27,9 @@
- X #define DIFF_PROGRAM "diff"
- X #endif
- X
- X-/* One may also, optionnaly, define a default PAGER_PROGRAM. This is
- X- normally done from the Makefile. If PAGER_PROGRAM is undefined and
- X- the PAGER environment variable is not set, none will be used. */
- X+/* One may also, optionnaly, define a default PAGER_PROGRAM. This might
- X+ be done from the Makefile. If PAGER_PROGRAM is undefined and the
- X+ PAGER environment variable is not set, none will be used. */
- X
- X /* Define the separator lines when output is inhibited. */
- X #define SEPARATOR_LINE \
- X@@ -44,17 +44,25 @@
- X #include <ctype.h>
- X #include <stdio.h>
- X
- X-#ifdef USG
- X+#ifdef STDC_HEADERS
- X #include <string.h>
- X-#else
- X+#else /* not STDC_HEADERS */
- X+#ifdef HAVE_STRING_H
- X+#include <string.h>
- X+#else /* not HAVE_STRING_H */
- X #include <strings.h>
- X-#endif
- X+#endif /* not HAVE_STRING_H */
- X+#endif /* not STDC_HEADERS */
- X
- X+char *strstr ();
- X+
- X+#ifdef HAVE_TPUTS
- X #ifdef HAVE_TERMCAP_H
- X #include <termcap.h>
- X #else
- X const char *tgetstr ();
- X #endif
- X+#endif /* HAVE_TPUTS */
- X
- X #include <setjmp.h>
- X #include <signal.h>
- X@@ -62,6 +70,10 @@
- X #define RETSIGTYPE void
- X #endif
- X
- X+#if defined (HAVE_UNISTD_H)
- X+#include <unistd.h>
- X+#endif
- X+
- X #include "getopt.h"
- X
- X char *getenv ();
- X@@ -68,13 +80,13 @@
- X FILE *readpipe ();
- X FILE *writepipe ();
- X char *tmpnam ();
- X-void *xmalloc ();
- X-const char *strstr ();
- X-const char *xstrdup ();
- X+void error ();
- X+
- X+/* Declarations. */
- X
- X /* Option variables. */
- X
- X-struct option longopts[] =
- X+struct option const longopts[] =
- X {
- X {"copyright" , 0, NULL, 'C'},
- X {"no-deleted" , 0, NULL, '1'},
- X@@ -92,8 +104,10 @@
- X {NULL , 0, NULL, 0}
- X };
- X
- X-extern char version[]; /* program version */
- X-extern char copyright[]; /* short copyright */
- X+static char const version[] =
- X+ "wdiff, version 0.04";
- X+static char const copyright[] =
- X+ "Copyright (C) 1992 Free Software Foundation, Inc.";
- X
- X const char *program_name; /* name of executing program */
- X
- X@@ -100,14 +114,17 @@
- X int inhibit_left; /* inhibit display of left side words */
- X int inhibit_right; /* inhibit display of left side words */
- X int inhibit_common; /* inhibit display of common words */
- X-int show_statistics; /* for printing summary statistics */
- X-int is_printer; /* use printer modes */
- X-int is_display; /* use termcap strings */
- X-int pager_is_less; /* if paging through the "less" program */
- X+int show_statistics; /* if printing summary statistics */
- X+int no_wrapping; /* end/restart strings at end of lines */
- X+int autopager; /* if calling the pager automatically */
- X+int overstrike; /* if using printer overstrikes */
- X+int overstrike_for_less; /* if output aimed to the "less" program */
- X const char *user_delete_start; /* user specified string for start of delete */
- X const char *user_delete_end; /* user specified string for end of delete */
- X const char *user_insert_start; /* user specified string for start of insert */
- X const char *user_insert_end; /* user specified string for end of insert */
- X+
- X+int find_termcap; /* initialize the termcap strings */
- X const char *term_delete_start; /* termcap string for start of delete */
- X const char *term_delete_end; /* termcap string for end of delete */
- X const char *term_insert_start; /* termcap string for start of insert */
- X@@ -126,6 +143,13 @@
- X jmp_buf signal_label; /* where to jump when signal received */
- X int jump_trigger; /* set when some signal has been received */
- X
- X+/* Guarantee some value for L_tmpnam. */
- X+#ifndef L_tmpnam
- X+#include <sys/types.h>
- X+#include "pathmax.h"
- X+#define L_tmpnam PATH_MAX
- X+#endif
- X+
- X typedef struct side SIDE; /* all variables for one side */
- X struct side
- X {
- X@@ -133,7 +157,7 @@
- X FILE *file; /* original input file */
- X int position; /* number of words read so far */
- X int character; /* one character look ahead */
- X- const char *temp_name; /* temporary file name */
- X+ char temp_name[L_tmpnam]; /* temporary file name */
- X FILE *temp_file; /* temporary file */
- X };
- X SIDE side_array[2]; /* area for holding side descriptions */
- X@@ -146,7 +170,6 @@
- X int argument[4]; /* four diff directive arguments */
- X
- X FILE *output_file; /* file to which we write output */
- X-int output_is_less; /* flag indicating that pager is less */
- X const char *termcap_init_string; /* how to initialize the termcap mode */
- X const char *termcap_end_string; /* how to complete the termcap mode */
- X
- X@@ -199,7 +222,7 @@
- X int success; /* tgetent results */
- X
- X #ifdef HAVE_TPUTS
- X- if (is_display)
- X+ if (find_termcap)
- X {
- X name = getenv ("TERM");
- X if (name == NULL)
- X@@ -221,16 +244,19 @@
- X }
- X #endif /* HAVE_TPUTS */
- X
- X- /* Insure some default strings. */
- X+ /* Ensure some default strings. */
- X
- X- if (!term_delete_start && !is_printer && user_delete_start == NULL)
- X- user_delete_start = "[-";
- X- if (!term_delete_end && !is_printer && user_delete_end == NULL)
- X- user_delete_end = "-]";
- X- if (!term_insert_start && !is_printer && user_insert_start == NULL)
- X- user_insert_start = "{+";
- X- if (!term_insert_end && !is_printer && user_insert_end == NULL)
- X- user_insert_end = "+}";
- X+ if (!overstrike)
- X+ {
- X+ if (!term_delete_start && !user_delete_start)
- X+ user_delete_start = "[-";
- X+ if (!term_delete_end && !user_delete_end)
- X+ user_delete_end = "-]";
- X+ if (!term_insert_start && !user_insert_start)
- X+ user_insert_start = "{+";
- X+ if (!term_insert_end && !user_insert_end)
- X+ user_insert_end = "+}";
- X+ }
- X }
- X
- X
- X@@ -376,7 +402,7 @@
- X while (isspace (side->character))
- X {
- X
- X- /* While changing lines, insure we stop any special display prior
- X+ /* While changing lines, ensure we stop any special display prior
- X to, and restore the special display after. When copy_mode is
- X anything else than COPY_NORMAL, file is always output_file. We
- X care underlining whitespace or overstriking it with itself,
- X@@ -391,6 +417,8 @@
- X case COPY_DELETED:
- X if (side->character == '\n')
- X {
- X+ if (no_wrapping && user_delete_end)
- X+ fprintf (output_file, "%s", user_delete_end);
- X #ifdef HAVE_TPUTS
- X if (term_delete_end)
- X tputs (term_delete_end, 0, putc_for_tputs);
- X@@ -400,8 +428,10 @@
- X if (term_delete_start)
- X tputs (term_delete_start, 0, putc_for_tputs);
- X #endif
- X+ if (no_wrapping && user_delete_start)
- X+ fprintf (output_file, "%s", user_delete_start);
- X }
- X- else if (pager_is_less)
- X+ else if (overstrike_for_less)
- X {
- X putc ('_', output_file);
- X putc ('\b', output_file);
- X@@ -414,6 +444,8 @@
- X case COPY_INSERTED:
- X if (side->character == '\n')
- X {
- X+ if (no_wrapping && user_insert_end)
- X+ fprintf (output_file, "%s", user_insert_end);
- X #ifdef HAVE_TPUTS
- X if (term_insert_end)
- X tputs (term_insert_end, 0, putc_for_tputs);
- X@@ -423,8 +455,10 @@
- X if (term_insert_start)
- X tputs (term_insert_start, 0, putc_for_tputs);
- X #endif
- X+ if (no_wrapping && user_insert_start)
- X+ fprintf (output_file, "%s", user_insert_start);
- X }
- X- else if (pager_is_less)
- X+ else if (overstrike_for_less)
- X {
- X putc (side->character, output_file);
- X putc ('\b', output_file);
- X@@ -457,7 +491,7 @@
- X /* In printer mode, act according to copy_mode. If copy_mode is not
- X COPY_NORMAL, we know that file is necessarily output_file. */
- X
- X- if (is_printer)
- X+ if (overstrike)
- X switch (copy_mode)
- X {
- X case COPY_NORMAL:
- X@@ -510,6 +544,7 @@
- X side->character = getc (side->file);
- X side->position = 0;
- X
- X+ tmpnam (side->temp_name);
- X side->temp_file = fopen (side->temp_name, "w");
- X if (side->temp_file == NULL)
- X {
- X@@ -722,6 +757,10 @@
- X count_changed_right += argument[3] - argument[2] + 1;
- X resync_left = argument[0] - 1;
- X resync_right = argument[2] - 1;
- X+ break;
- X+
- X+ default:
- X+ abort ();
- X }
- X
- X if (!inhibit_left)
- X@@ -760,7 +799,7 @@
- X end_of_delete ();
- X }
- X
- X- /* Show any inserted code, or insure skipping over it in case the
- X+ /* Show any inserted code, or ensure skipping over it in case the
- X right file is used merely to show common words. */
- X
- X if (directive == 'a' || directive == 'c')
- X@@ -850,9 +889,8 @@
- X /* Check if a output program should be called, and which one. Avoid
- X all paging if only statistics are needed. */
- X
- X- if (inhibit_left && inhibit_right && inhibit_common)
- X- program = NULL;
- X- else if (isatty (fileno (stdout)))
- X+ if (autopager && isatty (fileno (stdout))
- X+ && !(inhibit_left && inhibit_right && inhibit_common))
- X {
- X program = getenv ("PAGER");
- X #ifdef PAGER_PROGRAM
- X@@ -863,16 +901,18 @@
- X else
- X program = NULL;
- X
- X- /* By default, use stdout for output_file. Insure the termcap
- X- initialization string is sent to stdout, not the pager. */
- X+ /* Use stdout as default output. */
- X
- X output_file = stdout;
- X+
- X+ /* Ensure the termcap initialization string is sent to stdout right
- X+ away, never to the pager. */
- X+
- X #ifdef HAVE_TPUTS
- X if (termcap_init_string)
- X {
- X tputs (termcap_init_string, 0, putc_for_tputs);
- X- if (program && *program)
- X- fflush (stdout);
- X+ fflush (stdout);
- X }
- X #endif
- X
- X@@ -891,9 +931,9 @@
- X
- X if (strstr (program, "less"))
- X {
- X- is_display = 0;
- X- is_printer = 1;
- X- pager_is_less = 1;
- X+ find_termcap = 0;
- X+ overstrike = 1;
- X+ overstrike_for_less = 1;
- X }
- X }
- X }
- X@@ -918,6 +958,12 @@
- X case COPY_INSERTED:
- X end_of_insert ();
- X break;
- X+
- X+ case COPY_NORMAL:
- X+ break;
- X+
- X+ default:
- X+ abort ();
- X }
- X
- X /* Let the user play at will inside the pager, until s/he exits, before
- X@@ -929,8 +975,8 @@
- X wait (NULL);
- X }
- X
- X- /* Insure the termcap termination string is sent to stdout, not the
- X- pager, and this only once the pager has terminated. */
- X+ /* Ensure the termcap termination string is sent to stdout, never to
- X+ the pager. Moreover, the pager has terminated already. */
- X
- X #ifdef HAVE_TPUTS
- X if (termcap_end_string)
- X@@ -984,21 +1030,48 @@
- X
- X /* Main control. */
- X
- X+/*-----------------------------------.
- X+| Prints a more detailed Copyright. |
- X+`-----------------------------------*/
- X+
- X+static void
- X+print_copyright (void)
- X+{
- X+ fprintf (stderr, "\
- X+This program is free software; you can redistribute it and/or modify\n\
- X+it under the terms of the GNU General Public License as published by\n\
- X+the Free Software Foundation; either version 2, or (at your option)\n\
- X+any later version.\n\
- X+\n\
- X+This program is distributed in the hope that it will be useful,\n\
- X+but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
- X+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
- X+GNU General Public License for more details.\n\
- X+\n\
- X+You should have received a copy of the GNU General Public License\n\
- X+along with this program; if not, write to the Free Software\n\
- X+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\
- X+\n");
- X+}
- X+
- X /*-----------------------------.
- X | Tell how to use, then exit. |
- X `-----------------------------*/
- X
- X-void
- X+static void
- X usage_and_exit (void)
- X {
- X fprintf (stderr, "\
- X-Usage: %s [ OPTION ... ] FILE_1 FILE_2\n\
- X+Usage: %s [ OPTION ... ] OLD_FILE NEW_FILE\n\
- X \n\
- X -C, --copyright print Copyright then exit\n\
- X -1, --no-deleted inhibit output of deleted words\n\
- X -2, --no-inserted inhibit output of inserted words\n\
- X -3, --no-common inhibit output of common words\n\
- X+ -a, --auto-pager automatically calls a pager\n\
- X -h, --help print this help\n\
- X+ -l, --less-mode variation of printer mode for \"less\"\n\
- X+ -n, --avoid-wraps do not extend fields through newlines\n\
- X -p, --printer overstrike as for printers\n\
- X -s, --statistics say how many words deleted, inserted etc.\n\
- X -t, --terminal use termcap as for terminal displays\n\
- X@@ -1029,13 +1102,16 @@
- X inhibit_right = 0;
- X inhibit_common = 0;
- X show_statistics = 0;
- X- is_printer = 0;
- X- is_display = isatty (fileno (stdout));
- X- pager_is_less = 0;
- X+ no_wrapping = 0;
- X+ autopager = 0;
- X+ overstrike = 0;
- X+ overstrike_for_less = 0;
- X user_delete_start = NULL;
- X user_delete_end = NULL;
- X user_insert_start = NULL;
- X user_insert_end = NULL;
- X+
- X+ find_termcap = -1; /* undecided yet */
- X term_delete_start = NULL;
- X term_delete_end = NULL;
- X term_insert_start = NULL;
- X@@ -1050,7 +1126,7 @@
- X count_changed_right = 0;
- X
- X while ((option_char
- X- = getopt_long (argc, argv, "123Chdpstvw:x:y:z:", longopts, NULL)
- X+ = getopt_long (argc, argv, "123Cahdlnpstvw:x:y:z:", longopts, NULL)
- X ) != EOF)
- X switch (option_char)
- X {
- X@@ -1070,8 +1146,23 @@
- X print_copyright ();
- X exit (EXIT_OTHER_REASON);
- X
- X+ case 'a':
- X+ autopager = 1;
- X+ break;
- X+
- X+ case 'l':
- X+ if (find_termcap < 0)
- X+ find_termcap = 0;
- X+ overstrike = 1;
- X+ overstrike_for_less = 1;
- X+ break;
- X+
- X+ case 'n':
- X+ no_wrapping = 1;
- X+ break;
- X+
- X case 'p':
- X- is_printer = 1;
- X+ overstrike = 1;
- X break;
- X
- X case 's':
- X@@ -1079,12 +1170,15 @@
- X break;
- X
- X case 't':
- X+ if (find_termcap < 0)
- X+ {
- X #ifdef HAVE_TPUTS
- X- is_display = 1;
- X+ find_termcap = 1;
- X #else
- X- fprintf (stderr, "Cannot use -t, termcap not available.\n");
- X- exit (EXIT_OTHER_REASON);
- X+ fprintf (stderr, "Cannot use -t, termcap not available.\n");
- X+ exit (EXIT_OTHER_REASON);
- X #endif
- X+ }
- X break;
- X
- X case 'v':
- X@@ -1115,12 +1209,19 @@
- X if (optind + 2 != argc)
- X usage_and_exit ();
- X
- X+ /* If find_termcap still undecided, consider it unset. However, set if
- X+ autopager is set while stdout is directed to a terminal, but this
- X+ decision will be reversed later if the pager happens to be "less". */
- X+
- X+ if (find_termcap < 0)
- X+ find_termcap = autopager && isatty (fileno (stdout));
- X+
- X /* Setup file names and signals, then do it all. */
- X
- X left_side->filename = argv[optind++];
- X right_side->filename = argv[optind++];
- X- left_side->temp_name = xstrdup (tmpnam (NULL));
- X- right_side->temp_name = xstrdup (tmpnam (NULL));
- X+ *left_side->temp_name = '\0';
- X+ *right_side->temp_name = '\0';
- X
- X setup_signals ();
- X input_file = NULL;
- X@@ -1147,8 +1248,10 @@
- X if (input_file)
- X complete_input_program ();
- X
- X- unlink (left_side->temp_name);
- X- unlink (right_side->temp_name);
- X+ if (*left_side->temp_name)
- X+ unlink (left_side->temp_name);
- X+ if (*right_side->temp_name)
- X+ unlink (right_side->temp_name);
- X
- X if (output_file)
- X complete_output_program ();
- X--- wdiff-0.03/wdiff.info Tue Aug 18 06:31:12 1992
- X+++ wdiff-0.04/wdiff.info Wed Dec 23 17:50:54 1992
- X@@ -1,11 +1,11 @@
- X This is Info file wdiff.info, produced by Makeinfo-1.47 from the input
- X-file wdiff.texi.
- X+file ./wdiff.texi.
- X
- X- This file documents the the `wdiff' command, which compares two
- X-files, finding which words have been deleted or added to the first for
- X-getting the second.
- X+ This file documents the `wdiff' command, which compares two files,
- X+finding which words have been deleted or added to the first for getting
- X+the second.
- X
- X- Copyright (C) 1992 Free Software Foundation, Inc.
- X+ Copyright (C) 1992 by the Free Software Foundation, Inc.
- SHAR_EOF
- true || echo 'restore of Patch4 failed'
- fi
- echo 'End of part 2'
- echo 'File Patch4 is continued in part 3'
- echo 3 > _shar_seq_.tmp
- exit 0
- --
- Franc,ois Pinard ``Happy GNU Year!'' pinard@iro.umontreal.ca
- (514) 588-4656 ...!uunet!iros1!pinard
- About the League for Programming Freedom? Email me or lpf@uunet.uu.net
-