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
eb094728
Commit
eb094728
authored
Oct 06, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Oct 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Initialize _wenviron in Unicode environment getter function.
parent
797d6cb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
environ.c
dlls/msvcrt/environ.c
+6
-2
environ.c
dlls/msvcrt/tests/environ.c
+7
-0
No files found.
dlls/msvcrt/environ.c
View file @
eb094728
...
@@ -34,7 +34,7 @@ char * CDECL MSVCRT_getenv(const char *name)
...
@@ -34,7 +34,7 @@ char * CDECL MSVCRT_getenv(const char *name)
char
**
environ
;
char
**
environ
;
unsigned
int
length
=
strlen
(
name
);
unsigned
int
length
=
strlen
(
name
);
for
(
environ
=
*
__p__environ
()
;
*
environ
;
environ
++
)
for
(
environ
=
MSVCRT__environ
;
*
environ
;
environ
++
)
{
{
char
*
str
=
*
environ
;
char
*
str
=
*
environ
;
char
*
pos
=
strchr
(
str
,
'='
);
char
*
pos
=
strchr
(
str
,
'='
);
...
@@ -55,7 +55,11 @@ MSVCRT_wchar_t * CDECL _wgetenv(const MSVCRT_wchar_t *name)
...
@@ -55,7 +55,11 @@ MSVCRT_wchar_t * CDECL _wgetenv(const MSVCRT_wchar_t *name)
MSVCRT_wchar_t
**
environ
;
MSVCRT_wchar_t
**
environ
;
unsigned
int
length
=
strlenW
(
name
);
unsigned
int
length
=
strlenW
(
name
);
for
(
environ
=
*
__p__wenviron
();
*
environ
;
environ
++
)
/* Initialize the _wenviron array if it's not already created. */
if
(
!
MSVCRT__wenviron
)
MSVCRT__wenviron
=
msvcrt_SnapshotOfEnvironmentW
(
NULL
);
for
(
environ
=
MSVCRT__wenviron
;
*
environ
;
environ
++
)
{
{
MSVCRT_wchar_t
*
str
=
*
environ
;
MSVCRT_wchar_t
*
str
=
*
environ
;
MSVCRT_wchar_t
*
pos
=
strchrW
(
str
,
'='
);
MSVCRT_wchar_t
*
pos
=
strchrW
(
str
,
'='
);
...
...
dlls/msvcrt/tests/environ.c
View file @
eb094728
...
@@ -125,6 +125,9 @@ static void test__environ(void)
...
@@ -125,6 +125,9 @@ static void test__environ(void)
static
void
test__wenviron
(
void
)
static
void
test__wenviron
(
void
)
{
{
static
const
WCHAR
cat_eq_dogW
[]
=
{
'c'
,
'a'
,
't'
,
'='
,
'd'
,
'o'
,
'g'
,
0
};
static
const
WCHAR
cat_eqW
[]
=
{
'c'
,
'a'
,
't'
,
'='
,
0
};
int
argc
;
int
argc
;
char
**
argv
,
**
envp
=
NULL
;
char
**
argv
,
**
envp
=
NULL
;
WCHAR
**
wargv
,
**
wenvp
=
NULL
;
WCHAR
**
wargv
,
**
wenvp
=
NULL
;
...
@@ -166,6 +169,10 @@ static void test__wenviron(void)
...
@@ -166,6 +169,10 @@ static void test__wenviron(void)
/* _wenviron isn't initialized until __wgetmainargs is called or
/* _wenviron isn't initialized until __wgetmainargs is called or
* one of the Unicode environment manipulation functions is called. */
* one of the Unicode environment manipulation functions is called. */
ok
(
_wputenv
(
cat_eq_dogW
)
==
0
,
"failed setting cat=dog
\n
"
);
ok
(
*
p_wenviron
!=
NULL
,
"Expected _wenviron to be non-NULL
\n
"
);
ok
(
_wputenv
(
cat_eqW
)
==
0
,
"failed deleting cat
\n
"
);
__wgetmainargs
(
&
argc
,
&
wargv
,
&
wenvp
,
0
,
&
mode
);
__wgetmainargs
(
&
argc
,
&
wargv
,
&
wenvp
,
0
,
&
mode
);
ok
(
*
p_wenviron
!=
NULL
,
"Expected _wenviron to be non-NULL
\n
"
);
ok
(
*
p_wenviron
!=
NULL
,
"Expected _wenviron to be non-NULL
\n
"
);
...
...
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