1: # include "stdio.h" 2: #include "refer.h" 3: extern long indexdate; 4: extern char usedir[]; 5: 6: baddrop(nf, nitem) 7: { 8: /* checks list of drops for real bad drops */ 9: int i, g, j, na, len; 10: long lp; 11: char res[TAGLEN], *ar[50], output[TXTLEN]; 12: char *s; 13: 14: for (i=g=0; i<nf; i++) 15: { 16: lp = iflong ? master.b[i] : master.a[i]; 17: fseek (fc, lp, 0); 18: fgets( res, TAGLEN, fc); 19: for(s=res; *s; s++) 20: if (*s == ';' || *s == '\n') 21: { 22: *s=0; 23: break; 24: } 25: len = findline (res, output, TXTLEN, indexdate); 26: if (len==0) 27: continue; 28: na=0; 29: ar[na++] = "fgrep"; 30: ar[na++] = "-r"; 31: ar[na++] = "-n"; 32: ar[na++] = nitem; 33: ar[na++] = "-i"; 34: ar[na++] = output; 35: ar[na++] = len; 36: for(j=0; j<nitem; j++) 37: ar[na++] = qitem[j]; 38: if (fgrep(na, ar)==0) 39: { 40: if (iflong) 41: master.b[g++] = master.b[i]; 42: else 43: master.a[g++] = master.a[i]; 44: if (g>1) { 45: if (g==2) { 46: fprintf(stderr, 47: "%s: Multiple matches for '%s'", 48: Ifile,sinput); 49: fprintf(stderr,"in %s\n",Index); 50: title(text); 51: } 52: title(output); 53: } else { 54: if (res[0]=='/' || usedir[0]==0) 55: strcpy(tagout, res); 56: else 57: sprintf(tagout, "%s/%s", usedir, res); 58: strcpy (text, output); 59: } 60: } 61: } 62: return(g); 63: }