Skip to main content.
home | support | download

Back to List Archive

Patch for swish-e 1.3.2 fs.c

From: <D.J.Adams(at)not-real.soton.ac.uk>
Date: Wed May 17 2000 - 14:00:22 GMT
I've just joined this list, and I have a little patch for you.

I found that when compiled under Solaris 2.7 and run with verbose=3 then
swish 1.3.2 gave an absurd number for the words found in files it could
not open because of permissions.

This little patch fixes that and gives improved diagnostics:

*** fs.c.old	Wed Jan  6 18:27:02 1999
--- fs.c	Wed May 17 14:33:31 2000
***************
*** 308,313 ****
--- 308,314 ----
  	char *s;
  	FILE *fp;
  	
+ 	wordcount = -1;
  	if (e != NULL) {
  		printfiles(e->left);
  		if (verbose == 3) {
***************
*** 322,331 ****
  			fclose(fp);
  		}
  		if (verbose == 3) {
! 			if (wordcount)
  				printf(" (%d words)\n", wordcount);
! 			else
  				printf(" (no words)\n");
  			fflush(stdout);
  		}
  		free(e->filename);
--- 323,333 ----
  			fclose(fp);
  		}
  		if (verbose == 3) {
! 			if (wordcount > 0) {
  				printf(" (%d words)\n", wordcount);
! 			} else if (wordcount == 0) {
  				printf(" (no words)\n");
+ 			} else { printf(" (not opened)\n"); }
  			fflush(stdout);
  		}
  		free(e->filename);


-- 
 
David J Adams
<D.J.Adams@soton.ac.uk>
Computing Services
University of Southampton
Received on Wed May 17 10:02:49 2000