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
e1e07b40
Commit
e1e07b40
authored
Nov 12, 2009
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Nov 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemenubuilder: Escape XML special characters in MIME types.
parent
856dda32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+31
-3
No files found.
programs/winemenubuilder/winemenubuilder.c
View file @
e1e07b40
...
...
@@ -730,6 +730,26 @@ static char* heap_printf(const char *format, ...)
return
ret
;
}
static
void
write_xml_text
(
FILE
*
file
,
const
char
*
text
)
{
int
i
;
for
(
i
=
0
;
text
[
i
];
i
++
)
{
if
(
text
[
i
]
==
'&'
)
fputs
(
"&"
,
file
);
else
if
(
text
[
i
]
==
'<'
)
fputs
(
"<"
,
file
);
else
if
(
text
[
i
]
==
'>'
)
fputs
(
">"
,
file
);
else
if
(
text
[
i
]
==
'\''
)
fputs
(
"'"
,
file
);
else
if
(
text
[
i
]
==
'"'
)
fputs
(
"""
,
file
);
else
fputc
(
text
[
i
],
file
);
}
}
static
BOOL
create_directories
(
char
*
directory
)
{
BOOL
ret
=
TRUE
;
...
...
@@ -1805,10 +1825,18 @@ static BOOL write_freedesktop_mime_type_entry(const char *packages_dir, const ch
{
fprintf
(
packageFile
,
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>
\n
"
);
fprintf
(
packageFile
,
"<mime-info xmlns=
\"
http://www.freedesktop.org/standards/shared-mime-info
\"
>
\n
"
);
fprintf
(
packageFile
,
" <mime-type type=
\"
%s
\"
>
\n
"
,
mime_type
);
fprintf
(
packageFile
,
" <glob pattern=
\"
*%s
\"
/>
\n
"
,
dot_extension
);
fprintf
(
packageFile
,
" <mime-type type=
\"
"
);
write_xml_text
(
packageFile
,
mime_type
);
fprintf
(
packageFile
,
"
\"
>
\n
"
);
fprintf
(
packageFile
,
" <glob pattern=
\"
*"
);
write_xml_text
(
packageFile
,
dot_extension
);
fprintf
(
packageFile
,
"
\"
/>
\n
"
);
if
(
comment
)
fprintf
(
packageFile
,
" <comment>%s</comment>
\n
"
,
comment
);
{
fprintf
(
packageFile
,
" <comment>"
);
write_xml_text
(
packageFile
,
comment
);
fprintf
(
packageFile
,
"</comment>
\n
"
);
}
fprintf
(
packageFile
,
" </mime-type>
\n
"
);
fprintf
(
packageFile
,
"</mime-info>
\n
"
);
ret
=
TRUE
;
...
...
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