From: Zebediah Figura zfigura@codeweavers.com
env_set() modifies both environments in either case, and expects the variables to have separate allocations already.
Fixes: bdb624fffb1c1acc1feb2baec396d9b805cb0ce9 --- dlls/msvcrt/environ.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/environ.c b/dlls/msvcrt/environ.c index 9e358d971f9..0a0bb5ce058 100644 --- a/dlls/msvcrt/environ.c +++ b/dlls/msvcrt/environ.c @@ -265,7 +265,8 @@ static int putenv_helper(const char *name, const char *val, const char *eq) int r;
_lock(_ENV_LOCK); - r = env_init(FALSE, TRUE); + if (!(r = env_init(FALSE, TRUE))) + r = env_init(TRUE, TRUE); _unlock(_ENV_LOCK); if (r) return -1;
@@ -320,7 +321,8 @@ static int wputenv_helper(const wchar_t *name, const wchar_t *val, const wchar_t int r;
_lock(_ENV_LOCK); - r = env_init(TRUE, TRUE); + if (!(r = env_init(FALSE, TRUE))) + r = env_init(TRUE, TRUE); _unlock(_ENV_LOCK); if (r) return -1;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=140535
Your paranoid android.
=== debian11 (32 bit report) ===
msvcrt: environ.c:178: Test failed: Expected _wenviron[] to be NULL, got 003F2D18 environ.c:183: Test failed: Expected _wenviron to be NULL, got 003F2D18 environ.c:197: Test failed: Expected initial env to be NULL environ.c:205: Test failed: Expected _wenviron to be NULL environ.c:215: Test failed: Expected _wenviron to be NULL environ.c:236: Test failed: Expecting initial env to be derived from current env (got (null))
=== debian11b (64 bit WoW report) ===
msvcrt: environ.c:178: Test failed: Expected _wenviron[] to be NULL, got 00007FFFFE8A59D0 environ.c:205: Test failed: Expected _wenviron to be NULL environ.c:215: Test failed: Expected _wenviron to be NULL