From: Rémi Bernon rbernon@codeweavers.com
--- tools/widl/parser.l | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 951998de381..ac8bb21e8fe 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -506,6 +506,15 @@ void push_import( const char *import_name, struct location *where ) struct import *import; FILE *file;
+ if (list_empty( &imports )) + { + /* add the main file to the imported file list */ + char *tmp = strrchr( input_name, '/' ); + import = xmalloc( sizeof(struct import) ); + import->name = xstrdup( tmp ? tmp + 1 : input_name ); + list_add_tail( &imports, &import->entry ); + } + state = xmalloc( sizeof(struct import_state )); list_add_head( &import_stack, &state->entry ); parse_only = !list_empty( &import_stack );