From bf79edd111d44336c4fbf15bb8dfa84203a13882 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 1 Aug 1999 02:06:04 +0000 Subject: Fix broken parsing. svn path=/trunk/; revision=2521 --- rcfile_l.l | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/rcfile_l.l b/rcfile_l.l index 365c6a05..b7f22949 100644 --- a/rcfile_l.l +++ b/rcfile_l.l @@ -23,7 +23,26 @@ int prc_lineno = 1; %% -[^=;:, \t\r\n\"\']+ { +\"[^\"]*\" { + char buf[MSGBUFSIZE]; + + yytext[strlen(yytext)-1] = '\0'; + escapes(yytext+1, buf); + yylval.sval = (char *) xstrdup(buf); + BEGIN(0); + return STRING; + } +\'[^\']*\' { + char buf[MSGBUFSIZE]; + + yytext[strlen(yytext)-1] = '\0'; + escapes(yytext+1, buf); + yylval.sval = (char *) xstrdup(buf); + BEGIN(0); + return STRING; + } + +[^=;:, \t\r\n]+ { char buf[MSGBUFSIZE]; escapes(yytext, buf); @@ -142,32 +161,10 @@ options {/* EMPTY */} (etrn)|(ETRN) { yylval.proto = P_ETRN; return PROTO; } (kpop)|(KPOP) { return KPOP; } -remote(folder)? { - fprintf(stderr, - "fetchmail: `remote' keyword is gone, use `folder'\n"); - } - - (#.*)?\\?\n { prc_lineno++; } /* newline is ignored */ [0-9]+ { yylval.number = atoi(yytext); return NUMBER; } -\"[^\"]*\" { - char buf[MSGBUFSIZE]; - - yytext[strlen(yytext)-1] = '\0'; - escapes(yytext+1, buf); - yylval.sval = (char *) xstrdup(buf); - return STRING; - } -\'[^\']*\' { - char buf[MSGBUFSIZE]; - - yytext[strlen(yytext)-1] = '\0'; - escapes(yytext+1, buf); - yylval.sval = (char *) xstrdup(buf); - return STRING; - } [^=;:, \t\r\n]+ { char buf[MSGBUFSIZE]; -- cgit v1.2.3