[cvs] bogofilter html.c,1.6,1.7
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-01-25 13:07:29
|
Update of /cvsroot/bogofilter/bogofilter In directory sc8-pr-cvs1:/tmp/cvs-serv12157 Modified Files: html.c Log Message: Allow solitary '>' as end of html comment. Index: html.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/html.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- html.c 24 Jan 2003 02:05:14 -0000 1.6 +++ html.c 25 Jan 2003 13:07:26 -0000 1.7 @@ -70,15 +70,19 @@ tmp += COMMENT_START_LEN-1; } } - if (c == '>' && memcmp(tmp+1-COMMENT_END_LEN, COMMENT_END, COMMENT_END_LEN) == 0) { - /* eat comment */ - size_t cnt = buf_used - tmp; - if (kill_html_comments) { - memcpy(buf_start, tmp+1, cnt + 1); - buf_used -= tmp + 1 - buf_start; + if (c == '>') { + /* Hack to only check for ">" rather than complete terminator "-->" */ + bool short_check = true; + if (short_check || memcmp(tmp+1-COMMENT_END_LEN, COMMENT_END, COMMENT_END_LEN) == 0) { + /* eat comment */ + size_t cnt = buf_used - tmp; + if (kill_html_comments) { + memcpy(buf_start, tmp+1, cnt + 1); + buf_used -= tmp + 1 - buf_start; + } + tmp = buf_start; + level -= 1; } - tmp = buf_start; - level -= 1; } if (level == 0) break; |