summaryrefslogtreecommitdiff
path: root/package/config/zconf.l
diff options
context:
space:
mode:
Diffstat (limited to 'package/config/zconf.l')
-rw-r--r--package/config/zconf.l18
1 files changed, 11 insertions, 7 deletions
diff --git a/package/config/zconf.l b/package/config/zconf.l
index 4a0447b9e..21ff69c9a 100644
--- a/package/config/zconf.l
+++ b/package/config/zconf.l
@@ -1,5 +1,6 @@
%option backup nostdinit noyywrap never-interactive full ecs
%option 8bit backup nodefault perf-report perf-report
+%option noinput
%x COMMAND HELP STRING PARAM
%{
/*
@@ -49,11 +50,6 @@ void new_string(void)
void append_string(const char *str, int size)
{
int new_size = text_size + size + 1;
-
- if ((YY_START == 2 /* HELP */) && (size > 70)) {
- fprintf (stderr, "%s:%d warning: Overlong line\n",
- current_file->name, current_file->lineno);
- }
if (new_size > text_asize) {
new_size += START_STRSIZE - 1;
new_size &= -START_STRSIZE;
@@ -222,6 +218,11 @@ n [A-Za-z0-9_]
append_string("\n", 1);
}
[^ \t\n].* {
+ while (yyleng) {
+ if ((yytext[yyleng-1] != ' ') && (yytext[yyleng-1] != '\t'))
+ break;
+ yyleng--;
+ }
append_string(yytext, yyleng);
if (!first_ts)
first_ts = last_ts;
@@ -313,11 +314,14 @@ void zconf_nextfile(const char *name)
current_buf = buf;
if (file->flags & FILE_BUSY) {
- printf("recursive scan (%s)?\n", name);
+ printf("%s:%d: do not source '%s' from itself\n",
+ zconf_curname(), zconf_lineno(), name);
exit(1);
}
if (file->flags & FILE_SCANNED) {
- printf("file %s already scanned?\n", name);
+ printf("%s:%d: file '%s' is already sourced from '%s'\n",
+ zconf_curname(), zconf_lineno(), name,
+ file->parent->name);
exit(1);
}
file->flags |= FILE_BUSY;