[Bogofilter-cvs] bogofilter lexer_l.l,1.2,1.3
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <m-...@us...> - 2002-09-16 18:58:21
|
Update of /cvsroot/bogofilter/bogofilter In directory usw-pr-cvs1:/tmp/cvs-serv27477 Modified Files: lexer_l.l Log Message: Fix 'last line occasionally emitted twice' bug, cleaning up our yyinput(). Index: lexer_l.l =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/lexer_l.l,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lexer_l.l 15 Sep 2002 15:52:24 -0000 1.2 --- lexer_l.l 16 Sep 2002 18:58:14 -0000 1.3 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ */ /* $Log$ + /* Revision 1.3 2002/09/16 18:58:14 m-a + /* Fix 'last line occasionally emitted twice' bug, cleaning up our yyinput(). + /* /* Revision 1.2 2002/09/15 15:52:24 relson /* *************** *** 63,70 **** char *returned; ! if ((returned = fgets((char *)buf, max_size, yyin)) < 0) ! { ! fprintf(stderr, "input in flex scanner failed\n"); ! exit(2); } --- 66,77 ---- char *returned; ! returned = fgets((char *)buf, max_size, yyin); ! if (returned == NULL) { ! if (ferror(yyin)) { ! fprintf(stderr, "input in flex scanner failed\n"); ! exit(2); ! } else { ! return 0; ! } } *************** *** 81,88 **** } ! if (returned == NULL) ! return(0); ! else ! return(strlen(returned)); } --- 88,92 ---- } ! return(strlen(returned)); } |