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
21c832da
Commit
21c832da
authored
Nov 04, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Also check magic number to detect shared libraries.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
010d44a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
utils.c
tools/winegcc/utils.c
+6
-0
No files found.
tools/winegcc/utils.c
View file @
21c832da
...
...
@@ -212,6 +212,7 @@ file_type get_file_type(const char* filename)
{
/* see tools/winebuild/res32.c: check_header for details */
static
const
char
res_sig
[]
=
{
0
,
0
,
0
,
0
,
32
,
0
,
0
,
0
,
0xff
,
0xff
,
0
,
0
,
0xff
,
0xff
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
static
const
char
elf_sig
[
4
]
=
"
\177
ELF"
;
char
buf
[
sizeof
(
res_sig
)];
int
fd
,
cnt
;
...
...
@@ -230,6 +231,11 @@ file_type get_file_type(const char* filename)
if
(
strendswith
(
filename
,
".def"
))
return
file_def
;
if
(
strendswith
(
filename
,
".spec"
))
return
file_spec
;
if
(
strendswith
(
filename
,
".rc"
))
return
file_rc
;
if
(
cnt
>=
sizeof
(
elf_sig
)
&&
!
memcmp
(
buf
,
elf_sig
,
sizeof
(
elf_sig
)))
return
file_so
;
/* ELF lib */
if
(
cnt
>=
sizeof
(
unsigned
int
)
&&
(
*
(
unsigned
int
*
)
buf
==
0xfeedface
||
*
(
unsigned
int
*
)
buf
==
0xcefaedfe
||
*
(
unsigned
int
*
)
buf
==
0xfeedfacf
||
*
(
unsigned
int
*
)
buf
==
0xcffaedfe
))
return
file_so
;
/* Mach-O lib */
return
file_other
;
}
...
...
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