Index: ChangeLog
===================================================================
RCS file: /cvsroot/harvest/ChangeLog,v
retrieving revision 2.39
retrieving revision 2.43
diff -c -r2.39 -r2.43
*** /tmp/T0a16881	Wed Feb  4 13:02:49 1998
--- /tmp/T1a16881	Wed Feb  4 13:02:49 1998
***************
*** 1,4 ****
--- 1,12 ----
  Changes in current version
+ 	- Improved result ranking in nph-search for occurence of search
+ 	  string in URL and titles (Bruce R. Lewis)
+ 	- Fix to LocalMapping code to remove problem where FD 0 (stdin)
+ 	  could be closed by mistake (Simon Wilkinson)
+ 	- Fixes to SGML.sum to handle problems with HTTP-EQUIV and spaces in
+ 	  META NAME attributes (Hrvoje Stipetic)
+ 	- Fix to broker where compression would unlink open files, and
+ 	  eventually the broker would run out of disk space (Hrvoje Stipetic)
  	- Fixes to sys_errlist definitions for Linux compatibility (Tim Riker)
  	- Fixed local file handling so that it doesn't hang if it tries to
  	  access a "special" file (Simon Wilkinson)
Index: components/broker/standard/WWW/DisplayObject.c
===================================================================
RCS file: /cvsroot/harvest/components/broker/standard/WWW/DisplayObject.c,v
retrieving revision 2.4
retrieving revision 2.5
diff -c -r2.4 -r2.5
*** /tmp/T0a16886	Wed Feb  4 13:03:07 1998
--- /tmp/T1a16886	Wed Feb  4 13:03:07 1998
***************
*** 1,4 ****
! static char rcsid[] = "$Id: DisplayObject.c,v 2.4 1997/12/11 16:14:33 sxw Exp $";
  /*
   *  DisplayObject.c - httpd-based CGI program that HTML-ifies a
   *  SOIF Object for clients.
--- 1,4 ----
! static char rcsid[] = "$Id: DisplayObject.c,v 2.5 1997/12/12 16:02:09 sxw Exp $";
  /*
   *  DisplayObject.c - httpd-based CGI program that HTML-ifies a
   *  SOIF Object for clients.
***************
*** 131,136 ****
--- 131,137 ----
  #include "util.h"
  #include "url.h"
  #include "template.h"
+ #include "autoconf.h"
  
  /*
   *  USE_DIRECTORY_LISTING - For Directory-Listing Broker support
***************
*** 215,221 ****
  int n;
  {
  	extern int sys_nerr;
! #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__bsdi__) && !defined(__linux__)
  	extern char *sys_errlist[];
  #endif
  
--- 216,222 ----
  int n;
  {
  	extern int sys_nerr;
! #ifdef NEED_SYS_ERRLIST
  	extern char *sys_errlist[];
  #endif
  
Index: components/broker/standard/WWW/nph-search.in
===================================================================
RCS file: /cvsroot/harvest/components/broker/standard/WWW/nph-search.in,v
retrieving revision 2.8
retrieving revision 2.9
diff -c -r2.8 -r2.9
*** /tmp/T0a16890	Wed Feb  4 13:03:08 1998
--- /tmp/T1a16890	Wed Feb  4 13:03:08 1998
***************
*** 8,14 ****
  #  $BQLOG = "/usr/local/etc/httpd/logs/BrokerQuery.log";
  $BQLOG = "/dev/null";
  
! $rcsid = '$Id: nph-search.in,v 2.8 1997/10/21 10:56:53 sxw Exp $';
  #######################################################################
  #
  #  nph-search - Customizable WWW Interface to the Harvest Broker
--- 8,14 ----
  #  $BQLOG = "/usr/local/etc/httpd/logs/BrokerQuery.log";
  $BQLOG = "/dev/null";
  
! $rcsid = '$Id: nph-search.in,v 2.9 1998/02/04 15:45:24 sxw Exp $';
  #######################################################################
  #
  #  nph-search - Customizable WWW Interface to the Harvest Broker
***************
*** 1012,1019 ****
  	$rank = 1;
  	split(/\n/,$object);
  	foreach $line (@_) {
! 	    $rank = $rank + 100 if (index($line,"title#") > 0);
! 	    $rank = $rank +  75 if (index($line,"url#") > 0);
  	    $rank = $rank +  70 if (index($line,"description#") > 0);
  	    $rank = $rank +  70 if (index($line,"subject#") > 0);
  	    $rank = $rank +  30 if (index($line,"headings#") > 0);
--- 1012,1019 ----
  	$rank = 1;
  	split(/\n/,$object);
  	foreach $line (@_) {
! 	    $rank = $rank + 120 - length($line) if (index($line,"title#") > 0);
! 	    $rank = $rank + 100 - length($line) if (index($line,"url#") > 0);
  	    $rank = $rank +  70 if (index($line,"description#") > 0);
  	    $rank = $rank +  70 if (index($line,"subject#") > 0);
  	    $rank = $rank +  30 if (index($line,"headings#") > 0);
Index: components/broker/swish/swish.h
===================================================================
RCS file: /cvsroot/harvest/components/broker/swish/swish.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** /tmp/T0a16894	Wed Feb  4 13:03:12 1998
--- /tmp/T1a16894	Wed Feb  4 13:03:12 1998
***************
*** 26,34 ****
  #define INDEXHEADER "# SWISH format 1.1 - SOIF"
  
  #define MAXFILELEN 1000
! #define MAXSTRLEN 1000
! #define MAXWORDLEN 1000
! #define MAXTITLELEN 200
  #define MAXSUFFIXLEN 10
  #define MAXENTLEN 10
  #define HASHSIZE 101
--- 26,34 ----
  #define INDEXHEADER "# SWISH format 1.1 - SOIF"
  
  #define MAXFILELEN 1000
! #define MAXSTRLEN 100
! #define MAXWORDLEN 40
! #define MAXTITLELEN 10
  #define MAXSUFFIXLEN 10
  #define MAXENTLEN 10
  #define HASHSIZE 101
Index: components/gatherer/standard/SGML/SGML.sum
===================================================================
RCS file: /cvsroot/harvest/components/gatherer/standard/SGML/SGML.sum,v
retrieving revision 2.6
retrieving revision 2.7
diff -c -r2.6 -r2.7
*** /tmp/T0a16898	Wed Feb  4 13:03:22 1998
--- /tmp/T1a16898	Wed Feb  4 13:03:22 1998
***************
*** 6,12 ****
  #
  #  Usage: SGML.sum [-d file.decl] [-t file.tbl] DOCTYPE [file]
  #
! #  $Id: SGML.sum,v 2.6 1997/09/16 18:17:04 sxw Exp $
  #
  #############################################################################
  #
--- 6,12 ----
  #
  #  Usage: SGML.sum [-d file.decl] [-t file.tbl] DOCTYPE [file]
  #
! #  $Id: SGML.sum,v 2.7 1998/01/29 17:29:13 sxw Exp $
  #
  #############################################################################
  #
***************
*** 302,314 ****
  	}
  
  	while (<SGMLS>) {
  		print STDERR "sgmls> $_" if ($debug);
  		if (/^\((.*)$/) {			# SGML start GI
  			$buf .= &parse_sgml ($1, %NEWVARS);
  			$ntags++;
  		}
  		last if (/^\)$tag$/);			# SGML end GI
! 		if (/^A(\S+) (\S+) (.*)$/) {		# SGML attr
  			next if ($2 eq 'IMPLIED');
  			$NEWVARS{$1} = $3;
  		}
--- 302,320 ----
  	}
  
  	while (<SGMLS>) {
+ 		# Hrvoje Stipetic HS - few changes in this block
+ 		# Optional: convert octal char codes to 8-bit chars
+ 		# (helps on systems without locale support)
+ 		s/\\{0}\\(\d\d\d)/sprintf("%c", oct $1)/ge;
  		print STDERR "sgmls> $_" if ($debug);
  		if (/^\((.*)$/) {			# SGML start GI
  			$buf .= &parse_sgml ($1, %NEWVARS);
  			$ntags++;
+ 			undef %NEWVARS;			# no undef - bug - HS
  		}
  		last if (/^\)$tag$/);			# SGML end GI
! 		if (/^A(\S+) (\S+) ?(.*)$/) {		# SGML attr 
! 			# There is no second space if IMPLIED - HS
  			next if ($2 eq 'IMPLIED');
  			$NEWVARS{$1} = $3;
  		}
***************
*** 383,394 ****
  	print STDERR "tagvar=$tagvar\n" if ($debug);
  	if (defined ($SOIF{$tagvar})) {
  		foreach $att (split (/,/, $SOIF{$tagvar})) {
! 			if ($att =~ /\$/) {		# $NAME
! 				$att =~ s/\$//;		# NAME
! 				$att = $VARS{$att} if defined $VARS{$att};
! 				$att =~ tr/A-Z/a-z/;
  			}
- 			push (@atts, $att);
  		}
  	}
  	@atts;
--- 389,404 ----
  	print STDERR "tagvar=$tagvar\n" if ($debug);
  	if (defined ($SOIF{$tagvar})) {
  		foreach $att (split (/,/, $SOIF{$tagvar})) {
! 			if ($att =~ /\$/) {		# $NAME, $HTTP-EQUIV
! 				$att =~ s/\$//;
! 				if (defined $VARS{$att}) {
! 					$att = $VARS{$att};
! 					$att =~ tr/A-Z/a-z/;
! 					push (@atts, $att);
! 				}
! 			} else {
! 				push (@atts, $att);
  			}
  		}
  	}
  	@atts;
Index: src/configure
===================================================================
RCS file: /cvsroot/harvest/src/configure,v
retrieving revision 2.4
retrieving revision 2.5
diff -c -r2.4 -r2.5
*** /tmp/T0a16902	Wed Feb  4 13:03:36 1998
--- /tmp/T1a16902	Wed Feb  4 13:03:36 1998
***************
*** 2730,2735 ****
--- 2730,2769 ----
  	RANLIB=":";
  fi
  
+ echo $ac_n "checking if sys_errlist is defined""... $ac_c" 1>&6
+ echo "configure:2735: checking if sys_errlist is defined" >&5
+ if eval "test \"`echo '$''{'harvest_cv_header_syserrlist'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   cat > conftest.$ac_ext <<EOF
+ #line 2740 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
+ int main() {
+ char *s = sys_errlist[0];
+ ; return 0; }
+ EOF
+ if { (eval echo configure:2747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   rm -rf conftest*
+   harvest_cv_header_syserrlist="yes"
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   harvest_cv_header_syserrlist="no"
+ fi
+ rm -f conftest*
+ fi
+ 
+ echo "$ac_t""$harvest_cv_header_syserrlist" 1>&6
+ 
+ if test "$harvest_cv_header_syserrlist" = "no" ; then
+ 	cat >> confdefs.h <<\EOF
+ #define NEED_SYS_ERRLIST 1
+ EOF
+ 
+ fi
+ 
  rm -f core 
  
  trap '' 1 2 15
Index: src/configure.in
===================================================================
RCS file: /cvsroot/harvest/src/configure.in,v
retrieving revision 2.5
retrieving revision 2.6
diff -c -r2.5 -r2.6
*** /tmp/T0a16906	Wed Feb  4 13:03:36 1998
--- /tmp/T1a16906	Wed Feb  4 13:03:36 1998
***************
*** 1,7 ****
  dnl
  dnl  Configuration input file for Harvest
  dnl
! dnl  $Id: configure.in,v 2.5 1997/11/26 18:33:47 sxw Exp $
  dnl
  
  AC_PREREQ(2.12)
--- 1,7 ----
  dnl
  dnl  Configuration input file for Harvest
  dnl
! dnl  $Id: configure.in,v 2.6 1997/12/12 16:02:12 sxw Exp $
  dnl
  
  AC_PREREQ(2.12)
***************
*** 209,214 ****
--- 209,223 ----
  dnl Try to see if we're on HP-UX or not
  if test "HP-UX" = "$XXMyOs"; then
  	RANLIB=":";
+ fi
+ 
+ dnl Check for sys_errlist
+ AC_CACHE_CHECK(if sys_errlist[] is defined, harvest_cv_header_syserrlist,
+ [AC_TRY_COMPILE([#include <stdio.h>], [char *s = sys_errlist[0];],
+ harvest_cv_header_syserrlist="yes", harvest_cv_header_syserrlist="no")])
+ 
+ if test "$harvest_cv_header_syserrlist" = "no" ; then
+ 	AC_DEFINE(NEED_SYS_ERRLIST)
  fi
  
  dnl Clean up after OSF/1 core dump bug
Index: src/broker/registry.c
===================================================================
RCS file: /cvsroot/harvest/src/broker/registry.c,v
retrieving revision 2.1
retrieving revision 2.2
diff -c -r2.1 -r2.2
*** /tmp/T0a16910	Wed Feb  4 13:03:37 1998
--- /tmp/T1a16910	Wed Feb  4 13:03:37 1998
***************
*** 1,4 ****
! static char rcsid[] = "$Id: registry.c,v 2.1 1997/03/21 17:20:10 sxw Exp $";
  /* 
   *  registry.c -- Registry Module, Keeps track of all objects in the Broker.
   *
--- 1,4 ----
! static char rcsid[] = "$Id: registry.c,v 2.2 1998/01/29 17:23:26 sxw Exp $";
  /* 
   *  registry.c -- Registry Module, Keeps track of all objects in the Broker.
   *
***************
*** 547,557 ****
  	back_fn = UTIL_make_admin_filename("Registry.old");
  	old_fn = UTIL_make_admin_filename("Registry");
  	new_fn = UTIL_make_admin_filename("Registry.compressing");
  	if (set_registry_file(new_fn) != SUCCESS) {
! 		xfree(back_fn);
! 		xfree(old_fn);
! 		xfree(new_fn);
! 		return ERROR;
  	}
  
  	/* Write a clean header */
--- 547,556 ----
  	back_fn = UTIL_make_admin_filename("Registry.old");
  	old_fn = UTIL_make_admin_filename("Registry");
  	new_fn = UTIL_make_admin_filename("Registry.compressing");
+ 	finish_registry_file();
  	if (set_registry_file(new_fn) != SUCCESS) {
! 		Log("An error occured while trying to open Registry.compressing .\n");
! 		goto reinstate_reg;
  	}
  
  	/* Write a clean header */
Index: src/common/include/autoconf.h.in
===================================================================
RCS file: /cvsroot/harvest/src/common/include/autoconf.h.in,v
retrieving revision 2.1
retrieving revision 2.2
diff -c -r2.1 -r2.2
*** /tmp/T0a16914	Wed Feb  4 13:03:47 1998
--- /tmp/T1a16914	Wed Feb  4 13:03:47 1998
***************
*** 195,197 ****
--- 195,200 ----
  
  /* Define if you have the ndbm library (-lndbm).  */
  #undef HAVE_LIBNDBM
+ 
+ /* Define if you need the sys_errlist definition */
+ #undef NEED_SYS_ERRLIST
Index: src/common/include/version.h
===================================================================
RCS file: /cvsroot/harvest/src/common/include/version.h,v
retrieving revision 2.4
retrieving revision 2.5
diff -c -r2.4 -r2.5
*** /tmp/T0a16918	Wed Feb  4 13:03:48 1998
--- /tmp/T1a16918	Wed Feb  4 13:03:48 1998
***************
*** 3,7 ****
   */
  #ifndef HARVEST_VERSION
  /* UPDATE VERSION HERE */
! #define HARVEST_VERSION	"1.5.16"
  #endif
--- 3,7 ----
   */
  #ifndef HARVEST_VERSION
  /* UPDATE VERSION HERE */
! #define HARVEST_VERSION	"1.5.17"
  #endif
Index: src/common/url/url.c
===================================================================
RCS file: /cvsroot/harvest/src/common/url/url.c,v
retrieving revision 2.2
retrieving revision 2.3
diff -c -r2.2 -r2.3
*** /tmp/T0a16922	Wed Feb  4 13:03:51 1998
--- /tmp/T1a16922	Wed Feb  4 13:03:51 1998
***************
*** 1,4 ****
! static char rcsid[] = "$Id: url.c,v 2.2 1997/12/09 17:08:43 sxw Exp $";
  /*
   *  url.c - URL processing code 
   *
--- 1,4 ----
! static char rcsid[] = "$Id: url.c,v 2.3 1998/02/04 14:39:06 sxw Exp $";
  /*
   *  url.c - URL processing code 
   *
***************
*** 320,326 ****
  			sprintf(local_filename, "%s%s", l->to, s);
  	  }
  	  if (local_filename) {
! 	                int fd;	    
  	    
  			/* no HTTP involved, so unescape URI */
  			rfc1738_unescape(local_filename);
--- 320,326 ----
  			sprintf(local_filename, "%s%s", l->to, s);
  	  }
  	  if (local_filename) {
! 	                int fd=-1;	    
  	    
  			/* no HTTP involved, so unescape URI */
  			rfc1738_unescape(local_filename);
Index: src/gatherer/essence/file/print.c
===================================================================
RCS file: /cvsroot/harvest/src/gatherer/essence/file/print.c,v
retrieving revision 2.2
retrieving revision 2.3
diff -c -r2.2 -r2.3
*** /tmp/T0a16926	Wed Feb  4 13:03:55 1998
--- /tmp/T1a16926	Wed Feb  4 13:03:55 1998
***************
*** 30,35 ****
--- 30,36 ----
  #include <unistd.h>
  #include <errno.h>
  #include "file.h"
+ #include "autoconf.h"
  
  #ifndef	lint
  static char *moduleid =
***************
*** 78,84 ****
       char *f, *a;
  {
  	extern int errno, sys_nerr;
! #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__bsdi__) && !defined(__linux__)
  	extern char *sys_errlist[];
  #endif
  	int myerrno;
--- 79,85 ----
       char *f, *a;
  {
  	extern int errno, sys_nerr;
! #ifdef NEED_SYS_ERRLIST
  	extern char *sys_errlist[];
  #endif
  	int myerrno;
