Commit 9d55475e authored by Alexandre Julliard's avatar Alexandre Julliard

winebuild: Always initialize the dll name at startup.

parent d097eef9
...@@ -138,6 +138,23 @@ static void set_dll_file_name( const char *name, DLLSPEC *spec ) ...@@ -138,6 +138,23 @@ static void set_dll_file_name( const char *name, DLLSPEC *spec )
} }
} }
/* set the dll name from the file name */
static void init_dll_name( DLLSPEC *spec )
{
if (!spec->file_name)
{
char *p;
spec->file_name = xstrdup( output_file_name );
if ((p = strrchr( spec->file_name, '.' ))) *p = 0;
}
if (!spec->dll_name) /* set default name from file name */
{
char *p;
spec->dll_name = xstrdup( spec->file_name );
if ((p = strrchr( spec->dll_name, '.' ))) *p = 0;
}
}
/* set the dll subsystem */ /* set the dll subsystem */
static void set_subsystem( const char *subsystem, DLLSPEC *spec ) static void set_subsystem( const char *subsystem, DLLSPEC *spec )
{ {
...@@ -505,6 +522,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) ...@@ -505,6 +522,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
if (spec->file_name && !strchr( spec->file_name, '.' )) if (spec->file_name && !strchr( spec->file_name, '.' ))
strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" ); strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" );
init_dll_name( spec );
switch (target_cpu) switch (target_cpu)
{ {
......
...@@ -64,22 +64,6 @@ static inline int is_function( const ORDDEF *odp ) ...@@ -64,22 +64,6 @@ static inline int is_function( const ORDDEF *odp )
odp->type == TYPE_STUB); odp->type == TYPE_STUB);
} }
static void init_dll_name( DLLSPEC *spec )
{
if (!spec->file_name)
{
char *p;
spec->file_name = xstrdup( output_file_name );
if ((p = strrchr( spec->file_name, '.' ))) *p = 0;
}
if (!spec->dll_name) /* set default name from file name */
{
char *p;
spec->dll_name = xstrdup( spec->file_name );
if ((p = strrchr( spec->dll_name, '.' ))) *p = 0;
}
}
/******************************************************************* /*******************************************************************
* output_entries * output_entries
* *
...@@ -853,7 +837,6 @@ static void output_module16( DLLSPEC *spec ) ...@@ -853,7 +837,6 @@ static void output_module16( DLLSPEC *spec )
*/ */
void BuildSpec16File( DLLSPEC *spec ) void BuildSpec16File( DLLSPEC *spec )
{ {
init_dll_name( spec );
output_standard_file_header(); output_standard_file_header();
output_module16( spec ); output_module16( spec );
output_init_code( spec ); output_init_code( spec );
...@@ -877,7 +860,6 @@ void output_spec16_file( DLLSPEC *spec16 ) ...@@ -877,7 +860,6 @@ void output_spec16_file( DLLSPEC *spec16 )
{ {
DLLSPEC *spec32 = alloc_dll_spec(); DLLSPEC *spec32 = alloc_dll_spec();
init_dll_name( spec16 );
spec32->file_name = xstrdup( spec16->file_name ); spec32->file_name = xstrdup( spec16->file_name );
if (spec16->characteristics & IMAGE_FILE_DLL) if (spec16->characteristics & IMAGE_FILE_DLL)
...@@ -921,7 +903,6 @@ void output_fake_module16( DLLSPEC *spec ) ...@@ -921,7 +903,6 @@ void output_fake_module16( DLLSPEC *spec )
unsigned int i, rsrctab, restab, namelen, modtab, imptab, enttab, cbenttab, codeseg, dataseg, rsrcdata; unsigned int i, rsrctab, restab, namelen, modtab, imptab, enttab, cbenttab, codeseg, dataseg, rsrcdata;
init_dll_name( spec );
init_output_buffer(); init_output_buffer();
rsrctab = lfanew; rsrctab = lfanew;
......
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