applyfilter.c (leafnode-1.11.12.tar.bz2) | : | applyfilter.c (leafnode-1.12.0.tar.xz) | ||
---|---|---|---|---|
/* | /* | |||
* apply filter file to all files in a newsgroup | * apply filter file to all files in a newsgroup | |||
* | * | |||
* Written by Cornelius Krasel <krasel@wpxx02.toxi.uni-wuerzburg.de>. | * Written by Cornelius Krasel <krasel@wpxx02.toxi.uni-wuerzburg.de>. | |||
* Copyright 1999. | * Copyright 1999. | |||
* | * | |||
* Modified and copyright of the modifications 2002 by Matthias Andree | * Modified and copyright of the modifications 2002 by Matthias Andree | |||
* <matthias.andree@gmx.de> and Ralf Wildenhues <ralf.wildenhues@gmx.de> | * <matthias.andree@gmx.de> and Ralf Wildenhues <ralf.wildenhues@gmx.de> | |||
* | * | |||
* Modified and copyright of the modifications 2002 - 2021 by Matthias Andree | ||||
* | ||||
* See file COPYING for restrictions on the use of this software. | * See file COPYING for restrictions on the use of this software. | |||
*/ | */ | |||
#include "leafnode.h" | #include "leafnode.h" | |||
#include "ln_log.h" | #include "ln_log.h" | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <ctype.h> | #include <ctype.h> | |||
#include "system.h" | #include "system.h" | |||
skipping to change at line 225 | skipping to change at line 227 | |||
printf("%s\n", de->d_name); | printf("%s\n", de->d_name); | |||
} | } | |||
} | } | |||
if ((f = fopen(de->d_name, "r")) != NULL | if ((f = fopen(de->d_name, "r")) != NULL | |||
&& fstat(fileno(f), &st) == 0 | && fstat(fileno(f), &st) == 0 | |||
&& S_ISREG(st.st_mode)) | && S_ISREG(st.st_mode)) | |||
{ | { | |||
switch (readheaders(f, de->d_name, &l, &lsize)) { | switch (readheaders(f, de->d_name, &l, &lsize)) { | |||
case 0: | case 0: | |||
case -2: | case -2: | |||
score = dofilter(l); | score = dofilter((unsigned char *)l); | |||
break; | break; | |||
case -1: | case -1: | |||
score = -1; /* FIXME: how to handle read error? */ | score = -1; /* FIXME: how to handle read error? */ | |||
break; | break; | |||
default: | default: | |||
/* this branch will never be executed, but | /* this branch will never be executed, but | |||
* eliminates a compiler warning */ | * eliminates a compiler warning */ | |||
score = 0; | score = 0; | |||
break; | break; | |||
} | } | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added |