Alexandre Julliard : winebuild: Always initialize the dll name at startup.

Alexandre Julliard julliard at winehq.org
Wed Dec 30 10:18:12 CST 2009


Module: wine
Branch: master
Commit: 9d55475eeef3f3fce1700f6aa7ebced1656db01e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9d55475eeef3f3fce1700f6aa7ebced1656db01e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 30 12:12:13 2009 +0100

winebuild: Always initialize the dll name at startup.

---

 tools/winebuild/main.c   |   18 ++++++++++++++++++
 tools/winebuild/spec16.c |   19 -------------------
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 14c1689..ae7904d 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -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)
     {
diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c
index 93c0822..abc090d 100644
--- a/tools/winebuild/spec16.c
+++ b/tools/winebuild/spec16.c
@@ -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;




More information about the wine-cvs mailing list