ntdll: Use environment variable "WINESERVER" first on search for wineserver to start.

Ralf Habacker ralf.habacker at freenet.de
Wed Feb 15 08:27:40 CST 2017


This fixes the issue that WINESERVER environment variable is only
used if @bindir@/wineserver does not exist.

Fixes https://bugs.winehq.org/show_bug.cgi?id=40811

Signed-off-by: Ralf Habacker <ralf.habacker at freenet.de>
---
 libs/wine/config.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libs/wine/config.c b/libs/wine/config.c
index 3b5dd68..433666b 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -530,6 +530,13 @@ void wine_exec_wine_binary( const char *name, char
**argv, const char *env_var )
     use_preloader = 0;
 #endif
 +    /* first specified environment variable */
+    if (env_var)
+    {
+        argv[0] = (char *)env_var;
+        preloader_exec( argv, use_preloader );
+    }
+
     if ((ptr = strrchr( name, '/' )))
     {
         /* if we are in build dir and name contains a path, try that */
@@ -542,7 +549,7 @@ void wine_exec_wine_binary( const char *name, char
**argv, const char *env_var )
         name = ptr + 1;  /* get rid of path */
     }
 -    /* first, bin directory from the current libdir or argv0 */
+    /* then, bin directory from the current libdir or argv0 */
     if (bindir)
     {
         argv[0] = build_path( bindir, name );
@@ -550,13 +557,6 @@ void wine_exec_wine_binary( const char *name, char
**argv, const char *env_var )
         free( argv[0] );
     }
 -    /* then specified environment variable */
-    if (env_var)
-    {
-        argv[0] = (char *)env_var;
-        preloader_exec( argv, use_preloader );
-    }
-
     /* now search in the Unix path */
     if ((path = getenv( "PATH" )))
     {
-- 
1.8.4.5




More information about the wine-patches mailing list