Commit 3b7398b4 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

widl: Guard against re-import of the main input file.

parent 3395ce23
......@@ -520,6 +520,7 @@ void push_import( const char *import_name, struct location *where )
LIST_FOR_EACH_ENTRY( import, &imports, struct import, entry )
if (!strcmp( import->name, import_name )) return; /* already imported */
if (!strcmp( idl_name, import_name )) return; /* already imported */
import = xmalloc( sizeof(struct import) );
import->name = xstrdup( import_name );
......
......@@ -2270,7 +2270,7 @@ char *gen_name(void)
if (! file_id)
{
char *dst = replace_extension( get_basename(input_idl_name), ".idl", "" );
char *dst = replace_extension( idl_name, ".idl", "" );
file_id = dst;
for (; *dst; ++dst)
......
......@@ -114,7 +114,7 @@ static int stdinc = 1;
static enum stub_mode stub_mode = MODE_Os;
char *input_name;
char *input_idl_name;
char *idl_name;
char *acf_name;
char *header_name;
char *local_stubs_name;
......@@ -435,7 +435,7 @@ void write_id_data(const statement_list_t *stmts)
}
fprintf(idfile, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION);
fprintf(idfile, "from %s - Do not edit ***/\n\n", input_idl_name);
fprintf(idfile, "from %s - Do not edit ***/\n\n", idl_name);
fprintf(idfile, "#include <rpc.h>\n");
fprintf(idfile, "#include <rpcndr.h>\n\n");
......@@ -782,7 +782,10 @@ int main(int argc,char *argv[])
return 1;
}
else
input_idl_name = input_name = xstrdup(files.str[0]);
{
input_name = xstrdup( files.str[0] );
idl_name = get_basename( input_name );
}
}
else {
fprintf(stderr, "%s", usage);
......
......@@ -52,7 +52,7 @@ extern int winrt_mode;
extern int use_abi_namespace;
extern char *input_name;
extern char *input_idl_name;
extern char *idl_name;
extern char *acf_name;
extern char *header_name;
extern char *header_token;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment