[cvs] bogofilter/src lexer_v3.l,1.158,1.159
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: David R. <re...@us...> - 2005-06-25 23:21:15
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26706 Modified Files: lexer_v3.l Log Message: Fix multiple decoding of encoded tokens. Index: lexer_v3.l =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/lexer_v3.l,v retrieving revision 1.158 retrieving revision 1.159 diff -u -d -r1.158 -r1.159 --- lexer_v3.l 25 Jun 2005 16:50:38 -0000 1.158 +++ lexer_v3.l 25 Jun 2005 23:21:06 -0000 1.159 @@ -227,9 +227,13 @@ <BOGO_LEX>^\"{BOGOLEX_TOKEN}\"{NUM_NUM}$ { return BOGO_LEX_LINE; } <BOGO_LEX>\n { lineno += 1; } -<INITIAL>{ENCODED_TOKEN} { word_t *raw = yy_text(); - word_t *dec = text_decode(raw); - yy_unput(dec->text, dec->leng); +<INITIAL>{ENCODED_TOKEN} { static int processed = 0; + if (processed == lineno) { + word_t *raw = yy_text(); + word_t *dec = text_decode(raw); + yy_unput(dec->text, dec->leng); + processed = lineno; + } } <INITIAL>^(To|CC|From|Return-Path|Subject|Received): { set_tag(yytext); } |