Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
767ad69a
Commit
767ad69a
authored
Feb 16, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Don't rely on argv[0] in wine_exec_wine_binary if we can get
the directory from the library itself. Only try the hardcoded BINDIR if everything else failed.
parent
ca6fd0d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
config.c
libs/wine/config.c
+13
-14
No files found.
libs/wine/config.c
View file @
767ad69a
...
...
@@ -154,7 +154,7 @@ static const char *get_runtime_libdir(void)
}
/* determine the proper location of the given path based on the current libdir */
static
char
*
get_path_from_libdir
(
const
char
*
path
,
const
char
*
filename
)
static
char
*
get_path_from_libdir
(
const
char
*
path
,
const
char
*
f
allback
,
const
char
*
f
ilename
)
{
char
*
p
,
*
ret
;
const
char
*
libdir
=
get_runtime_libdir
();
...
...
@@ -184,6 +184,7 @@ static char *get_path_from_libdir( const char *path, const char *filename )
}
else
{
if
(
fallback
)
path
=
fallback
;
ret
=
xmalloc
(
strlen
(
path
)
+
strlen
(
filename
)
+
2
);
strcpy
(
ret
,
path
);
p
=
ret
+
strlen
(
ret
);
...
...
@@ -229,7 +230,7 @@ const char *get_default_dlldir(void)
{
static
const
char
*
dlldir
;
if
(
!
dlldir
)
dlldir
=
get_path_from_libdir
(
DLLDIR
,
""
);
if
(
!
dlldir
)
dlldir
=
get_path_from_libdir
(
DLLDIR
,
NULL
,
""
);
return
dlldir
;
}
...
...
@@ -409,6 +410,7 @@ static void preloader_exec( char **argv, char **envp, int use_preloader )
/* exec a wine internal binary (either the wine loader or the wine server) */
void
wine_exec_wine_binary
(
const
char
*
name
,
char
**
argv
,
char
**
envp
,
int
use_preloader
)
{
static
const
char
bindir
[]
=
BINDIR
;
const
char
*
path
,
*
pos
,
*
ptr
;
if
(
name
&&
strchr
(
name
,
'/'
))
...
...
@@ -419,21 +421,11 @@ void wine_exec_wine_binary( const char *name, char **argv, char **envp, int use_
}
else
if
(
!
name
)
name
=
argv0_name
;
/* first,
try bin directory
*/
argv
[
0
]
=
get_path_from_libdir
(
BINDIR
,
name
);
/* first,
bin directory from the current libdir or argv0
*/
argv
[
0
]
=
get_path_from_libdir
(
bindir
,
argv0_path
,
name
);
preloader_exec
(
argv
,
envp
,
use_preloader
);
free
(
argv
[
0
]
);
/* now try the path of argv0 of the current binary */
if
(
argv0_path
)
{
argv
[
0
]
=
xmalloc
(
strlen
(
argv0_path
)
+
strlen
(
name
)
+
1
);
strcpy
(
argv
[
0
],
argv0_path
);
strcat
(
argv
[
0
],
name
);
preloader_exec
(
argv
,
envp
,
use_preloader
);
free
(
argv
[
0
]
);
}
/* now search in the Unix path */
if
((
path
=
getenv
(
"PATH"
)))
{
...
...
@@ -452,4 +444,11 @@ void wine_exec_wine_binary( const char *name, char **argv, char **envp, int use_
}
free
(
argv
[
0
]
);
}
/* and finally try BINDIR */
argv
[
0
]
=
xmalloc
(
sizeof
(
bindir
)
+
1
+
strlen
(
name
)
);
strcpy
(
argv
[
0
],
bindir
);
strcat
(
argv
[
0
],
"/"
);
strcat
(
argv
[
0
],
name
);
preloader_exec
(
argv
,
envp
,
use_preloader
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment