[cvs] bogofilter/src lexer.h,1.12,1.13 lexer_v3.l,1.28,1.29 msgcounts.c,1.9,1.10 msgcounts.h,1.6,1.7
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <m-...@us...> - 2003-06-16 11:56:15
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1:/tmp/cvs-serv8328/src Modified Files: lexer.h lexer_v3.l msgcounts.c msgcounts.h token.c Log Message: Fix some Solaris related issues, among them a SIGSEGV in t.bulkmode. Index: lexer.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/lexer.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- lexer.h 14 Jun 2003 22:58:28 -0000 1.12 +++ lexer.h 16 Jun 2003 11:56:12 -0000 1.13 @@ -46,7 +46,7 @@ typedef struct lexer_s { yylex_t *yylex; char **yytext; - size_t *yyleng; + int *yyleng; } lexer_t; extern lexer_t *lexer; Index: lexer_v3.l =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/lexer_v3.l,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- lexer_v3.l 6 Jun 2003 01:50:53 -0000 1.28 +++ lexer_v3.l 16 Jun 2003 11:56:12 -0000 1.29 @@ -157,7 +157,7 @@ %% -^From\ { if (msg_header && is_from(yytext, yyleng)) { +^From\ { if (msg_header && is_from((const unsigned char *)yytext, yyleng)) { BEGIN(INITIAL); return FROM; } else { @@ -167,7 +167,7 @@ <INITIAL,BOGO_LEX>{MSG_COUNT}{NUM_NUM} { if (lineno == 0) { BEGIN(BOGO_LEX); - set_msg_counts(index(yytext, ' ') + 1); + set_msg_counts(strchr(yytext, ' ') + 1); } return MSG_COUNT_LINE; } Index: msgcounts.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/msgcounts.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- msgcounts.c 15 Jun 2003 21:55:26 -0000 1.9 +++ msgcounts.c 16 Jun 2003 11:56:12 -0000 1.10 @@ -24,7 +24,7 @@ /* Globals */ char msg_count_chars[MSG_COUNT_MAX_LEN]; -size_t msg_count_leng = MSG_COUNT_MAX_LEN; +int msg_count_leng = MSG_COUNT_MAX_LEN; char *msg_count_text = msg_count_chars; const char *msg_count_header = "\".MSG_COUNT\""; @@ -77,6 +77,6 @@ void set_msg_counts(char *s) { msgs_bad = atoi(s); - s = index(s, ' ') + 1; + s = strchr(s, ' ') + 1; msgs_good = atoi(s); } Index: msgcounts.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/msgcounts.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- msgcounts.h 15 Jun 2003 18:37:04 -0000 1.6 +++ msgcounts.h 16 Jun 2003 11:56:12 -0000 1.7 @@ -20,7 +20,7 @@ #define MSG_COUNT_MAX_LEN 100 extern yylex_t msg_count_lex; extern char *msg_count_text; -extern size_t msg_count_leng; +extern int msg_count_leng; extern long msgs_good; extern long msgs_bad; Index: token.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/token.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- token.c 15 Jun 2003 18:37:04 -0000 1.33 +++ token.c 16 Jun 2003 11:56:12 -0000 1.34 @@ -67,7 +67,7 @@ while (!done) { class = lexer->yylex(); yylval->leng = *lexer->yyleng; - yylval->text = *lexer->yytext; + yylval->text = (unsigned char *)(*lexer->yytext); if (DEBUG_TEXT(2)) { word_puts(yylval, 0, dbgout); |