winebuild: Always initialize the dll name at startup.

oldstable
Alexandre Julliard 2009-12-30 12:12:13 +01:00
parent d097eef922
commit 9d55475eee
2 changed files with 18 additions and 19 deletions

View File

@ -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 */
static void set_subsystem( const char *subsystem, DLLSPEC *spec )
{
@ -505,6 +522,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
if (spec->file_name && !strchr( spec->file_name, '.' ))
strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" );
init_dll_name( spec );
switch (target_cpu)
{

View File

@ -64,22 +64,6 @@ static inline int is_function( const ORDDEF *odp )
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
*
@ -853,7 +837,6 @@ static void output_module16( DLLSPEC *spec )
*/
void BuildSpec16File( DLLSPEC *spec )
{
init_dll_name( spec );
output_standard_file_header();
output_module16( spec );
output_init_code( spec );
@ -877,7 +860,6 @@ void output_spec16_file( DLLSPEC *spec16 )
{
DLLSPEC *spec32 = alloc_dll_spec();
init_dll_name( spec16 );
spec32->file_name = xstrdup( spec16->file_name );
if (spec16->characteristics & IMAGE_FILE_DLL)
@ -921,7 +903,6 @@ void output_fake_module16( DLLSPEC *spec )
unsigned int i, rsrctab, restab, namelen, modtab, imptab, enttab, cbenttab, codeseg, dataseg, rsrcdata;
init_dll_name( spec );
init_output_buffer();
rsrctab = lfanew;