[patch] small lexer changes

Mark M. Hoffman mhoffman at lightlink.com
Mon Oct 7 21:53:24 CEST 2002


Hello:

Just checking in on my lunch hour.  Patchset below has 3 small mods:

1. Tighten specification for IP addresses.
2. Ignore ESMTP ids (in addition to SMTP ids)
3. Fix lexertest interface to lexer bug, which matters not now
   but will later.

If there are no objections, I'll commit these this evening.

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com

-------------- next part --------------
Index: lexer.l
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/lexer.l,v
retrieving revision 1.8
diff -u -2 -r1.8 lexer.l
--- lexer.l	7 Oct 2002 15:41:45 -0000	1.8
+++ lexer.l	7 Oct 2002 19:32:02 -0000
@@ -101,5 +101,5 @@
 
 BASE64		[A-Za-z0-9/+]
-IPADDR		[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
+IPADDR		[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
 MIME_BOUNDARY	^--[^[:blank:]\n]*$
 
@@ -267,5 +267,5 @@
 ^\tid\ .*					;
 
-SMTP\ id\ .*					;
+E?SMTP\ id\ .*					;
 boundary=.*					;
 name=\"						;
Index: lexertest.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/lexertest.c,v
retrieving revision 1.1
diff -u -2 -r1.1 lexertest.c
--- lexertest.c	7 Oct 2002 15:41:45 -0000	1.1
+++ lexertest.c	7 Oct 2002 19:32:02 -0000
@@ -5,6 +5,4 @@
 #include "lexer.h"
 
-extern char *yytext;
-
 /* exports */
 int passthrough;
@@ -16,5 +14,5 @@
     while ((t = get_token()) > 0)
     {
-	(void) printf("get_token: %d '%s'\n", t, yytext);
+	(void) printf("get_token: %d '%s'\n", t, yylval);
     }
     return 0;


More information about the bogofilter-dev mailing list