[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for Glimpse



Thanks very much!  This is obviously a good fix to include, and it is now
checked in for the next release.  

--Golda

At 12:39 PM 1/29/00 +0100, Kang-Jin Lee wrote:
>Hi,
>
>I got this patch from Dan Riley <dsr@mail.lns.cornell.edu>.
>
>kj
>
>Hopefully this fixes problems with glimpseserver crashing or not answering
>to search requests.
>----------------------------------------------------
>
>--- agrep/agrep.c.orig	Wed Apr 29 17:33:50 1998
>+++ agrep/agrep.c	Sat Jul 17 16:36:32 1999
>@@ -2815,6 +2815,7 @@
> 				if (PAT_BUFFER == ON) {
> 					fprintf(stderr, "%s: multiple -m options\n", Progname);
> 					if (multibuf != NULL) free(multibuf);
>+					multibuf = NULL;
> 					multilen = 0;
> 					if (!EXITONERROR) {
> 						errno = AGREP_ERROR;
>@@ -2841,6 +2842,7 @@
> 				if ((argv[0] == NULL) || ((multilen = strlen(argv[0])) <= 0)) {
> 					/* A -m option with a NULL or empty pattern buffer is a NO-OP:
stupid, but simplifies glimpse :-) */
> 					PAT_BUFFER = OFF;
>+					if (multibuf != NULL) free(multibuf);
> 					multilen = 0;
> 					multibuf = NULL;
> 				}
>@@ -2851,6 +2853,7 @@
> 					)
> 					if (prepf(-1, multibuf, multilen) <= -1) {
> 						free(multibuf);
>+						multibuf = NULL;
> 						multilen = 0;
> 						PAT_BUFFER = OFF;
> 						fprintf(stderr, "%s: error in processing pattern buffer\n", Progname);
>@@ -3317,6 +3320,7 @@
> 			AParse = 0;
> 			PAT_BUFFER = 0;
> 			if (multibuf != NULL) free(multibuf);	/* this was allocated for arbit
booleans, not multipattern search */
>+			multibuf = NULL;
> 			multilen = 0;
> 			/* Cannot free multifd here since that is always allocated for
multipattern search */
> 			return -1;
>-- 
>Dan Riley                                         dsr@mail.lns.cornell.edu
>Wilson Lab, Cornell University      <URL:http://www.lns.cornell.edu/~dsr/>
>    "History teaches us that days like this are best spent in bed"
>
>----------------------------------------------------
>
>-- 
>Kang-Jin Lee
>lee@arco.met.fu-berlin.de
>
>
------------------------------------------------------------
Golda Velez         gvelez@tucson.com	        520-620-6878
Internet Workshop                          http://tucson.com
Webglimpse Search Software             http://webglimpse.net
		~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Help organize the world - index your own corner of the web