🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #2192

"fast find" fails to find the last file

#2192
From: Jef Poskanzer
Date: Tue, 25 Apr 1989 18:15
43 lines
1473 bytes
Description:

Fast find exits its loop a bit too early -- it doesn't check whether
the last line it reads from find.codes matches the pattern.

Repeat-By:

Find out what the last line in your find.codes is.  On my system it
is currently "/vmunix".  Try a fast find on it, e.g. "find /vmunix".

Fix:

*** find.c.old	Sat Apr 22 18:38:06 1989
--- find.c	Sat Apr 22 18:39:06 1989
***************
*** 1209,1216 ****
  		globflag = NO;
  	patend = patprep ( pathpart );
  
! 	c = getc ( fp );
! 	for ( ; ; ) {
  
  		count += ( (c == ESCCODE) ? getw ( fp ) : c ) - OFFSET;
  
--- 1209,1215 ----
  		globflag = NO;
  	patend = patprep ( pathpart );
  
! 	for ( c = getc ( fp ); c != EOF; ) {
  
  		count += ( (c == ESCCODE) ? getw ( fp ) : c ) - OFFSET;
  
***************
*** 1219,1226 ****
  				*p++ = c;
  			else		/* bigrams are parity-marked */
  				*p++ = bigram1[c & 0177],  *p++ = bigram2[c & 0177];
- 		if ( c == EOF )
- 			break;
  		*p-- = NULL;
  		cutoff = ( found ? path : path + count);
  
--- 1218,1223 ----
Technical Details
Message-ID: <11413@well.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ames!oliveb!apple!well!pokey

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ames!oliveb!apple!well!pokey
From: pokey@well.UUCP (Jef Poskanzer)
Newsgroups: comp.sources.bugs
Subject: "fast find" fails to find the last file
Message-ID: <11413@well.UUCP>
Date: 25 Apr 89 18:15:45 GMT
Reply-To: Jef Poskanzer <jef@helios.ee.lbl.gov>
Organization: Paratheo-Anametamystikhood Of Eris Esoteric, Ada Lovelace Cabal
Lines: 43