X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=conffile.fl;h=1747be26fb321407edeb44ed124c644c13d80ee7;hp=66caa1f04cb9d789aa3f499cc28fbf948ff52dd3;hb=59938e0ed0c8ac267c3715a25a0a3ed27f7a7e47;hpb=4f5e39ecfaa49376b0a5c3a4c384e91a828c1105 diff --git a/conffile.fl b/conffile.fl index 66caa1f..1747be2 100644 --- a/conffile.fl +++ b/conffile.fl @@ -1,6 +1,10 @@ /* the "incl" state is used for picking up the name of an include file */ %x incl +%option nounput +%option noinput +%option never-interactive + %{ #include #include @@ -24,13 +28,13 @@ do{ \ struct include_stack_item { YY_BUFFER_STATE bst; uint32_t lineno; - string_t file; + cstring_t file; }; struct include_stack_item include_stack[MAX_INCLUDE_DEPTH]; int include_stack_ptr=0; uint32_t config_lineno=0; -string_t config_file="xxx"; +cstring_t config_file="xxx"; static struct p_node *leafnode(uint32_t type) { @@ -92,6 +96,14 @@ include BEGIN(incl); yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); BEGIN(INITIAL); } +\n { /* include with no filename */ + Message(M_FATAL,"config file %s line %d: %s\n",config_file, + config_lineno,"``include'' requires a filename"); + BEGIN(INITIAL); + ++config_lineno; + ++yynerrs; +} + <> { if (--include_stack_ptr < 0) { yyterminate();