Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Billy Laws
wine
Commits
14527471
Commit
14527471
authored
4 months ago
by
Piotr Caban
Committed by
Alexandre Julliard
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ucrtbase: Always use CP_ACP when converting environment block.
parent
9090694f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/msvcrt/process.c
+3
-2
3 additions, 2 deletions
dlls/msvcrt/process.c
dlls/ucrtbase/tests/file.c
+17
-3
17 additions, 3 deletions
dlls/ucrtbase/tests/file.c
with
20 additions
and
5 deletions
dlls/msvcrt/process.c
+
3
−
2
View file @
14527471
...
...
@@ -233,6 +233,7 @@ static wchar_t* msvcrt_argvtos(const wchar_t* const* arg, wchar_t delim)
*/
static
wchar_t
*
msvcrt_argvtos_aw
(
const
char
*
const
*
arg
,
BOOL
env
)
{
UINT
cp
=
env
?
CP_ACP
:
get_aw_cp
();
const
char
*
const
*
a
;
unsigned
int
len
;
wchar_t
*
p
,
*
ret
;
...
...
@@ -248,7 +249,7 @@ static wchar_t *msvcrt_argvtos_aw(const char * const *arg, BOOL env)
len
=
0
;
while
(
*
a
)
{
len
+=
MultiByteToWideChar
(
get_aw_cp
()
,
0
,
*
a
,
-
1
,
NULL
,
0
);
len
+=
MultiByteToWideChar
(
cp
,
0
,
*
a
,
-
1
,
NULL
,
0
);
a
++
;
}
...
...
@@ -261,7 +262,7 @@ static wchar_t *msvcrt_argvtos_aw(const char * const *arg, BOOL env)
p
=
ret
;
while
(
*
a
)
{
p
+=
MultiByteToWideChar
(
get_aw_cp
()
,
0
,
*
a
,
strlen
(
*
a
),
p
,
len
-
(
p
-
ret
));
p
+=
MultiByteToWideChar
(
cp
,
0
,
*
a
,
strlen
(
*
a
),
p
,
len
-
(
p
-
ret
));
*
p
++
=
env
?
0
:
' '
;
a
++
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/ucrtbase/tests/file.c
+
17
−
3
View file @
14527471
...
...
@@ -225,7 +225,7 @@ static void test_utf8(const char *argv0)
const
WCHAR
fileW
[]
=
L"file
\x0119\x015b\x0107
.a"
;
const
WCHAR
dirW
[]
=
L"dir
\x0119\x015b\x0107
"
;
char
file2
[
32
],
buf
[
256
],
*
p
,
*
q
;
char
file2
[
32
],
buf
[
256
],
*
p
,
*
q
,
*
env
[
2
]
;
struct
_finddata64i32_t
fdata64i32
;
struct
_finddata32_t
fdata32
;
struct
_finddata64_t
fdata64
;
...
...
@@ -421,7 +421,11 @@ static void test_utf8(const char *argv0)
ok
(
!
ret
,
"_putenv returned %d, errno %d
\n
"
,
ret
,
errno
);
}
hproc
=
_spawnl
(
_P_NOWAIT
,
argv0
,
argv0
,
"file"
,
"utf8"
,
file
,
NULL
);
strcpy
(
buf
,
"__wine_env_test="
);
strcat
(
buf
,
file
);
env
[
0
]
=
buf
;
env
[
1
]
=
NULL
;
hproc
=
_spawnle
(
_P_NOWAIT
,
argv0
,
argv0
,
"file"
,
"utf8"
,
file
,
NULL
,
env
);
ok
(
hproc
!=
-
1
,
"_spawnl returned %Id, errno %d
\n
"
,
hproc
,
errno
);
wait_child_process
((
HANDLE
)
hproc
);
CloseHandle
((
HANDLE
)
hproc
);
...
...
@@ -431,11 +435,21 @@ static void test_utf8(const char *argv0)
static
void
test_utf8_argument
(
void
)
{
static
const
WCHAR
nameW
[]
=
L"file
\x0119\x015b\x0107
.a"
;
const
WCHAR
*
cmdline
=
GetCommandLineW
(),
*
p
;
WCHAR
buf
[
256
];
DWORD
ret
;
p
=
wcsrchr
(
cmdline
,
' '
);
ok
(
!!
p
,
"cmdline = %s
\n
"
,
debugstr_w
(
cmdline
));
ok
(
!
wcscmp
(
p
+
1
,
L"file
\x0119\x015b\x0107
.a"
),
"cmdline = %s
\n
"
,
debugstr_w
(
cmdline
));
ok
(
!
wcscmp
(
p
+
1
,
nameW
),
"cmdline = %s
\n
"
,
debugstr_w
(
cmdline
));
ret
=
GetEnvironmentVariableW
(
L"__wine_env_test"
,
buf
,
sizeof
(
buf
));
ok
(
ret
,
"GetEnvironmentVariableW returned error %lu
\n
"
,
GetLastError
());
if
(
GetACP
()
==
CP_UTF8
)
ok
(
!
wcscmp
(
buf
,
nameW
),
"__wine_env_test = %s
\n
"
,
debugstr_w
(
buf
));
else
ok
(
wcscmp
(
buf
,
nameW
),
"environment was converted
\n
"
);
}
START_TEST
(
file
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment