Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5af60b5e
Commit
5af60b5e
authored
Apr 16, 2012
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler warnings
parent
85f7acf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
win/packaging/ca/CustomAction.cpp
win/packaging/ca/CustomAction.cpp
+7
-6
No files found.
win/packaging/ca/CustomAction.cpp
View file @
5af60b5e
...
...
@@ -80,7 +80,7 @@ LExit:
It is assumed that called will add double quotation marks before and after
the string.
*/
static
void
EscapeCommandLine
(
const
wchar_t
*
in
,
wchar_t
*
out
)
static
void
EscapeCommandLine
(
const
wchar_t
*
in
,
wchar_t
*
out
,
size_t
buflen
)
{
const
wchar_t
special_chars
[]
=
L"
\t\n\v\"
"
;
bool
needs_escaping
=
false
;
...
...
@@ -97,7 +97,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
if
(
!
needs_escaping
)
{
wcscpy
(
out
,
in
);
wcscpy
_s
(
out
,
buflen
,
in
);
return
;
}
...
...
@@ -119,7 +119,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
Escape all backslashes, but let the terminating double quotation mark
that caller adds be interpreted as a metacharacter.
*/
for
(
in
t
j
=
0
;
j
<
2
*
n_backslashes
;
j
++
)
for
(
size_
t
j
=
0
;
j
<
2
*
n_backslashes
;
j
++
)
{
out
[
pos
++
]
=
L'\\'
;
}
...
...
@@ -130,7 +130,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
/*
Escape all backslashes and the following double quotation mark.
*/
for
(
in
t
j
=
0
;
j
<
2
*
n_backslashes
+
1
;
j
++
)
for
(
size_
t
j
=
0
;
j
<
2
*
n_backslashes
+
1
;
j
++
)
{
out
[
pos
++
]
=
L'\\'
;
}
...
...
@@ -139,7 +139,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
else
{
/* Backslashes aren't special here. */
for
(
in
t
j
=
0
;
j
<
n_backslashes
;
j
++
)
for
(
size_
t
j
=
0
;
j
<
n_backslashes
;
j
++
)
out
[
pos
++
]
=
L'\\'
;
out
[
pos
++
]
=
c
;
...
...
@@ -592,7 +592,8 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
DWORD
PasswordLen
=
MAX_PATH
;
MsiGetPropertyW
(
hInstall
,
L"PASSWORD"
,
Password
,
&
PasswordLen
);
EscapeCommandLine
(
Password
,
EscapedPassword
);
EscapeCommandLine
(
Password
,
EscapedPassword
,
sizeof
(
EscapedPassword
)
/
sizeof
(
EscapedPassword
[
0
]));
MsiSetPropertyW
(
hInstall
,
L"ESCAPEDPASSWORD"
,
EscapedPassword
);
DWORD
SkipNetworkingLen
=
MAX_PATH
;
...
...
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