Fixed filefind search filenames case insensitive

This commit is contained in:
Michiel Broek 2007-10-15 11:11:47 +00:00
parent 4100534e54
commit 3d96a5cb17
2 changed files with 11 additions and 14 deletions

View File

@ -16,9 +16,13 @@ v0.91.13 12-Oct-2007
Added GeoIP support. Added GeoIP support.
Removed a lot of debug logging. Removed a lot of debug logging.
mbaff:
Fixed filefind search filenames case insensitive.
mbsetup: mbsetup:
Blocked selection of FTN and Usenet moderated message areas. Blocked selection of FTN and Usenet moderated message areas.
Changed the F-PROT scanner name into fpscan. Changed the F-PROT scanner name into fpscan.
Removed not used setting for filefind.
v0.91.12 24-Sep-2007 - 12-Oct-2007 v0.91.12 24-Sep-2007 - 12-Oct-2007

View File

@ -256,15 +256,9 @@ void ScanFiles(ff_list *tmp)
int filepos, filepos1 = 0, filepos2 = 0, filepos3 = 0, filepos4 = 0; int filepos, filepos1 = 0, filepos2 = 0, filepos3 = 0, filepos4 = 0;
struct _fdbarea *fdb_area = NULL; struct _fdbarea *fdb_area = NULL;
/*
* Check for local generated requests.
*/
if (!CFG.ct_LocalRep) {
}
kwd = calloc(81, sizeof(char)); kwd = calloc(81, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
BigDesc = calloc(1230, sizeof(char)); BigDesc = calloc(1231, sizeof(char));
snprintf(temp, PATH_MAX, "%s (%d:%d/%d.%d)", tmp->from, tmp->zone, tmp->net, tmp->node, tmp->point); snprintf(temp, PATH_MAX, "%s (%d:%d/%d.%d)", tmp->from, tmp->zone, tmp->net, tmp->node, tmp->point);
Syslog('+', "ff: %s [%s]", temp, tmp->subject); Syslog('+', "ff: %s [%s]", temp, tmp->subject);
@ -317,7 +311,7 @@ void ScanFiles(ff_list *tmp)
temp[j] = temp[j+i+1]; temp[j] = temp[j+i+1];
temp[j] = '\0'; temp[j] = '\0';
} else { } else {
snprintf(kwd, 81, "%s", temp); snprintf(kwd, 80, "%s", temp);
temp[0] = '\0'; temp[0] = '\0';
} }
@ -331,22 +325,21 @@ void ScanFiles(ff_list *tmp)
kwd[i-1] = kwd[i]; kwd[i-1] = kwd[i];
kwd[i-1] = '\0'; kwd[i-1] = '\0';
} }
tl(kwd);
if (strlen(kwd) > scanmgr.keywordlen) { if (strlen(kwd) > scanmgr.keywordlen) {
if (strstr(fdb.Name, kwd) != NULL) { if ((strcasestr(fdb.Name, kwd) != NULL) || (strcasestr(fdb.LName, kwd) != NULL)) {
Found = TRUE; Found = TRUE;
Syslog('m', "Found %s in %s in filename", kwd, fdb.Name); Syslog('m', "Found '%s' in %s in filename", kwd, fdb.LName);
} }
if (keywrd && (strstr(tl(BigDesc), kwd) != NULL)) { if (keywrd && (strcasestr(BigDesc, kwd) != NULL)) {
Found = TRUE; Found = TRUE;
Syslog('m', "Found %s in %s in description", kwd, fdb.Name); Syslog('m', "Found '%s' in %s in description", kwd, fdb.LName);
} }
} }
} /* while (strlen(temp) && (!Found)) */ } /* while (strlen(temp) && (!Found)) */
if (Found) { if (Found) {
found++; found++;
Syslog('m', "Found %s area %d", fdb.Name, areanr); Syslog('m', "Found %s area %d", fdb.LName, areanr);
fill_rflist(&rfl, fdb.Name, areanr); fill_rflist(&rfl, fdb.Name, areanr);
} }
strcpy(BigDesc, ""); strcpy(BigDesc, "");