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
38eb26f0
Commit
38eb26f0
authored
Oct 03, 2021
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemenubuilder: Return pointer from freedesktop_mime_type_for_extension.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe96d12a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+7
-11
No files found.
programs/winemenubuilder/winemenubuilder.c
View file @
38eb26f0
...
...
@@ -1874,29 +1874,26 @@ static BOOL build_native_mime_types(struct list *mime_types)
return
ret
;
}
static
BOOL
freedesktop_mime_type_for_extension
(
struct
list
*
native_mime_types
,
LPCWSTR
extensionW
,
WCHAR
**
match
)
static
WCHAR
*
freedesktop_mime_type_for_extension
(
struct
list
*
native_mime_types
,
const
WCHAR
*
extensionW
)
{
struct
xdg_mime_type
*
mime_type_entry
;
int
matchLength
=
0
;
*
match
=
NULL
;
const
WCHAR
*
match
=
NULL
;
LIST_FOR_EACH_ENTRY
(
mime_type_entry
,
native_mime_types
,
struct
xdg_mime_type
,
entry
)
{
if
(
PathMatchSpecW
(
extensionW
,
mime_type_entry
->
glob
))
{
if
(
*
match
==
NULL
||
matchLength
<
lstrlenW
(
mime_type_entry
->
glob
))
if
(
match
==
NULL
||
matchLength
<
lstrlenW
(
mime_type_entry
->
glob
))
{
*
match
=
mime_type_entry
->
mimeType
;
match
=
mime_type_entry
->
mimeType
;
matchLength
=
lstrlenW
(
mime_type_entry
->
glob
);
}
}
}
if
(
*
match
!=
NULL
)
*
match
=
xwcsdup
(
*
match
);
return
TRUE
;
return
match
?
xwcsdup
(
match
)
:
NULL
;
}
static
WCHAR
*
reg_get_valW
(
HKEY
key
,
LPCWSTR
subkey
,
LPCWSTR
name
)
...
...
@@ -2190,8 +2187,7 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
if
(
contentTypeW
)
wcslwr
(
contentTypeW
);
if
(
!
freedesktop_mime_type_for_extension
(
&
nativeMimeTypes
,
extensionW
,
&
mimeType
))
goto
end
;
mimeType
=
freedesktop_mime_type_for_extension
(
&
nativeMimeTypes
,
extensionW
);
if
(
mimeType
==
NULL
)
{
...
...
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