]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Nicer error for typo in include directive.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 6 Feb 2009 08:53:00 +0000 (08:53 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 6 Feb 2009 08:53:00 +0000 (08:53 +0000)
git-svn-id: file:///svn/unbound/trunk@1459 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/configlexer.c
util/configlexer.lex

index 5ad6aa6c8f0d458c4f3fdfb4c0778ee82739fad3..6c1602533a3356f0bebef6b852a03267ac30c8a8 100644 (file)
@@ -1,6 +1,8 @@
 6 February 2009: Wouter
        - contrib contains specfile for fedora 1.2.1 (from Paul Wouters).
        - iana portlist updated.
+       - fixup EOL in include directive (reported by Paul Wouters).
+         You can no longer specify newlines in the names of included files.
 
 5 February 2009: Wouter
        - ldns 1.5.0 rc as tarball included.
index 920c839abdb9e73985fe6b07626ca3a242a23646..e2d5203bc08568c621993c03d0c77853703ca955 100644 (file)
@@ -2223,11 +2223,12 @@ case 108:
 /* rule 108 can match eol */
 YY_RULE_SETUP
 #line 261 "util/configlexer.lex"
-{ cfg_parser->line++; yymore(); }
+{ yyerror("EOL before \" in include name"); 
+                                 cfg_parser->line++; BEGIN(INITIAL); }
        YY_BREAK
 case 109:
 YY_RULE_SETUP
-#line 262 "util/configlexer.lex"
+#line 263 "util/configlexer.lex"
 {
        LEXOUT(("IQE "));
        yytext[yyleng - 1] = '\0';
@@ -2236,7 +2237,7 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case YY_STATE_EOF(INITIAL):
-#line 268 "util/configlexer.lex"
+#line 269 "util/configlexer.lex"
 {
        yy_set_bol(1); /* Set beginning of line, so "^" rules match.  */
        if (config_include_stack_ptr == 0) {
@@ -2249,16 +2250,16 @@ case YY_STATE_EOF(INITIAL):
        YY_BREAK
 case 110:
 YY_RULE_SETUP
-#line 278 "util/configlexer.lex"
+#line 279 "util/configlexer.lex"
 { LEXOUT(("unquotedstr(%s) ", yytext)); 
                        yylval.str = strdup(yytext); return STRING; }
        YY_BREAK
 case 111:
 YY_RULE_SETUP
-#line 281 "util/configlexer.lex"
+#line 282 "util/configlexer.lex"
 ECHO;
        YY_BREAK
-#line 2261 "<stdout>"
+#line 2262 "<stdout>"
 
        case YY_END_OF_BUFFER:
                {
@@ -3217,7 +3218,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 281 "util/configlexer.lex"
+#line 282 "util/configlexer.lex"
 
 
 
index 002848f69cb1a5a2d9769948b8ceb9c8684536b4..23864637f35f45586b732b7b8ced7aad4687e509 100644 (file)
@@ -258,7 +258,8 @@ include{COLON}              { LEXOUT(("v(%s) ", yytext)); BEGIN(include); }
         BEGIN(INITIAL);
 }
 <include_quoted>{DQANY}*       { LEXOUT(("ISTR(%s) ", yytext)); yymore(); }
-<include_quoted>{NEWLINE}      { cfg_parser->line++; yymore(); }
+<include_quoted>{NEWLINE}      { yyerror("EOL before \" in include name"); 
+                                 cfg_parser->line++; BEGIN(INITIAL); }
 <include_quoted>\"     {
        LEXOUT(("IQE "));
        yytext[yyleng - 1] = '\0';