loader: Fix the generic case in get_self_exe().
Previously this just returned the matched directory, not the path to the executable itself. Signed-off-by: Martin Storsjo <martin@martin.st> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1721f0ff27
commit
a75596c94d
|
@ -216,13 +216,15 @@ static const char *get_self_exe( char *argv0 )
|
|||
for (p = strtok( path, ":" ); p; p = strtok( NULL, ":" ))
|
||||
{
|
||||
char *name = build_path( p, argv0 );
|
||||
int found = !access( name, X_OK );
|
||||
free( name );
|
||||
if (found) break;
|
||||
}
|
||||
if (p) p = strdup( p );
|
||||
if (!access( name, X_OK ))
|
||||
{
|
||||
free( path );
|
||||
return p;
|
||||
return name;
|
||||
}
|
||||
free( name );
|
||||
}
|
||||
free( path );
|
||||
return NULL;
|
||||
}
|
||||
return argv0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue