comparison src/configfile.c @ 212:21200ce10e68 noffle

[svn] filter post-status=mod|yes|no.
author mirkol
date Thu, 22 Nov 2001 12:04:45 +0000
parents 24d4cd032da5
children bf290632d29e
comparison
equal deleted inserted replaced
211:de96be6946a0 212:21200ce10e68
4 The following macros must be set, when compiling this file: 4 The following macros must be set, when compiling this file:
5 CONFIGFILE 5 CONFIGFILE
6 SPOOLDIR 6 SPOOLDIR
7 VERSION 7 VERSION
8 8
9 $Id: configfile.c 316 2001-10-31 11:44:53Z bears $ 9 $Id: configfile.c 331 2001-11-22 12:04:45Z mirkol $
10 */ 10 */
11 11
12 #if HAVE_CONFIG_H 12 #if HAVE_CONFIG_H
13 #include <config.h> 13 #include <config.h>
14 #endif 14 #endif
740 rule.type = RULE_LINES_LT; 740 rule.type = RULE_LINES_LT;
741 else if ( strcmp( ruleName, "refs" ) == 0 ) 741 else if ( strcmp( ruleName, "refs" ) == 0 )
742 rule.type = RULE_NOREFS_LT; 742 rule.type = RULE_NOREFS_LT;
743 else if ( strcmp( ruleName, "xposts" ) == 0 ) 743 else if ( strcmp( ruleName, "xposts" ) == 0 )
744 rule.type = RULE_XPOSTS_LT; 744 rule.type = RULE_XPOSTS_LT;
745 else if ( strcmp( ruleName, "post-status" ) == 0 )
746 rule.type = RULE_POST_STATUS;
745 else if ( strcmp( ruleName, "action" ) != 0 ) 747 else if ( strcmp( ruleName, "action" ) != 0 )
746 goto synErr; 748 goto synErr;
747 749
748 if ( rule.type == RULE_BYTES_LT || 750 if ( rule.type == RULE_BYTES_LT ||
749 rule.type == RULE_LINES_LT || 751 rule.type == RULE_LINES_LT ||
791 else if ( rule.type >= RULE_SUBJECT && rule.type <= RULE_MSGID ) 793 else if ( rule.type >= RULE_SUBJECT && rule.type <= RULE_MSGID )
792 { 794 {
793 if ( regcomp( &rule.data.regex, value, REG_EXTENDED ) != 0 ) 795 if ( regcomp( &rule.data.regex, value, REG_EXTENDED ) != 0 )
794 goto synErr; 796 goto synErr;
795 } 797 }
798 else if (rule.type == RULE_POST_STATUS )
799 if ( ( strcmp( value, "yes" ) == 0 ) || \
800 ( strcmp( value, "no" ) == 0 ) || \
801 ( strncmp( value, "mod", 3 ) == 0 ) )
802 /* no need to type out "moderated" */
803 rule.data.postAllow = value[0]; /* 'y','n' or 'm' */
804 else
805 goto synErr;
796 else 806 else
797 { 807 {
798 char * endVal; 808 char * endVal;
799 int suffix; 809 int suffix;
800 810