diff -r -u -N old_file-3.27/Makefile.am file-3.27/Makefile.am
--- old_file-3.27/Makefile.am	Tue Apr 20 15:41:45 1999
+++ file-3.27/Makefile.am	Fri Jun 11 00:52:30 1999
@@ -12,6 +12,7 @@
 
 file_SOURCES = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
 	compress.c is_tar.c readelf.c internat.c print.c \
+	summary.c tryole.c summary.h \
 	file.h names.h patchlevel.h readelf.h tar.h
 
 EXTRA_DIST = LEGAL.NOTICE MAINT PORTING Makefile.std magic2mime \
diff -r -u -N old_file-3.27/Makefile.in file-3.27/Makefile.in
--- old_file-3.27/Makefile.in	Tue Apr 20 15:41:47 1999
+++ file-3.27/Makefile.in	Fri Jun 11 00:52:34 1999
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,7 +13,7 @@
 # don't enforce GNU packaging standards
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -34,7 +34,7 @@
 includedir = @includedir@
 oldincludedir = /usr/include
 
-DESTDIR =
+DISTDIR =
 
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -48,7 +48,7 @@
 AUTOHEADER = @AUTOHEADER@
 
 INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 transform = @program_transform_name@
@@ -71,21 +71,43 @@
 
 data_DATA = magic
 
-MAGIC = @datadir@/magic
+MAGIC	 = @datadir@/magic
 CPPFLAGS = -DMAGIC='"$(MAGIC)"'
 
 man_MANS = file.1 magic.4
 
-file_SOURCES = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c 	compress.c is_tar.c readelf.c internat.c print.c 	file.h names.h patchlevel.h readelf.h tar.h
-
-
-EXTRA_DIST = LEGAL.NOTICE MAINT PORTING Makefile.std magic2mime 	Localstuff Header $(magic_FRAGMENTS) file.man magic.man
+file_SOURCES = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
+	compress.c is_tar.c readelf.c internat.c print.c \
+	summary.c tryole.c summary.h \
+	file.h names.h patchlevel.h readelf.h tar.h
 
+EXTRA_DIST = LEGAL.NOTICE MAINT PORTING Makefile.std magic2mime \
+	Localstuff Header $(magic_FRAGMENTS) file.man magic.man
 
 CLEANFILES = $(man_MANS) magic
 
-magic_FRAGMENTS = Magdir/adventure Magdir/alliant Magdir/alpha Magdir/amanda 
-
+magic_FRAGMENTS = Magdir/adventure Magdir/alliant Magdir/alpha Magdir/amanda \
+Magdir/amigaos Magdir/animation Magdir/apl Magdir/apple Magdir/applix \
+Magdir/archive Magdir/asterix Magdir/att3b Magdir/audio Magdir/blit \
+Magdir/bsdi Magdir/c-lang Magdir/chi Magdir/cisco Magdir/clipper \
+Magdir/commands Magdir/compress Magdir/convex Magdir/database \
+Magdir/diamond Magdir/diff Magdir/digital Magdir/dump Magdir/elf \
+Magdir/encore Magdir/filesystems Magdir/flash Magdir/fonts Magdir/frame \
+Magdir/freebsd Magdir/gimp Magdir/gnu Magdir/hp Magdir/ibm370 \
+Magdir/ibm6000 Magdir/iff Magdir/images Magdir/intel Magdir/interleaf \
+Magdir/island Magdir/ispell Magdir/java Magdir/karma Magdir/lecter \
+Magdir/lex Magdir/lif Magdir/linux Magdir/lisp Magdir/mach Magdir/macintosh \
+Magdir/magic Magdir/mail.news Magdir/mime Magdir/mirage Magdir/mkid \
+Magdir/mmdf Magdir/modem Magdir/motorola Magdir/msdos Magdir/ncr \
+Magdir/netbsd Magdir/news Magdir/octave Magdir/olf Magdir/os2 Magdir/os9 \
+Magdir/osf1 Magdir/pbm Magdir/pdf Magdir/pdp Magdir/pgp Magdir/pkgadd \
+Magdir/plus5 Magdir/printer Magdir/psdbms Magdir/pyramid Magdir/riff \
+Magdir/rpm Magdir/rtf Magdir/sc Magdir/sccs Magdir/sendmail Magdir/sequent \
+Magdir/sgi Magdir/sgml Magdir/sniffer Magdir/softquad Magdir/sun \
+Magdir/teapot Magdir/terminfo Magdir/tex Magdir/ti-8x Magdir/timezone \
+Magdir/troff Magdir/typeset Magdir/unknown Magdir/uuencode \
+Magdir/varied.out Magdir/vax Magdir/vicar Magdir/visx Magdir/vms \
+Magdir/wordperfect Magdir/xenix Magdir/zilog Magdir/zyxel
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = config.h
@@ -97,14 +119,13 @@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 file_OBJECTS =  file.o apprentice.o fsmagic.o softmagic.o ascmagic.o \
-compress.o is_tar.o readelf.o internat.o print.o
+compress.o is_tar.o readelf.o internat.o print.o summary.o tryole.o
 file_LDADD = $(LDADD)
 file_DEPENDENCIES = 
 file_LDFLAGS = 
 CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
 man1dir = $(mandir)/man1
 man4dir = $(mandir)/man4
 MANS = $(man_MANS)
@@ -112,22 +133,23 @@
 NROFF = nroff
 DATA =  $(data_DATA)
 
-DIST_COMMON =  README ./stamp-h.in Makefile.am Makefile.in acconfig.h \
-acinclude.m4 aclocal.m4 config.h.in configure configure.in install-sh \
-missing mkinstalldirs
+DIST_COMMON =  README Makefile.am Makefile.in acconfig.h acinclude.m4 \
+aclocal.m4 config.h.in configure configure.in install-sh missing \
+mkinstalldirs stamp-h.in
 
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = tar
-GZIP_ENV = --best
+GZIP = --best
 SOURCES = $(file_SOURCES)
 OBJECTS = $(file_OBJECTS)
 
-all: all-redirect
+all: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h
+
 .SUFFIXES:
 .SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
 	cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
@@ -137,29 +159,22 @@
 $(ACLOCAL_M4):  configure.in  acinclude.m4
 	cd $(srcdir) && $(ACLOCAL)
 
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+config.status: $(srcdir)/configure
 	$(SHELL) ./config.status --recheck
 $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
 	cd $(srcdir) && $(AUTOCONF)
 
 config.h: stamp-h
-	@if test ! -f $@; then \
-		rm -f stamp-h; \
-		$(MAKE) stamp-h; \
-	else :; fi
+	@:
 stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES= CONFIG_HEADERS=config.h \
 	     $(SHELL) ./config.status
-	@echo timestamp > stamp-h 2> /dev/null
+	@echo timestamp > stamp-h
 $(srcdir)/config.h.in: $(srcdir)/stamp-h.in
-	@if test ! -f $@; then \
-		rm -f $(srcdir)/stamp-h.in; \
-		$(MAKE) $(srcdir)/stamp-h.in; \
-	else :; fi
 $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
 	cd $(top_srcdir) && $(AUTOHEADER)
-	@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+	@echo timestamp > $(srcdir)/stamp-h.in
 
 mostlyclean-hdr:
 
@@ -184,15 +199,15 @@
 	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
-	     $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	    echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+	     $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	  else :; fi; \
 	done
 
 uninstall-binPROGRAMS:
 	@$(NORMAL_UNINSTALL)
 	list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	done
 
 .c.o:
@@ -285,10 +300,10 @@
 	done
 install-man: $(MANS)
 	@$(NORMAL_INSTALL)
-	$(MAKE) $(AM_MAKEFLAGS) install-man1 install-man4
+	$(MAKE) install-man1 install-man4
 uninstall-man:
 	@$(NORMAL_UNINSTALL)
-	$(MAKE) $(AM_MAKEFLAGS) uninstall-man1 uninstall-man4
+	$(MAKE) uninstall-man1 uninstall-man4
 
 install-dataDATA: $(data_DATA)
 	@$(NORMAL_INSTALL)
@@ -312,12 +327,8 @@
 tags: TAGS
 
 ID: $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
 	here=`pwd` && cd $(srcdir) \
-	  && mkid -f$$here/ID $$unique $(LISP)
+	  && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
 
 TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
 	tags=; \
@@ -346,31 +357,29 @@
 # tarfile.
 distcheck: dist
 	-rm -rf $(distdir)
-	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+	GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
 	mkdir $(distdir)/=build
 	mkdir $(distdir)/=inst
 	dc_install_base=`cd $(distdir)/=inst && pwd`; \
 	cd $(distdir)/=build \
 	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
-	  && $(MAKE) $(AM_MAKEFLAGS) \
-	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
-	  && $(MAKE) $(AM_MAKEFLAGS) check \
-	  && $(MAKE) $(AM_MAKEFLAGS) install \
-	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
-	  && $(MAKE) $(AM_MAKEFLAGS) dist
+	  && $(MAKE) \
+	  && $(MAKE) dvi \
+	  && $(MAKE) check \
+	  && $(MAKE) install \
+	  && $(MAKE) installcheck \
+	  && $(MAKE) dist
 	-rm -rf $(distdir)
-	@banner="$(distdir).tar.gz is ready for distribution"; \
-	dashes=`echo "$$banner" | sed s/./=/g`; \
-	echo "$$dashes"; \
-	echo "$$banner"; \
-	echo "$$dashes"
+	@echo "========================"; \
+	echo "$(distdir).tar.gz is ready for distribution"; \
+	echo "========================"
 dist: distdir
 	-chmod -R a+r $(distdir)
-	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
 	-rm -rf $(distdir)
 dist-all: distdir
 	-chmod -R a+r $(distdir)
-	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
 	-rm -rf $(distdir)
 distdir: $(DISTFILES)
 	-rm -rf $(distdir)
@@ -379,79 +388,63 @@
 	$(mkinstalldirs) $(distdir)/Magdir
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
-	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
-	  else \
-	    test -f $(distdir)/$$file \
-	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-	    || cp -p $$d/$$file $(distdir)/$$file || :; \
-	  fi; \
+	  test -f $(distdir)/$$file \
+	  || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	  || cp -p $$d/$$file $(distdir)/$$file; \
 	done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am: all-am
-check: check-am
-installcheck-am:
-installcheck: installcheck-am
-all-recursive-am: config.h
-	$(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-install-exec-am: install-binPROGRAMS
-install-exec: install-exec-am
-
-install-data-am: install-man install-dataDATA
-install-data: install-data-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-dataDATA
-uninstall: uninstall-am
-all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h
-all-redirect: all-am
+info:
+dvi:
+check: all
+	$(MAKE)
+installcheck:
+install-exec: install-binPROGRAMS
+	@$(NORMAL_INSTALL)
+
+install-data: install-man install-dataDATA
+	@$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+	@:
+
+uninstall: uninstall-binPROGRAMS uninstall-man uninstall-dataDATA
+
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 \
-		$(DESTDIR)$(mandir)/man4 $(DESTDIR)$(datadir)
+	$(mkinstalldirs)  $(DATADIR)$(bindir) $(DESTDIR)$(mandir)/man1 \
+		$(DESTDIR)$(mandir)/man4 $(DATADIR)$(datadir)
 
 
 mostlyclean-generic:
+	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
 	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
-	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f Makefile $(DISTCLEANFILES)
 	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
-mostlyclean-am:  mostlyclean-hdr mostlyclean-binPROGRAMS \
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean:  mostlyclean-hdr mostlyclean-binPROGRAMS \
 		mostlyclean-compile mostlyclean-tags \
 		mostlyclean-generic
 
-mostlyclean: mostlyclean-am
+clean:  clean-hdr clean-binPROGRAMS clean-compile clean-tags \
+		clean-generic mostlyclean
 
-clean-am:  clean-hdr clean-binPROGRAMS clean-compile clean-tags \
-		clean-generic mostlyclean-am
-
-clean: clean-am
-
-distclean-am:  distclean-hdr distclean-binPROGRAMS distclean-compile \
-		distclean-tags distclean-generic clean-am
-
-distclean: distclean-am
+distclean:  distclean-hdr distclean-binPROGRAMS distclean-compile \
+		distclean-tags distclean-generic clean
 	-rm -f config.status
 
-maintainer-clean-am:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
+maintainer-clean:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
 		maintainer-clean-compile maintainer-clean-tags \
-		maintainer-clean-generic distclean-am
+		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-am
 	-rm -f config.status
 
 .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
@@ -461,12 +454,10 @@
 maintainer-clean-compile install-man1 uninstall-man1 install-man4 \
 uninstall-man4 install-man uninstall-man uninstall-dataDATA \
 install-dataDATA tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck all-recursive-am install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+maintainer-clean-tags distdir info dvi installcheck install-exec \
+install-data install uninstall all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 magic: Header Localstuff $(magic_FRAGMENTS)
diff -r -u -N old_file-3.27/configure file-3.27/configure
--- old_file-3.27/configure	Tue Apr 20 15:41:50 1999
+++ file-3.27/configure	Fri Jun 11 00:47:45 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
+# Generated automatically using autoconf version 2.12 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -53,7 +53,6 @@
 # Initialize some other variables.
 subdirs=
 MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
 
@@ -337,7 +336,7 @@
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13"
+    echo "configure generated by autoconf version 2.12"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -507,11 +506,9 @@
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-ac_exeext=
-ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -551,30 +548,28 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:560: checking for a BSD compatible install" >&5
+echo "configure:556: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
+      for ac_prog in ginstall installbsd scoinst install; do
         if test -f $ac_dir/$ac_prog; then
 	  if test $ac_prog = install &&
             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
+	    # OSF/1 installbsd also uses dspmsg, but is usable.
 	    :
 	  else
 	    ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -604,15 +599,13 @@
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:616: checking whether build environment is sane" >&5
+echo "configure:609: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -669,7 +662,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:673: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -715,7 +708,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:719: checking for working aclocal" >&5
+echo "configure:712: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -728,7 +721,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:732: checking for working autoconf" >&5
+echo "configure:725: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -741,7 +734,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:745: checking for working automake" >&5
+echo "configure:738: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -754,7 +747,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:758: checking for working autoheader" >&5
+echo "configure:751: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -767,7 +760,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:771: checking for working makeinfo" >&5
+echo "configure:764: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -785,7 +778,7 @@
 
 
 echo $ac_n "checking for builtin ELF support""... $ac_c" 1>&6
-echo "configure:789: checking for builtin ELF support" >&5
+echo "configure:782: checking for builtin ELF support" >&5
 # Check whether --enable-elf or --disable-elf was given.
 if test "${enable_elf+set}" = set; then
   enableval="$enable_elf"
@@ -811,7 +804,7 @@
 
 
 echo $ac_n "checking for ELF core file support""... $ac_c" 1>&6
-echo "configure:815: checking for ELF core file support" >&5
+echo "configure:808: checking for ELF core file support" >&5
 # Check whether --enable-elf-core or --disable-elf-core was given.
 if test "${enable_elf_core+set}" = set; then
   enableval="$enable_elf_core"
@@ -839,16 +832,15 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:843: checking for $ac_word" >&5
+echo "configure:836: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -869,17 +861,16 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:873: checking for $ac_word" >&5
+echo "configure:865: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   ac_prog_rejected=no
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
+  for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -914,61 +905,25 @@
   echo "$ac_t""no" 1>&6
 fi
 
-  if test -z "$CC"; then
-    case "`uname -s`" in
-    *win32* | *WIN32*)
-      # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:924: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cl"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
- ;;
-    esac
-  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:956: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:913: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext << EOF
-
-#line 967 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 923 "configure"
 #include "confdefs.h"
-
 main(){return(0);}
 EOF
-if { (eval echo configure:972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -982,24 +937,18 @@
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:998: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:947: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1003: checking whether we are using GNU C" >&5
+echo "configure:952: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1008,7 +957,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1019,15 +968,11 @@
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-else
-  GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1031: checking whether ${CC-cc} accepts -g" >&5
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:976: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1042,20 +987,16 @@
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
     CFLAGS="-O2"
-  else
-    CFLAGS=
   fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
 fi
 
 # Find a good install program.  We prefer a C program (faster),
@@ -1065,30 +1006,28 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1074: checking for a BSD compatible install" >&5
+echo "configure:1014: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
+      for ac_prog in ginstall installbsd scoinst install; do
         if test -f $ac_dir/$ac_prog; then
 	  if test $ac_prog = install &&
             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
+	    # OSF/1 installbsd also uses dspmsg, but is usable.
 	    :
 	  else
 	    ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -1118,12 +1057,10 @@
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1127: checking whether ln -s works" >&5
+echo "configure:1064: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1145,7 +1082,7 @@
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1149: checking how to run the C preprocessor" >&5
+echo "configure:1086: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1160,14 +1097,14 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1164 "configure"
+#line 1101 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+{ (eval echo configure:1107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
 else
@@ -1177,31 +1114,14 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1181 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 1198 "configure"
+#line 1118 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+{ (eval echo configure:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
 else
@@ -1214,8 +1134,6 @@
 rm -f conftest*
 fi
 rm -f conftest*
-fi
-rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1225,12 +1143,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1229: checking for ANSI C header files" >&5
+echo "configure:1147: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1234 "configure"
+#line 1152 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1238,8 +1156,8 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+{ (eval echo configure:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
   ac_cv_header_stdc=yes
@@ -1255,7 +1173,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1259 "configure"
+#line 1177 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1273,7 +1191,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1277 "configure"
+#line 1195 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1294,7 +1212,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1298 "configure"
+#line 1216 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1305,7 +1223,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1329,19 +1247,19 @@
 fi
 
 echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6
-echo "configure:1333: checking whether sys/types.h defines makedev" >&5
+echo "configure:1251: checking whether sys/types.h defines makedev" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1338 "configure"
+#line 1256 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 return makedev(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:1345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_sys_types_h_makedev=yes
 else
@@ -1359,18 +1277,18 @@
 if test $ac_cv_header_sys_types_h_makedev = no; then
 ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6
-echo "configure:1363: checking for sys/mkdev.h" >&5
+echo "configure:1281: checking for sys/mkdev.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1368 "configure"
+#line 1286 "configure"
 #include "confdefs.h"
 #include <sys/mkdev.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+{ (eval echo configure:1291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1397,18 +1315,18 @@
   if test $ac_cv_header_sys_mkdev_h = no; then
 ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6
-echo "configure:1401: checking for sys/sysmacros.h" >&5
+echo "configure:1319: checking for sys/sysmacros.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1406 "configure"
+#line 1324 "configure"
 #include "confdefs.h"
 #include <sys/sysmacros.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+{ (eval echo configure:1329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1435,12 +1353,12 @@
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1439: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1357: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1444 "configure"
+#line 1362 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1456,7 +1374,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -1480,18 +1398,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1484: checking for $ac_hdr" >&5
+echo "configure:1402: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1489 "configure"
+#line 1407 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+{ (eval echo configure:1412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1518,12 +1436,12 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1522: checking for working const" >&5
+echo "configure:1440: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1527 "configure"
+#line 1445 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1572,7 +1490,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1593,12 +1511,12 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1597: checking for off_t" >&5
+echo "configure:1515: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1602 "configure"
+#line 1520 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1607,7 +1525,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_off_t=yes
 else
@@ -1626,12 +1544,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1630: checking for size_t" >&5
+echo "configure:1548: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1635 "configure"
+#line 1553 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1640,7 +1558,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_size_t=yes
 else
@@ -1659,12 +1577,12 @@
 fi
 
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:1663: checking for st_rdev in struct stat" >&5
+echo "configure:1581: checking for st_rdev in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1668 "configure"
+#line 1586 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1672,7 +1590,7 @@
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:1676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -1694,12 +1612,12 @@
 
 
 echo $ac_n "checking for uint8_t""... $ac_c" 1>&6
-echo "configure:1698: checking for uint8_t" >&5
+echo "configure:1616: checking for uint8_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint8_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1703 "configure"
+#line 1621 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1708,7 +1626,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])uint8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "uint8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_uint8_t=yes
 else
@@ -1727,12 +1645,12 @@
 fi
 
 echo $ac_n "checking for uint16_t""... $ac_c" 1>&6
-echo "configure:1731: checking for uint16_t" >&5
+echo "configure:1649: checking for uint16_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1736 "configure"
+#line 1654 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1741,7 +1659,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_uint16_t=yes
 else
@@ -1760,12 +1678,12 @@
 fi
 
 echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
-echo "configure:1764: checking for uint32_t" >&5
+echo "configure:1682: checking for uint32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1687 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1774,7 +1692,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_uint32_t=yes
 else
@@ -1794,7 +1712,7 @@
 
 
 echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:1798: checking for long long" >&5
+echo "configure:1716: checking for long long" >&5
 if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1805,13 +1723,13 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1809 "configure"
+#line 1727 "configure"
 #include "confdefs.h"
 int main() {
 long long foo = 0;
 exit(sizeof(long long) < sizeof(long)); }
 EOF
-if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_long_long=yes
 else
@@ -1840,12 +1758,12 @@
   long64='unsigned long';
 fi
 echo $ac_n "checking for uint64_t""... $ac_c" 1>&6
-echo "configure:1844: checking for uint64_t" >&5
+echo "configure:1762: checking for uint64_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uint64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1849 "configure"
+#line 1767 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1876,7 +1794,7 @@
 
 
 echo $ac_n "checking size of uint8_t""... $ac_c" 1>&6
-echo "configure:1880: checking size of uint8_t" >&5
+echo "configure:1798: checking size of uint8_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint8_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1884,7 +1802,7 @@
   ac_cv_sizeof_uint8_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1888 "configure"
+#line 1806 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -1900,7 +1818,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint8_t=`cat conftestval`
 else
@@ -1921,7 +1839,7 @@
 
 
 echo $ac_n "checking size of uint16_t""... $ac_c" 1>&6
-echo "configure:1925: checking size of uint16_t" >&5
+echo "configure:1843: checking size of uint16_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1929,7 +1847,7 @@
   ac_cv_sizeof_uint16_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1933 "configure"
+#line 1851 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -1945,7 +1863,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint16_t=`cat conftestval`
 else
@@ -1966,7 +1884,7 @@
 
 
 echo $ac_n "checking size of uint32_t""... $ac_c" 1>&6
-echo "configure:1970: checking size of uint32_t" >&5
+echo "configure:1888: checking size of uint32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1974,7 +1892,7 @@
   ac_cv_sizeof_uint32_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1978 "configure"
+#line 1896 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -1990,7 +1908,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint32_t=`cat conftestval`
 else
@@ -2011,7 +1929,7 @@
 
 
 echo $ac_n "checking size of uint64_t""... $ac_c" 1>&6
-echo "configure:2015: checking size of uint64_t" >&5
+echo "configure:1933: checking size of uint64_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_uint64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2019,7 +1937,7 @@
   ac_cv_sizeof_uint64_t=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2023 "configure"
+#line 1941 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef STDC_HEADERS
@@ -2035,7 +1953,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_uint64_t=`cat conftestval`
 else
@@ -2059,12 +1977,12 @@
 for ac_func in strerror strtoul
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2063: checking for $ac_func" >&5
+echo "configure:1981: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2068 "configure"
+#line 1986 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2087,7 +2005,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2135,7 +2053,7 @@
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  case `(ac_space=' '; set) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2202,7 +2120,7 @@
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    echo "$CONFIG_STATUS generated by autoconf version 2.12"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2222,11 +2140,9 @@
  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
 $ac_vpsub
 $extrasub
-s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2246,8 +2162,8 @@
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
diff -r -u -N old_file-3.27/file.c file-3.27/file.c
--- old_file-3.27/file.c	Sun Feb 14 17:16:05 1999
+++ file-3.27/file.c	Fri Jun 11 00:40:18 1999
@@ -360,8 +360,21 @@
 	if (nbytes == 0)
 		ckfputs("empty", stdout);
 	else {
-		buf[nbytes++] = '\0';	/* null-terminate it */
-		match = tryit(buf, nbytes, zflag);
+		/*
+		first we will attempt to see if its an ole2 file, 
+		and it so see if it has a summary field with 
+		information as to the format, if that fails then
+		go on to use the traditional file system
+		*/
+
+		match = tryole(inname);
+		if (match)
+			{
+			buf[nbytes++] = '\0';	/* null-terminate it */
+			match = tryit(buf, nbytes, zflag);
+			}
+		else
+			match = 'i';	/*just fake having for the info from the db rules*/
 	}
 
 #ifdef BUILTIN_ELF
diff -r -u -N old_file-3.27/summary.c file-3.27/summary.c
--- old_file-3.27/summary.c	Thu Jan  1 01:00:00 1970
+++ file-3.27/summary.c	Fri Jun 11 00:54:08 1999
@@ -0,0 +1,403 @@
+/*
+Written by Caolan.McNamara@ul.ie
+
+Extracted from the wvWare project for use with file,
+http://www.csn.ul.ie/~caolan/docs/MSWordView.html
+*/
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "summary.h"
+#include <string.h>
+
+/*
+This file is a port of the Somar Software freeware DLL functions to get 
+summary info from OLE 2.0 document files, named CPPSUM available from
+the Somar Software WWW site at http://www.somar.com
+
+This port (as always) is written by Caolan.McNamara@ul.ie
+
+An example of usage of the summary stream is shown in wvSummary.c
+*/
+
+U16 read_16ubit(FILE *in)
+    {
+    U8 temp1,temp2;
+    U16 ret;
+    temp1 = getc(in);
+    temp2 = getc(in);
+    ret = temp2;
+    ret = ret << 8;
+    ret += temp1;
+    return(ret);
+    }
+
+
+U16 sread_16ubit(U8 *in)
+    {
+    U8 temp1,temp2;
+    U16 ret;
+    temp1 = *in;
+    temp2 = *(in+1);
+    ret = temp2;
+    ret = ret << 8;
+    ret += temp1;
+    return(ret);
+    }
+
+
+U32 read_32ubit(FILE *in)
+    {
+    U16 temp1,temp2;
+    U32 ret;
+    temp1 = read_16ubit(in);
+    temp2 = read_16ubit(in);
+    ret = temp2;
+    ret = ret << 16;
+    ret += temp1;
+    return(ret);
+    }
+
+
+
+U32 sread_32ubit(U8 *in)
+    {
+    U16 temp1,temp2;
+    U32 ret;
+    temp1 = sread_16ubit(in);
+    temp2 = sread_16ubit(in+2);
+    ret = temp2;
+    ret = ret << 16;
+    ret+=temp1;
+    return(ret);
+    }
+
+
+
+
+void wvGetPropHeader(PropHeader *header,FILE *file)
+	{
+	int i;
+	header->byteOrder=read_16ubit(file);
+	header->wFormat=read_16ubit(file);
+	header->osVersion1=read_16ubit(file);
+	header->osVersion2=read_16ubit(file);
+	for (i=0;i<16;i++)
+	 	header->classId[i] = getc(file);
+	header->cSections=read_32ubit(file);
+	}
+
+void wvGetFIDAndOffset(FIDAndOffset *fid,FILE *file)
+	{
+	int i;
+	for (i=0;i<4;i++)
+		fid->dwords[i] = read_32ubit(file);
+	fid->dwOffset = read_32ubit(file);
+	}
+
+void wvReleaseSummaryInfo(SummaryInfo *si)
+	{
+	if (si == NULL)
+		return;
+	if (si->aProps != NULL)
+		free(si->aProps);
+	if (si->data != NULL)
+		free(si->data);
+	}
+
+void wvGetSummaryInfo(SummaryInfo *si,FILE *file,U32 offset)
+	{
+	int i;
+
+	fseek(file,offset,SEEK_SET);
+
+	si->cBytes = read_32ubit(file);
+	si->cProps = read_32ubit(file);
+
+	si->aProps = NULL;
+	si->data = NULL;
+
+	if (si->cProps == 0)
+		return;
+
+	si->aProps = (aPro *)malloc(sizeof(aPro)* si->cProps);
+	for(i=0;i<si->cProps;i++)
+		{
+		si->aProps[i].propID = read_32ubit(file);
+		si->aProps[i].dwOffset = read_32ubit(file);
+		si->aProps[i].dwOffset = si->aProps[i].dwOffset - 8 - si->cProps*8;
+		}
+	if (si->cBytes - 8*si->cProps > 0)
+		{
+		si->data = (U8 *)malloc(si->cBytes - 8*si->cProps);
+		for (i=0;i<si->cBytes - 8*si->cProps;i++)
+			si->data[i] = getc(file);
+		}
+	}
+
+int wvSumInfoGetString(char *lpStr, U16 cbStr, U32 pid, SummaryInfo *si)
+	{
+	int len;
+	PropValue Prop;
+	if (1 == wvGetProperty(&Prop, si, pid))
+		return(1);
+
+    if (Prop.vtType != VT_LPSTR) 
+		return(1);
+    len = (int) Prop.vtValue.vtBSTR.cBytes;
+    if (len > cbStr) 
+		len = cbStr;
+    if (len <= 0) 
+        *(lpStr) = '\0';
+    else 
+		{
+        strncpy(lpStr, Prop.vtValue.vtBSTR.ch, len);
+        *(lpStr + len - 1) = '\0'; /* len includes terminating null*/
+    	}
+	wvReleaseProperty(&Prop);
+    return(0);
+	}
+
+int wvSumInfoGetPreview(char *lpStr, U16 cbStr, U32 pid, SummaryInfo *si)
+	{
+	int len,i;
+	PropValue Prop;
+	FILE *outfile = fopen("preview","w+b");
+	if (1 == wvGetProperty(&Prop, si, pid))
+		return(1);
+
+    if (Prop.vtType != VT_WMF) 
+		return(1);
+    len = (int) Prop.vtValue.vtBSTR.cBytes;
+
+#if 0
+	i=0;
+#else
+	/*
+	it appears that this is a wmf file once you go 16bytes in,
+	it might have been a clp file, but the records seem all wrong
+	for the appropiate clp header, so we'll just skip them for
+	now
+	*/
+	i=16;
+#endif
+	for (;i<len;i++)
+    	fputc(Prop.vtValue.vtBSTR.ch[i],outfile);
+	fclose(outfile);
+	sprintf(lpStr,"preview");
+	wvReleaseProperty(&Prop);
+    return(0);
+	}
+
+int wvSumInfoGetLong(U32 *lpLong,U32 pid, SummaryInfo *si)
+	{
+	int ret;
+	PropValue Prop;
+
+	if (1 == wvGetProperty(&Prop, si, pid))
+        return(1);
+
+    if (Prop.vtType == VT_I4) 
+		{
+    	*lpLong = Prop.vtValue.vtLong;
+		ret = 0;
+		}
+	else
+		ret = 1;
+	wvReleaseProperty(&Prop);
+    return(ret);
+	}
+#if 0
+int wvSumInfoGetTime(U16 *yr, U16 *mon, U16 *day, U16 *hr, U16 *min, U16 *sec, U32 pid, SummaryInfo *si)
+	{
+	PropValue Prop;
+	/*
+    struct 
+		{
+        unsigned int day : 5;
+        unsigned int mon : 4;
+        unsigned int yr  : 7;
+    	} DosDate;
+    struct 
+		{
+        unsigned int sec2 : 5;
+        unsigned int min  : 6;
+        unsigned int hr   : 5;
+    	} DosTime;
+	*/
+	U16 DosDate;
+	U16 DosTime;
+	
+    int fBefore1980;
+
+    #define JAN1980_HIGH 0x01A8E79F
+    #define JAN1980_LOW  0xE1D58000
+
+	if (1 == wvGetProperty(&Prop, si, pid))
+		return(1);
+
+    if (Prop.vtType != VT_FILETIME) 
+		return(1);;
+
+        /* 
+		 If time < Jan 1, 1980, then add FILETIME of 1980/01/01 00:00:00.
+         This is necessary for CoFileTimeToDosDateTime to work.
+		*/
+    if (Prop.vtValue.vtTime.dwHighDateTime < JAN1980_HIGH) 
+		{
+        Prop.vtValue.vtTime.dwLowDateTime += JAN1980_LOW;
+        Prop.vtValue.vtTime.dwHighDateTime += JAN1980_HIGH;
+        if (Prop.vtValue.vtTime.dwLowDateTime < JAN1980_LOW)
+            Prop.vtValue.vtTime.dwHighDateTime++; /* overflow */
+        fBefore1980 = 1;
+    	}
+    else 
+		fBefore1980 = 0;
+
+    if (!wvFileTimeToDosDateTime(&Prop.vtValue.vtTime, &DosDate, &DosTime))
+        return(1);
+
+    *day = DosDate & 0x001F;
+    *mon = (DosDate & 0x01E0) >> 5;
+	*yr = ((DosDate & 0xFE00) >> 9)+1980;
+
+    *sec = (DosTime & 0x001F)  * 2;
+    *min = (DosTime & 0x7E0)>>5;
+    *hr  = (DosTime & 0xF800)>>11;
+
+    if (fBefore1980) 
+		{
+		/* 
+			Suppose edittime is actually 1 day, 3 hours.
+			Then Y/M/D will be 1980/1/2 at this point.
+			Which should be tranlated to 0/0/1.
+			The code below also handles cases where edittime > 1 month or even 1 year.
+		*/
+        *yr = *yr - 1980;
+        *mon = *mon - 1;
+        *day = *day - 1;
+        if (*mon == 0 && *yr > 0) 
+			{
+            (*yr)--;
+            *mon = 12;
+        	}
+        if (*day == 0 && *mon > 0) 
+			{
+            (*mon)--;
+            switch (*mon) 
+				{
+                case  1: *day = 31; break;
+                case  2: *day = 28; break;
+                case  3: *day = 31; break;
+                case  4: *day = 30; break;
+                case  5: *day = 31; break;
+                case  6: *day = 30; break;
+                case  7: *day = 31; break;
+                case  8: *day = 31; break;
+                case  9: *day = 30; break;
+                case 10: *day = 31; break;
+                case 11: *day = 30; break;
+                case 12: *day = 31; break;
+            	}
+        	}
+    	}
+    return(0);
+	}
+#endif
+
+
+void wvReleaseProperty(PropValue *Prop)
+	{
+	if (Prop != NULL)
+		return;
+	if (Prop->vtType == VT_LPSTR)
+		if (Prop->vtValue.vtBSTR.ch)
+			free(Prop->vtValue.vtBSTR.ch);
+	}
+
+int wvGetProperty(PropValue *Prop, SummaryInfo *si, U32 pid)
+{
+    U32 i,j;
+	U8 *t;
+
+	Prop->vtValue.vtBSTR.cBytes=0;
+
+    if (si == NULL) 
+		return(1);
+
+    for (i = 0; i < si->cProps; i++) 
+		{
+        if (si->aProps[i].propID == pid) 
+			{
+			t = si->data+si->aProps[i].dwOffset;
+			Prop->vtType = sread_32ubit(t);
+			t+=4;
+			switch(Prop->vtType)
+				{
+				case VT_LPSTR:
+				case VT_WMF:
+					Prop->vtValue.vtBSTR.cBytes = sread_32ubit(t);
+					t+=4;
+					if (Prop->vtValue.vtBSTR.cBytes == 0)
+						{
+						Prop->vtValue.vtBSTR.ch=NULL;
+						break;
+						}
+					Prop->vtValue.vtBSTR.ch = (U8 *)malloc(Prop->vtValue.vtBSTR.cBytes);
+					for (j=0;j<Prop->vtValue.vtBSTR.cBytes;j++)
+						Prop->vtValue.vtBSTR.ch[j] = *t++;
+					break;
+				case VT_FILETIME:
+					Prop->vtValue.vtTime.dwLowDateTime = sread_32ubit(t);
+					t+=4;
+					Prop->vtValue.vtTime.dwHighDateTime = sread_32ubit(t);
+					break;
+				case VT_I4:
+				default:
+					Prop->vtValue.vtLong = sread_32ubit(t);
+					break;
+				}
+            return(0);
+        	}
+    }
+    return(1);
+}
+
+int wvSumInfoOpenStream(SummaryInfo *si,FILE *stream)
+    {
+    PropHeader header;
+    FIDAndOffset fid;
+    int i;
+   
+    wvGetPropHeader(&header,stream);
+    if (header.byteOrder != 0xFFFE)
+        {
+        return(1);
+        }
+
+    if (header.wFormat != 0)
+        {
+        return(1);
+        }
+
+    for (i = 0; i < header.cSections; i++)
+        {
+        wvGetFIDAndOffset(&fid,stream);
+        if (fid.dwords[0] == 0XF29F85E0 &&
+            fid.dwords[1] == 0X10684FF9 &&
+            fid.dwords[2] == 0X000891AB &&
+            fid.dwords[3] == 0XD9B3272B) break;
+        }
+
+    if (i >= header.cSections)
+        {
+        return(1);
+        }
+
+    wvGetSummaryInfo(si,stream,fid.dwOffset);
+    return(0);
+    }
+
+
+
diff -r -u -N old_file-3.27/summary.h file-3.27/summary.h
--- old_file-3.27/summary.h	Thu Jan  1 01:00:00 1970
+++ file-3.27/summary.h	Fri Jun 11 00:49:45 1999
@@ -0,0 +1,160 @@
+/*
+Written by Caolan.McNamara@ul.ie
+
+Extracted from the wvWare project for use with file, 
+http://www.csn.ul.ie/~caolan/docs/MSWordView.html
+*/
+
+#ifndef PATH_MAX
+#define PATH_MAX 255 /*seems a reasonable figure*/
+#endif
+
+#include "config.h"
+#include <sys/types.h>
+
+
+#ifndef U32
+#define U32 uint32_t
+#endif
+
+#ifndef U16
+#define U16 uint16_t
+#endif
+
+#ifndef U8
+#define U8 uint8_t
+#endif
+
+#ifndef S32
+#define S32 int
+#endif
+
+#ifndef S16
+#define S16 short
+#endif
+
+#ifndef _FILETIME_
+#define _FILETIME_
+/* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
+typedef struct
+    {
+    U32  dwLowDateTime;
+    U32  dwHighDateTime;
+    } FILETIME;
+#endif /* _FILETIME_ */
+
+void wvGetFILETIME(FILETIME *ft,FILE *fd);
+
+
+
+/*Summary Information Stream*/
+
+typedef struct _PropHeader
+    {
+    U16     byteOrder;
+    U16     wFormat;
+    U16     osVersion1;
+    U16     osVersion2;
+    U8    classId[16];
+    U32    cSections;
+    } PropHeader;
+
+void wvGetPropHeader(PropHeader *header,FILE *file);
+
+typedef struct _FIDAndOffset
+	{
+    U32 dwords[4];
+    U32 dwOffset;
+    } FIDAndOffset;
+
+void wvGetFIDAndOffset(FIDAndOffset *fid,FILE *file);
+
+typedef struct _aPro
+		{
+        U32 propID;
+        U32 dwOffset;
+    	} aPro;
+
+typedef struct _SummaryInfo 
+	{
+    U32   cBytes;
+    U32   cProps;
+	aPro *aProps;
+	U8 *data;
+	} SummaryInfo;
+
+int wvSumInfoOpenStream(SummaryInfo *si,FILE *stream);
+
+void wvGetSummaryInfo(SummaryInfo *si,FILE *file,U32 offset);
+void wvReleaseSummaryInfo(SummaryInfo *si);
+
+typedef struct _vtB
+	{
+	U32 cBytes;
+	char  *ch;
+	} vtB;
+
+#define VT_I4           0x03
+#define VT_LPSTR        0x1E
+#define VT_FILETIME     0x40
+#define VT_WMF			0x47
+
+typedef struct _PropValue
+	{
+    U32 vtType;
+    union 
+		{
+        FILETIME      vtTime;
+        S32          vtLong;
+        vtB vtBSTR;
+    	} vtValue;
+	} PropValue;
+
+/*String properties*/
+#define PID_TITLE          0x02
+#define PID_SUBJECT        0x03
+#define PID_AUTHOR         0x04
+#define PID_KEYWORDS       0x05
+#define PID_COMMENTS       0x06
+#define PID_TEMPLATE       0x07
+#define PID_LASTAUTHOR     0x08
+#define PID_REVNUMBER      0x09
+#define PID_APPNAME        0x12
+
+/*Time properties*/
+#define PID_TOTAL_EDITTIME 0x0A
+#define PID_LASTPRINTED    0x0B
+#define PID_CREATED        0x0C
+#define PID_LASTSAVED      0x0D
+
+/*Long integer properties*/
+#define PID_PAGECOUNT      0x0E
+#define PID_WORDCOUNT      0x0F
+#define PID_CHARCOUNT      0x10
+#define PID_SECURITY       0x13
+
+#define PID_THUMBNAIL	   0x11
+
+/*bit masks for security long integer*/
+#define AllSecurityFlagsEqNone         0x00
+#define fSecurityPassworded            0x01
+#define fSecurityRORecommended         0x02
+#define fSecurityRO                    0x04
+#define fSecurityLockedForAnnotations  0x08
+
+int wvGetProperty(PropValue *Prop, SummaryInfo *si, U32 pid);
+void wvReleaseProperty(PropValue *Prop);
+
+int wvSumInfoGetString(char *lpStr, U16 cbStr, U32 pid, SummaryInfo *si);
+
+int wvSumInfoGetLong(U32 *lpLong,U32 pid, SummaryInfo *si);
+
+int wvSumInfoGetTime(U16 *yr, U16 *mon, U16 *day, U16 *hr, U16 *min, U16 *sec, U32 pid, SummaryInfo *si);
+
+int wvSumInfoGetPreview(char *lpStr, U16 cbStr, U32 pid, SummaryInfo *si);
+
+/*end of clean interface*/
+
+
+
+
+
diff -r -u -N old_file-3.27/tryole.c file-3.27/tryole.c
--- old_file-3.27/tryole.c	Thu Jan  1 01:00:00 1970
+++ file-3.27/tryole.c	Fri Jun 11 00:51:10 1999
@@ -0,0 +1,391 @@
+/*
+Modified by Caolan.McNamara@ul.ie
+
+Extracted from the wvWare project for use with file,
+http://www.csn.ul.ie/~caolan/docs/MSWordView.html
+*/
+
+
+/*
+Originally Released under GPL, written by 
+	Andrew Scriven <andy.scriven@research.natpower.co.uk>
+
+Copyright (C) 1998
+	Andrew Scriven
+*/
+
+
+/*
+-----------------------------------------------------------------------
+Andrew Scriven
+Research and Engineering
+Electron Building, Windmill Hill, Whitehill Way, Swindon, SN5 6PB, UK
+Phone (44) 1793 896206, Fax (44) 1793 896251
+-----------------------------------------------------------------------
+*/
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <malloc.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include "summary.h"
+
+#define THEMIN(a,b) ((a)<(b) ? (a) : (b))
+
+#define MAXBLOCKS 256
+
+struct pps_block
+  {
+  char name[64];
+  char type;
+  struct pps_block *previous;
+  struct pps_block *next;
+  struct pps_block *directory;
+  S32 start;
+  S32 size;
+  int level;
+  };
+
+typedef struct pps_block pps_entry;
+
+/* Routine prototypes */
+unsigned short int ShortInt(unsigned char* array);
+U32 LongInt(unsigned char* array);
+
+unsigned short int ShortInt(unsigned char* array)
+{
+return sread_16ubit(array);
+}
+
+U32 LongInt(unsigned char* array)
+{
+return sread_32ubit(array);
+}
+
+pps_entry **pps_list=NULL;
+char *SDepot=NULL;
+
+char tryole(char *inname)
+	{
+	char szTemp[256];
+	FILE *summary=NULL;
+	int ret;
+	SummaryInfo si;
+
+	if (0 == GetSummary(inname, &summary))
+		{
+		if (summary == NULL)
+			return(0);
+		ret = wvSumInfoOpenStream(&si,summary);
+		if (ret)
+			return(1);
+		ret = wvSumInfoGetString(szTemp, 256, PID_APPNAME, &si);
+		wvReleaseSummaryInfo(&si);
+		if (!ret)
+			{
+			printf("OLE2 file, created by %s",szTemp);
+			return(0);
+			}
+		}
+	return(1);
+	}
+
+
+
+
+
+
+/* recurse to follow forward/backward list of root pps's */
+void unravel(pps_entry *pps_node)
+{
+  if (pps_node != NULL)
+  	{
+	if (pps_node->previous != NULL) 
+		unravel(pps_node->previous);
+	pps_node->level = 0;
+	if(pps_node->next != NULL) 
+		unravel(pps_node->next);
+	}
+}
+
+int GetSummary(char *filename, FILE **summary)
+{
+  FILE *input=NULL;
+  FILE *OLEfile=NULL;
+  FILE *sbfile=NULL;
+  FILE *infile=NULL;
+  
+#ifdef DEBUG
+  int debug=1;
+#else
+  int debug=0;
+#endif
+  int BlockSize=0,Offset=0;
+  int c,i,j,len,bytes;
+  char *s,*p,*t;
+  char *Block,*BDepot,*Depot,*Root;
+  
+  char Summary[]="\005SummaryInformation";
+  U32 FilePos=0x00000000;
+  S32 num_bbd_blocks;
+  S32 root_list[MAXBLOCKS], sbd_list[MAXBLOCKS];
+  S32 pps_size,pps_start=-1;
+  S32 linkto;
+  int root_entry=-1;
+  S32 fullen;
+  S32 temppos;
+  
+
+
+  *summary = NULL;
+  input = fopen(filename,"rb");
+  if(input == NULL) return 4;
+  /* peek into file to guess file type */
+  c=getc(input);
+  ungetc(c,input);
+
+  if(isprint(c)) {
+     /*fprintf(erroroutput,"File looks like a plain text file.\n");*/
+     return 8;
+  /* check for MS OLE wrapper */
+  } else if(c==0xd0) {
+     Block = malloc(512);
+	 if (Block == NULL)
+	 	{
+       	/*fprintf(erroroutput,"1 ===========> probable corrupt ole file, unable to allocate %d bytes\n",512);*/
+		return(5);
+		}
+     /* read header block */
+     if(fread(Block,512,1,input)!=1) {
+       /*fprintf(erroroutput,"1 ===========> Input file has faulty OLE format\n");*/
+    return 5;
+     }
+     num_bbd_blocks=(S32)LongInt(Block+0x2c);
+	 if ((num_bbd_blocks == 0) || (num_bbd_blocks < 0))
+		{
+       	/*fprintf(erroroutput,"2 ===========> Input file has ridiculous bbd, mem for the depot was %d\n",512*num_bbd_blocks);*/
+		return(5);
+		}
+     BDepot = malloc(512*num_bbd_blocks);
+	 if (BDepot == NULL)
+	 	{
+       	/*fprintf(erroroutput,"2 ===========> couldnt alloc ole mem for the depot of %d\n",512*num_bbd_blocks);*/
+		return(5);
+		}
+     s = BDepot;
+     root_list[0]=LongInt(Block+0x30);
+     sbd_list[0]=(S16)LongInt(Block+0x3c);
+	temppos = ftell(input);
+	fseek(input,0,SEEK_END);
+	fullen = ftell(input);
+	fseek(input,temppos,SEEK_SET);
+
+     /* read big block Depot */
+     for(i=0;i<(int)num_bbd_blocks;i++) 
+	 	{
+		if (0x4c+(i*4) > 512)
+			{
+			/*fprintf(erroroutput,"2.1 ===========> Input file has faulty bbd\n");*/
+			return 5;
+			}
+       	FilePos = 512*(LongInt(Block+0x4c+(i*4))+1);
+		if (FilePos > fullen)
+			{
+			/*fprintf(erroroutput,"2.2 ===========> Input file has faulty bbd\n");*/
+			return 5;
+			}
+       	fseek(input,FilePos,SEEK_SET);
+       	if(fread(s,512,1,input)!=1) 
+			{
+			/*fprintf(erroroutput,"2.3 ===========> Input file has faulty bbd\n");*/
+			return 5;
+			}
+       	s += 0x200;
+     	}
+
+     /* Extract the sbd block list */
+     for(len=1;len<MAXBLOCKS;len++)
+	 	{
+		if (((sbd_list[len-1]*4) < (512*num_bbd_blocks))  && ((sbd_list[len-1]*4) > 0))
+			sbd_list[len] = LongInt(BDepot+(sbd_list[len-1]*4));
+		else
+			{
+         	/*fprintf(erroroutput,"3 ===========> Input file has faulty OLE format\n");*/
+			return(5);
+			}
+		if(sbd_list[len]==-2) break;
+     	}
+     SDepot = malloc(512*len);
+	 if (SDepot== NULL)
+	 	{
+       	/*fprintf(erroroutput,"1 ===========> probable corrupt ole file, unable to allocate %d bytes\n",512*len);*/
+		return(5);
+		}
+     s = SDepot;
+     /* Read in Small Block Depot */
+     for(i=0;i<len;i++) {
+       FilePos = 512 *(sbd_list[i]+1);
+       fseek(input,FilePos,SEEK_SET);
+       if(fread(s,512,1,input)!=1) {
+         /*fprintf(erroroutput,"3 ===========> Input file has faulty OLE format\n");*/
+         return 5;
+       }
+       s += 0x200;
+     }
+     /* Extract the root block list */
+     for(len=1;len<MAXBLOCKS;len++)
+		{
+		if ( ((root_list[len-1]*4) >= (512*num_bbd_blocks)) || ( (root_list[len-1]*4) < 0) )
+			{
+         	/*fprintf(erroroutput,"3.1 ===========> Input file has faulty OLE format\n");*/
+			return(5);
+			}
+		root_list[len] = LongInt(BDepot+(root_list[len-1]*4));
+		if(root_list[len]==-2) break;
+		}
+     Root = malloc(512*len);
+	 if (Root == NULL)
+	 	{
+       	/*fprintf(erroroutput,"1 ===========> probable corrupt ole file, unable to allocate %d bytes\n",512*len);*/
+		return(5);
+		}
+     s = Root;
+     /* Read in Root stream data */
+     for(i=0;i<len;i++) {
+       FilePos = 512 *(root_list[i]+1);
+       fseek(input,FilePos,SEEK_SET);
+       if(fread(s,512,1,input)!=1) {
+         /*fprintf(erroroutput,"4 ===========> Input file has faulty OLE format\n");*/
+         return 5;
+       }
+       s += 0x200;
+     }
+
+     /* assign space for pps list */
+     pps_list = malloc(len*4*sizeof(pps_entry *));
+	 if (pps_list == NULL)
+	 	{
+       	/*fprintf(erroroutput,"1 ===========> probable corrupt ole file, unable to allocate %d bytes\n",len*4*sizeof(pps_entry *));*/
+		return(5);
+		}
+     for(j=0;j<len*4;j++) 
+	 	{
+	 	pps_list[j] = malloc(sizeof(pps_entry));
+		if (pps_list[j] == NULL)
+			{
+			/*fprintf(erroroutput,"1 ===========> probable corrupt ole file, unable to allocate %d bytes\n",sizeof(pps_entry));*/
+			return(5);
+			}
+		}
+     /* Store pss entry details and look out for Root Entry */
+     for(j=0;j<len*4;j++) {
+       pps_list[j]->level = -1;
+       s = Root+(j*0x80);
+       i=ShortInt(s+0x40);
+	   if (((j*0x80) + i) >= (512 * len))
+	   	{
+		/*fprintf(erroroutput,"1.1 ===========> probable corrupt ole file\n");*/
+		return(5);
+		}
+       for(p=pps_list[j]->name,t=s;t<s+i;t++) 
+	   	*p++ = *t++;
+       s+=0x42;
+       pps_list[j]->type = *s;
+       if(pps_list[j]->type == 5) {
+         root_entry = j; /* this is root */
+         pps_list[j]->level = 0;
+       }
+       s+=0x02;
+       linkto = LongInt(s);
+       if ((linkto != -1) && (linkto < (len*4)) && (linkto > -1))
+	   	pps_list[j]->previous = pps_list[linkto];
+       else pps_list[j]->previous = NULL;
+       s+=0x04;
+       linkto = LongInt(s);
+       if ((linkto != -1) && (linkto < (len*4)) && (linkto > -1))
+	   	pps_list[j]->next = pps_list[linkto];
+       else pps_list[j]->next = NULL;
+       s+=0x04;
+       linkto = LongInt(s);
+       if ((linkto != -1) && (linkto < (len*4)) && (linkto > -1))
+	   	pps_list[j]->directory = pps_list[linkto];
+       else pps_list[j]->directory = NULL;
+       s+=0x28;
+       pps_list[j]->start = LongInt(s);
+       s+=0x04;
+       pps_list[j]->size = LongInt(s);
+     }
+
+     /* go through the pps entries, tagging them with level number
+        use recursive routine to follow list starting at root entry */
+     unravel(pps_list[root_entry]->directory);
+
+     /* go through the level 0 list looking for named entries */
+     for(j=0;j<len*4;j++) {
+       if(pps_list[j]->level != 0) continue; /* skip nested stuff */
+       pps_start = pps_list[j]->start;
+       pps_size  = pps_list[j]->size;
+       OLEfile = NULL;
+       if(pps_list[j]->type==5) {  /* Root entry */
+         OLEfile = tmpfile();
+         sbfile = OLEfile;
+       }
+       else if(!strcmp(pps_list[j]->name,Summary)) {
+         OLEfile = tmpfile();
+         *summary= OLEfile;
+       }
+	   	
+       if(pps_size<=0) OLEfile = NULL;
+       if(OLEfile == NULL) continue;
+	   /* 
+       if (pps_size>=4096 | OLEfile==sbfile) 
+	   */
+       if ((pps_size>=4096) || (OLEfile==sbfile))
+	   {
+         Offset = 1;
+         BlockSize = 512;
+         infile = input;
+         Depot = BDepot;
+       } else {
+         Offset = 0;
+         BlockSize = 64;
+         infile = sbfile;
+         Depot = SDepot;
+       }
+       while(pps_start != -2) {
+         FilePos = (pps_start+Offset)* BlockSize;
+         bytes = THEMIN(BlockSize,pps_size);
+         fseek(infile,FilePos,SEEK_SET);
+         if(fread(Block,bytes,1,infile)!=1) {
+           /*fprintf(erroroutput,"5 ===========> Input file has faulty OLE format\n");*/
+           return(5);
+         }
+         fwrite(Block,bytes,1,OLEfile);
+         pps_start = LongInt(Depot+(pps_start*4));
+         pps_size -= BlockSize;
+         if(pps_size <= 0) pps_start=-2;
+       }
+       rewind(OLEfile);
+     }
+    free(Root);
+    free(BDepot);
+    free(Block);
+    fclose(input);
+    return 0;
+  } else {
+    /* not a OLE file! */
+    /*fprintf(erroroutput,"7 ===========> Input file is not an OLE file\n");*/
+    return 8;
+  }
+}
+
+void myfreeOLEtree(void)
+    {
+	if (SDepot != NULL)
+		free(SDepot);
+	}
+

