summaryrefslogtreecommitdiff
path: root/support/kconfig/lex.zconf.c_shipped
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2012-01-13 12:48:28 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2012-01-15 20:48:04 +0100
commit21f540be4e247b4468d0e8adbf9e3a7575f8a085 (patch)
tree8c572a31fbc5cbeecb015a3b15ce00debf03a074 /support/kconfig/lex.zconf.c_shipped
parent8f8d414b61bf3b27a77ad38dfc493ae412b65471 (diff)
kconfig: sync with linux-3.0
And drop unused make-write-deps patch. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'support/kconfig/lex.zconf.c_shipped')
-rw-r--r--support/kconfig/lex.zconf.c_shipped33
1 files changed, 19 insertions, 14 deletions
diff --git a/support/kconfig/lex.zconf.c_shipped b/support/kconfig/lex.zconf.c_shipped
index 6eb039718..d9182916f 100644
--- a/support/kconfig/lex.zconf.c_shipped
+++ b/support/kconfig/lex.zconf.c_shipped
@@ -2363,11 +2363,11 @@ void zconf_initscan(const char *name)
current_file = file_lookup(name);
current_file->lineno = 1;
- current_file->flags = FILE_BUSY;
}
void zconf_nextfile(const char *name)
{
+ struct file *iter;
struct file *file = file_lookup(name);
struct buffer *buf = malloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
@@ -2383,18 +2383,25 @@ void zconf_nextfile(const char *name)
buf->parent = current_buf;
current_buf = buf;
- if (file->flags & FILE_BUSY) {
- printf("%s:%d: do not source '%s' from itself\n",
- zconf_curname(), zconf_lineno(), name);
- exit(1);
- }
- if (file->flags & FILE_SCANNED) {
- printf("%s:%d: file '%s' is already sourced from '%s'\n",
- zconf_curname(), zconf_lineno(), name,
- file->parent->name);
- exit(1);
+ for (iter = current_file->parent; iter; iter = iter->parent ) {
+ if (!strcmp(current_file->name,iter->name) ) {
+ printf("%s:%d: recursive inclusion detected. "
+ "Inclusion path:\n current file : '%s'\n",
+ zconf_curname(), zconf_lineno(),
+ zconf_curname());
+ iter = current_file->parent;
+ while (iter && \
+ strcmp(iter->name,current_file->name)) {
+ printf(" included from: '%s:%d'\n",
+ iter->name, iter->lineno-1);
+ iter = iter->parent;
+ }
+ if (iter)
+ printf(" included from: '%s:%d'\n",
+ iter->name, iter->lineno+1);
+ exit(1);
+ }
}
- file->flags |= FILE_BUSY;
file->lineno = 1;
file->parent = current_file;
current_file = file;
@@ -2404,8 +2411,6 @@ static void zconf_endfile(void)
{
struct buffer *parent;
- current_file->flags |= FILE_SCANNED;
- current_file->flags &= ~FILE_BUSY;
current_file = current_file->parent;
parent = current_buf->parent;