winegcc: Fix returned libdir (try 2)

André Hentschel nerv at dawncrow.de
Wed Oct 27 12:45:01 CDT 2010


---
 tools/winegcc/winegcc.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 8dfa14a..9112ace 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -359,17 +359,29 @@ static char *get_lib_dir( struct options *opts )
         p = buffer + strlen(buffer);
         while (p > buffer && p[-1] == '/') p--;
         strcpy( p, "/libwine.so" );
-        if (check_platform( opts, buffer )) return buffer;
+        if (check_platform( opts, buffer ))
+        {
+            p[2] = 0;
+            return buffer;
+        }
         if (p > buffer + 2 && (!memcmp( p - 2, "32", 2 ) || !memcmp( p - 2, "64", 2 ))) p -= 2;
         if (opts->force_pointer_size == 4 || (!opts->force_pointer_size && opts->target_cpu != CPU_x86_64))
         {
             strcpy( p, "32/libwine.so" );
-            if (check_platform( opts, buffer )) return buffer;
+            if (check_platform( opts, buffer ))
+            {
+                p[2] = 0;
+                return buffer;
+            }
         }
         if (opts->force_pointer_size == 8 || (!opts->force_pointer_size && opts->target_cpu == CPU_x86_64))
         {
             strcpy( p, "64/libwine.so" );
-            if (check_platform( opts, buffer )) return buffer;
+            if (check_platform( opts, buffer ))
+            {
+                p[2] = 0;
+                return buffer;
+            }
         }
         free( buffer );
     }
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list