Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
56b14d63
Commit
56b14d63
authored
Jun 26, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Add a helper function to set the dll directory.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
161f3fc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
15 deletions
+35
-15
config.c
libs/wine/config.c
+35
-15
No files found.
libs/wine/config.c
View file @
56b14d63
...
...
@@ -330,6 +330,16 @@ static int is_valid_bindir( const char *bindir )
return
ret
;
}
/* check if dlldir is valid by checking for ntdll */
static
int
is_valid_dlldir
(
const
char
*
dlldir
)
{
struct
stat
st
;
char
*
path
=
build_path
(
dlldir
,
"ntdll.dll.so"
);
int
ret
=
(
stat
(
path
,
&
st
)
!=
-
1
);
free
(
path
);
return
ret
;
}
/* check if basedir is a valid build dir by checking for wineserver and ntdll */
/* helper for running_from_build_dir */
static
inline
int
is_valid_build_dir
(
char
*
basedir
,
int
baselen
)
...
...
@@ -381,6 +391,7 @@ static int set_bindir( char *dir )
if
(
is_valid_bindir
(
dir
))
{
bindir
=
dir
;
dlldir
=
build_path
(
bindir
,
BIN_TO_DLLDIR
);
}
else
{
...
...
@@ -390,26 +401,39 @@ static int set_bindir( char *dir )
return
bindir
||
build_dir
;
}
/* try to set the specified directory as dlldir, or set build_dir if it's inside the build directory */
static
int
set_dlldir
(
char
*
libdir
)
{
char
*
path
;
if
(
!
libdir
)
return
0
;
path
=
build_path
(
libdir
,
LIB_TO_DLLDIR
);
if
(
is_valid_dlldir
(
path
))
{
dlldir
=
path
;
bindir
=
build_path
(
libdir
,
LIB_TO_BINDIR
);
}
else
{
build_dir
=
running_from_build_dir
(
libdir
);
free
(
path
);
}
free
(
libdir
);
return
dlldir
||
build_dir
;
}
/* initialize the argv0 path */
void
wine_init_argv0_path
(
const
char
*
argv0
)
{
const
char
*
basename
;
char
*
libdir
=
NULL
;
if
(
!
(
basename
=
strrchr
(
argv0
,
'/'
)))
basename
=
argv0
;
else
basename
++
;
if
(
set_bindir
(
get_runtime_exedir
()
))
goto
done
;
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
)
set_bindir
(
get_runtime_argvdir
(
argv0
));
if
(
set_dlldir
(
get_runtime_libdir
()
))
goto
done
;
set_bindir
(
get_runtime_argvdir
(
argv0
));
done:
if
(
build_dir
)
...
...
@@ -418,13 +442,9 @@ done:
}
else
{
if
(
libdir
)
dlldir
=
build_path
(
libdir
,
LIB_TO_DLLDIR
);
else
if
(
bindir
)
dlldir
=
build_path
(
bindir
,
BIN_TO_DLLDIR
);
if
(
bindir
)
datadir
=
build_path
(
bindir
,
BIN_TO_DATADIR
);
argv0_name
=
xstrdup
(
basename
);
}
free
(
libdir
);
}
/* return the configuration directory ($WINEPREFIX or $HOME/.wine) */
...
...
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