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
7e446ce7
Commit
7e446ce7
authored
Apr 20, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wusa: Remove string duplication helper.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
76fa97cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
main.c
programs/wusa/main.c
+3
-3
manifest.c
programs/wusa/manifest.c
+2
-2
wusa.h
programs/wusa/wusa.h
+0
-8
No files found.
programs/wusa/main.c
View file @
7e446ce7
...
@@ -166,7 +166,7 @@ static BOOL create_directory(const WCHAR *path)
...
@@ -166,7 +166,7 @@ static BOOL create_directory(const WCHAR *path)
static
BOOL
create_parent_directory
(
const
WCHAR
*
filename
)
static
BOOL
create_parent_directory
(
const
WCHAR
*
filename
)
{
{
WCHAR
*
p
,
*
path
=
strdupW
(
filename
);
WCHAR
*
p
,
*
path
=
wcsdup
(
filename
);
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
if
(
!
path
)
return
FALSE
;
if
(
!
path
)
return
FALSE
;
...
@@ -430,7 +430,7 @@ static struct assembly_entry *lookup_assembly(struct list *manifest_list, struct
...
@@ -430,7 +430,7 @@ static struct assembly_entry *lookup_assembly(struct list *manifest_list, struct
static
WCHAR
*
get_assembly_source
(
struct
assembly_entry
*
assembly
)
static
WCHAR
*
get_assembly_source
(
struct
assembly_entry
*
assembly
)
{
{
WCHAR
*
p
,
*
path
=
strdupW
(
assembly
->
filename
);
WCHAR
*
p
,
*
path
=
wcsdup
(
assembly
->
filename
);
if
(
path
&&
(
p
=
wcsrchr
(
path
,
'.'
)))
*
p
=
0
;
if
(
path
&&
(
p
=
wcsrchr
(
path
,
'.'
)))
*
p
=
0
;
return
path
;
return
path
;
}
}
...
@@ -527,7 +527,7 @@ static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *ke
...
@@ -527,7 +527,7 @@ static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *ke
if
(
!
wcsicmp
(
key
,
L"runtime.inf"
))
wcscat
(
path
,
L"
\\
inf"
);
if
(
!
wcsicmp
(
key
,
L"runtime.inf"
))
wcscat
(
path
,
L"
\\
inf"
);
else
if
(
!
wcsicmp
(
key
,
L"runtime.drivers"
))
wcscat
(
path
,
L"
\\
drivers"
);
else
if
(
!
wcsicmp
(
key
,
L"runtime.drivers"
))
wcscat
(
path
,
L"
\\
drivers"
);
else
if
(
!
wcsicmp
(
key
,
L"runtime.wbem"
))
wcscat
(
path
,
L"
\\
wbem"
);
else
if
(
!
wcsicmp
(
key
,
L"runtime.wbem"
))
wcscat
(
path
,
L"
\\
wbem"
);
return
strdupW
(
path
);
return
wcsdup
(
path
);
}
}
static
WCHAR
*
expand_expression
(
struct
assembly_entry
*
assembly
,
const
WCHAR
*
expression
)
static
WCHAR
*
expand_expression
(
struct
assembly_entry
*
assembly
,
const
WCHAR
*
expression
)
...
...
programs/wusa/manifest.c
View file @
7e446ce7
...
@@ -160,7 +160,7 @@ static WCHAR *get_xml_attribute(IXMLDOMElement *root, const WCHAR *name)
...
@@ -160,7 +160,7 @@ static WCHAR *get_xml_attribute(IXMLDOMElement *root, const WCHAR *name)
VariantInit
(
&
var
);
VariantInit
(
&
var
);
if
(
SUCCEEDED
(
IXMLDOMElement_getAttribute
(
root
,
bstr
,
&
var
)))
if
(
SUCCEEDED
(
IXMLDOMElement_getAttribute
(
root
,
bstr
,
&
var
)))
{
{
ret
=
(
V_VT
(
&
var
)
==
VT_BSTR
)
?
strdupW
(
V_BSTR
(
&
var
))
:
NULL
;
ret
=
(
V_VT
(
&
var
)
==
VT_BSTR
)
?
wcsdup
(
V_BSTR
(
&
var
))
:
NULL
;
VariantClear
(
&
var
);
VariantClear
(
&
var
);
}
}
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
...
@@ -554,7 +554,7 @@ struct assembly_entry *load_manifest(const WCHAR *filename)
...
@@ -554,7 +554,7 @@ struct assembly_entry *load_manifest(const WCHAR *filename)
if
((
entry
=
alloc_assembly
()))
if
((
entry
=
alloc_assembly
()))
{
{
entry
->
filename
=
strdupW
(
filename
);
entry
->
filename
=
wcsdup
(
filename
);
entry
->
displayname
=
get_xml_attribute
(
root
,
L"displayName"
);
entry
->
displayname
=
get_xml_attribute
(
root
,
L"displayName"
);
if
(
iter_assembly
(
root
,
entry
))
goto
done
;
if
(
iter_assembly
(
root
,
entry
))
goto
done
;
free_assembly
(
entry
);
free_assembly
(
entry
);
...
...
programs/wusa/wusa.h
View file @
7e446ce7
...
@@ -100,14 +100,6 @@ static inline WCHAR *strdupAtoW(const char *str)
...
@@ -100,14 +100,6 @@ static inline WCHAR *strdupAtoW(const char *str)
return
ret
;
return
ret
;
}
}
static
inline
WCHAR
*
strdupW
(
const
WCHAR
*
str
)
{
WCHAR
*
ret
;
if
(
!
str
)
return
NULL
;
if
((
ret
=
malloc
((
lstrlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
))))
lstrcpyW
(
ret
,
str
);
return
ret
;
}
static
inline
WCHAR
*
strdupWn
(
const
WCHAR
*
str
,
DWORD
len
)
static
inline
WCHAR
*
strdupWn
(
const
WCHAR
*
str
,
DWORD
len
)
{
{
WCHAR
*
ret
;
WCHAR
*
ret
;
...
...
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