"fast find" fails to find the last file
Jef Poskanzer
pokey at well.UUCP
Wed Apr 26 04:15:45 AEST 1989
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 ----
More information about the Comp.sources.bugs
mailing list