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
4777a3a3
Commit
4777a3a3
authored
Dec 16, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Dec 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Simplify ExpandAnyPath.
parent
ce6e84c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
36 deletions
+13
-36
appsearch.c
dlls/msi/appsearch.c
+13
-36
No files found.
dlls/msi/appsearch.c
View file @
4777a3a3
...
...
@@ -466,8 +466,7 @@ static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue,
static
void
ACTION_ExpandAnyPath
(
MSIPACKAGE
*
package
,
WCHAR
*
src
,
WCHAR
*
dst
,
size_t
len
)
{
WCHAR
*
ptr
;
size_t
copied
=
0
;
WCHAR
*
ptr
,
*
deformatted
;
if
(
!
src
||
!
dst
||
!
len
)
{
...
...
@@ -475,46 +474,24 @@ static void ACTION_ExpandAnyPath(MSIPACKAGE *package, WCHAR *src, WCHAR *dst,
return
;
}
/* Ignore the short portion of the path, don't think we can use it anyway */
dst
[
0
]
=
'\0'
;
/* Ignore the short portion of the path */
if
((
ptr
=
strchrW
(
src
,
'|'
)))
ptr
++
;
else
ptr
=
src
;
while
(
*
ptr
&&
copied
<
len
-
1
)
{
WCHAR
*
prop
=
strchrW
(
ptr
,
'['
);
if
(
prop
)
{
WCHAR
*
propEnd
=
strchrW
(
prop
+
1
,
']'
);
if
(
!
propEnd
)
{
WARN
(
"Unterminated property name in AnyPath: %s
\n
"
,
debugstr_w
(
prop
));
break
;
}
else
{
DWORD
propLen
;
*
propEnd
=
0
;
propLen
=
len
-
copied
-
1
;
MSI_GetPropertyW
(
package
,
prop
+
1
,
dst
+
copied
,
&
propLen
);
ptr
=
propEnd
+
1
;
copied
+=
propLen
;
}
}
else
{
size_t
toCopy
=
min
(
strlenW
(
ptr
)
+
1
,
len
-
copied
-
1
);
memcpy
(
dst
+
copied
,
ptr
,
toCopy
*
sizeof
(
WCHAR
));
ptr
+=
toCopy
;
copied
+=
toCopy
;
}
deformat_string
(
package
,
ptr
,
&
deformatted
);
if
(
!
deformatted
||
lstrlenW
(
deformatted
)
>
len
-
1
)
{
msi_free
(
deformatted
);
return
;
}
*
(
dst
+
copied
)
=
'\0'
;
lstrcpyW
(
dst
,
deformatted
);
dst
[
lstrlenW
(
deformatted
)]
=
'\0'
;
msi_free
(
deformatted
);
}
/* Sets *matches to whether the file (whose path is filePath) matches the
...
...
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