From 72fc2c255f364507fbc87717cd54b9541f2f5189 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 31 Jul 1999 21:41:50 +0000 Subject: The big lexer fix. svn path=/trunk/; revision=2519 --- NEWS | 4 +++- fetchmail-FAQ.html | 29 ++++++++++++++--------------- rcfile_l.l | 23 +++++++++++++++++------ 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/NEWS b/NEWS index 14938793..639152f9 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,9 @@ fetchmail-5.0.6 (): * Russion internationalization support (but I couldn't read the contributor name in the headers!) * Update of the French internationalization support by Guy Brand. -* Fix for the `nokeep' problem by Robert de Bath. +* Lexer fix for the `nokeep' problem by Robert de Bath. +* Lexer states added to tell the lexer to return a string after a + `username' or `password' keyword, courtesy of Brian Boutel. * Interface option fix from Bill Currie. There are 267 people on fetchmail-friends and 420 on fetchmail-announce. diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index 1b9693fe..5aaecd29 100644 --- a/fetchmail-FAQ.html +++ b/fetchmail-FAQ.html @@ -10,7 +10,7 @@
Back to Fetchmail Home Page To Site Map -$Date: 1999/07/31 20:44:54 $ +$Date: 1999/07/31 21:41:50 $

Frequently Asked Questions About Fetchmail

@@ -666,27 +666,26 @@ Do similarly for any `monitor' or `batchlimit' options

F2. The .fetchmailrc parser won't accept my all-numeric user name.

-So put string quotes around it. :-)

+Either upgrade to a post-5.0.5 fetchmail or put string quotes around it. :-)

-The configuration file parser treats any all-numeric token as a -number, which will confuse it when it's expecting a name. String -quoting forces the token's class.

+The configuration file parser in older fetchmail versions treated any +all-numeric token as a number, which confused it when it was +expecting a name. String quoting forces the token's class.

+ +The lexical analyzer in 5.0.6 and beyond is smarter and assumes +any token following "username" or "password" is a string.


F3. The .fetchmailrc parser won't accept my host or username beginning with `no'.

-You're caught in an unfortunate crack between the newer-style syntax -for negated options (`no keep', `no rewrite' etc.) and the older style -run-on syntax (`nokeep', `norewrite' etc.).

+See F2 You're caught in an unfortunate crack between +the newer-style syntax for negated options (`no keep', `no rewrite' +etc.) and the older style run-on syntax (`nokeep', `norewrite' +etc.).

-You can work around this easily. Just put string quotes around your +Upgrade to a 5.0.6 or later fetchmail, or put string quotes around your token.

-I haven't fixed this because there is no good fix for it short of -implementing a token pushback stack in the lexer. That's more -additional complexity than I'm willing to add to banish a very -marginal bug with an easy workaround.

-


F4. I'm migrating from popclient. How do I need to modify my .poprc?

@@ -2428,7 +2427,7 @@ inactivity timeout.

Back to Fetchmail Home Page To Site Map -$Date: 1999/07/31 20:44:54 $ +$Date: 1999/07/31 21:41:50 $

Eric S. Raymond <esr@snark.thyrsus.com>
diff --git a/rcfile_l.l b/rcfile_l.l index e5c4fba9..365c6a05 100644 --- a/rcfile_l.l +++ b/rcfile_l.l @@ -19,8 +19,19 @@ int prc_lineno = 1; %a 4000 %p 3000 +%s NAME + %% +[^=;:, \t\r\n\"\']+ { + char buf[MSGBUFSIZE]; + + escapes(yytext, buf); + yylval.sval = (char *) xstrdup(buf); + BEGIN(0); + return STRING; + } + set { return SET; } logfile { return LOGFILE; } idfile { return IDFILE; } @@ -50,8 +61,8 @@ timeout { return TIMEOUT;} envelope { return ENVELOPE; } qvirtual { return QVIRTUAL; } -user(name)? { return USERNAME; } -pass(word)? { return PASSWORD; } +user(name)? {BEGIN(NAME); return USERNAME; } +pass(word)? {BEGIN(NAME); return PASSWORD; } folder(s)? { return FOLDER; } smtp(host)? { return SMTPHOST; } smtpaddress { return SMTPADDRESS; } @@ -71,12 +82,12 @@ fetchlimit { return FETCHLIMIT; } expunge { return EXPUNGE; } properties { return PROPERTIES; } -is { return IS; } +is { BEGIN(NAME); return IS; } here { return HERE; } there { return THERE; } -to { return TO; } -= { return MAP; } -"*" { return WILDCARD; } +to { BEGIN(NAME); return TO; } += { BEGIN(NAME); return MAP; } +"*" { BEGIN(0); return WILDCARD; } nobouncemail | nouidl | -- cgit v1.2.3