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
d5b620ea
Commit
d5b620ea
authored
Oct 17, 2007
by
Mikolaj Zalewski
Committed by
Alexandre Julliard
Oct 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Make the WriteEnvironmentStrings handling of [~] a bit better.
parent
7d2ac203
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
action.c
dlls/msi/action.c
+18
-14
No files found.
dlls/msi/action.c
View file @
d5b620ea
...
...
@@ -4757,12 +4757,13 @@ static UINT ACTION_InstallODBC( MSIPACKAGE *package )
#define check_flag_combo(x, y) ((x) & ~(y)) == (y)
static
LONG
env_set_flags
(
LPCWSTR
*
name
,
LPWSTR
*
value
,
DWORD
*
flags
)
static
LONG
env_set_flags
(
LPCWSTR
*
name
,
LP
C
WSTR
*
value
,
DWORD
*
flags
)
{
LPCWSTR
cptr
=
*
name
;
LPWSTR
ptr
=
*
value
;
LP
C
WSTR
ptr
=
*
value
;
static
const
WCHAR
prefix
[]
=
{
'['
,
'~'
,
']'
,
0
};
static
const
int
prefix_len
=
3
;
*
flags
=
0
;
while
(
*
cptr
)
...
...
@@ -4790,18 +4791,18 @@ static LONG env_set_flags( LPCWSTR *name, LPWSTR *value, DWORD *flags )
return
ERROR_FUNCTION_FAILED
;
}
if
(
!
strncmpW
(
ptr
,
prefix
,
lstrlenW
(
prefix
)
))
if
(
!
strncmpW
(
ptr
,
prefix
,
prefix_len
))
{
*
flags
|=
ENV_MOD_
PREFIX
;
*
flags
|=
ENV_MOD_
APPEND
;
*
value
+=
lstrlenW
(
prefix
);
}
else
else
if
(
lstrlenW
(
*
value
)
>=
prefix_len
)
{
ptr
+=
lstrlenW
(
ptr
)
-
lstrlenW
(
prefix
)
-
1
;
ptr
+=
lstrlenW
(
ptr
)
-
prefix_len
;
if
(
!
lstrcmpW
(
ptr
,
prefix
))
{
*
flags
|=
ENV_MOD_
APPEND
;
*
ptr
=
'\0'
;
*
flags
|=
ENV_MOD_
PREFIX
;
/* the "[~]" will be removed by deformat_string */
;
}
}
...
...
@@ -4823,7 +4824,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
MSIPACKAGE
*
package
=
param
;
LPCWSTR
name
,
value
,
comp
;
LPWSTR
data
=
NULL
,
newval
=
NULL
;
LPWSTR
deformatted
,
ptr
;
LPWSTR
deformatted
=
NULL
,
ptr
;
DWORD
flags
,
type
,
size
;
LONG
res
;
HKEY
env
=
NULL
,
root
=
HKEY_CURRENT_USER
;
...
...
@@ -4840,14 +4841,17 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
value
=
MSI_RecordGetString
(
rec
,
3
);
comp
=
MSI_RecordGetString
(
rec
,
4
);
deformat_string
(
package
,
value
,
&
deformatted
);
if
(
!
deformatted
)
return
ERROR_OUTOFMEMORY
;
res
=
env_set_flags
(
&
name
,
&
deformatted
,
&
flags
);
res
=
env_set_flags
(
&
name
,
&
value
,
&
flags
);
if
(
res
!=
ERROR_SUCCESS
)
goto
done
;
deformat_string
(
package
,
value
,
&
deformatted
);
if
(
!
deformatted
)
{
res
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
value
=
deformatted
;
if
(
flags
&
ENV_MOD_MACHINE
)
...
...
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