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
e43cec76
Commit
e43cec76
authored
Jun 19, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Remove one more directory level when checking for build dir.
This way it still works if the libdir we got was libs/wine instead of libs.
parent
a73d568e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
config.c
libs/wine/config.c
+26
-16
No files found.
libs/wine/config.c
View file @
e43cec76
...
...
@@ -234,12 +234,28 @@ static void init_paths(void)
init_server_dir
(
st
.
st_dev
,
st
.
st_ino
);
}
/* 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
)
{
struct
stat
st
;
strcpy
(
basedir
+
baselen
,
"/server/wineserver"
);
if
(
stat
(
basedir
,
&
st
)
==
-
1
)
return
0
;
/* no wineserver found */
/* check for ntdll too to make sure */
strcpy
(
basedir
+
baselen
,
"/dlls/ntdll/ntdll.dll.so"
);
if
(
stat
(
basedir
,
&
st
)
==
-
1
)
return
0
;
/* no ntdll found */
basedir
[
baselen
]
=
0
;
return
1
;
}
/* check if we are running from the build directory */
static
char
*
running_from_build_dir
(
const
char
*
basedir
,
const
char
*
bindir
)
{
struct
stat
st
;
const
char
*
p
;
char
*
path
,
*
end
;
char
*
path
;
int
res
;
if
(
!
(
path
=
build_path
(
bindir
,
"wineserver"
)))
return
NULL
;
...
...
@@ -254,24 +270,18 @@ static char *running_from_build_dir( const char *basedir, const char *bindir )
if
(
p
==
basedir
)
return
NULL
;
path
=
xmalloc
(
p
-
basedir
+
sizeof
(
"/dlls/ntdll/ntdll.dll.so"
)
);
memcpy
(
path
,
basedir
,
p
-
basedir
);
end
=
path
+
(
p
-
basedir
);
strcpy
(
end
,
"/server/wineserver"
);
if
(
stat
(
path
,
&
st
)
==
-
1
)
if
(
!
is_valid_build_dir
(
path
,
p
-
basedir
))
{
free
(
path
);
return
NULL
;
/* no wineserver found */
}
/* check for ntdll too to make sure */
strcpy
(
end
,
"/dlls/ntdll/ntdll.dll.so"
);
if
(
stat
(
path
,
&
st
)
==
-
1
)
{
free
(
path
);
return
NULL
;
/* no ntdll found */
/* remove another component */
while
(
p
>
basedir
&&
*
p
==
'/'
)
p
--
;
while
(
p
>
basedir
&&
*
p
!=
'/'
)
p
--
;
if
(
p
==
basedir
||
!
is_valid_build_dir
(
path
,
p
-
basedir
))
{
free
(
path
);
return
NULL
;
}
}
*
end
=
0
;
return
path
;
}
...
...
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