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
16c8ca80
Commit
16c8ca80
authored
Sep 16, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Use the argv[0] directory as bin directory only if all other methods fail.
parent
b618910b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
config.c
libs/wine/config.c
+27
-8
No files found.
libs/wine/config.c
View file @
16c8ca80
...
...
@@ -152,16 +152,16 @@ static char *get_runtime_libdir(void)
}
/* return the directory that contains the main exe at run-time */
static
char
*
get_runtime_
bindir
(
const
char
*
argv0
)
static
char
*
get_runtime_
exedir
(
void
)
{
char
*
p
,
*
bindir
,
*
cwd
;
int
len
,
size
;
#ifdef EXE_LINK
char
*
p
,
*
bindir
;
int
size
;
for
(
size
=
256
;
;
size
*=
2
)
{
int
ret
;
if
(
!
(
bindir
=
malloc
(
size
)))
break
;
if
(
!
(
bindir
=
malloc
(
size
)))
return
NULL
;
if
((
ret
=
readlink
(
EXE_LINK
,
bindir
,
size
))
==
-
1
)
break
;
if
(
ret
!=
size
)
{
...
...
@@ -175,6 +175,14 @@ static char *get_runtime_bindir( const char *argv0 )
}
free
(
bindir
);
#endif
return
NULL
;
}
/* return the base directory from argv0 */
static
char
*
get_runtime_argvdir
(
const
char
*
argv0
)
{
char
*
p
,
*
bindir
,
*
cwd
;
int
len
,
size
;
if
(
!
(
p
=
strrchr
(
argv0
,
'/'
)))
return
NULL
;
...
...
@@ -370,21 +378,32 @@ void wine_init_argv0_path( const char *argv0 )
if
(
!
(
basename
=
strrchr
(
argv0
,
'/'
)))
basename
=
argv0
;
else
basename
++
;
bindir
=
get_runtime_bindir
(
argv0
);
libdir
=
get_runtime_libdir
();
bindir
=
get_runtime_exedir
();
if
(
bindir
&&
!
is_valid_bindir
(
bindir
))
{
build_dir
=
running_from_build_dir
(
bindir
);
free
(
bindir
);
bindir
=
NULL
;
}
libdir
=
get_runtime_libdir
();
if
(
libdir
&&
!
bindir
&&
!
build_dir
)
{
build_dir
=
running_from_build_dir
(
libdir
);
if
(
!
build_dir
)
bindir
=
build_path
(
libdir
,
LIB_TO_BINDIR
);
}
if
(
!
libdir
&&
!
bindir
&&
!
build_dir
)
{
bindir
=
get_runtime_argvdir
(
argv0
);
if
(
bindir
&&
!
is_valid_bindir
(
bindir
))
{
build_dir
=
running_from_build_dir
(
bindir
);
free
(
bindir
);
bindir
=
NULL
;
}
}
if
(
build_dir
)
{
argv0_name
=
build_path
(
"loader/"
,
basename
);
...
...
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