Module: wine Branch: master Commit: 2f2cdc8bb147f62ade1c5a2f1ae4c7b2863e6b08 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2f2cdc8bb147f62ade1c5a2f1...
Author: Gijs Vermeulen gijsvrm@gmail.com Date: Wed Apr 21 20:21:36 2021 +0200
ntdll: Don't fail when trying to remove the value of a non-existant variable in RtlSetEnvironmentVariable().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51035 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/env.c | 3 +-- dlls/ntdll/tests/env.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 1ed52b9728f..c11960db165 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -276,7 +276,7 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, { INT varlen, len, old_size; LPWSTR p, env; - NTSTATUS nts = STATUS_VARIABLE_NOT_FOUND; + NTSTATUS nts = STATUS_SUCCESS;
TRACE("(%p, %s, %s)\n", penv, debugstr_us(name), debugstr_us(value));
@@ -352,7 +352,6 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, memcpy( p, value->Buffer, value->Length ); p[value->Length / sizeof(WCHAR)] = 0; } - nts = STATUS_SUCCESS;
done: if (!penv) RtlReleasePebLock(); diff --git a/dlls/ntdll/tests/env.c b/dlls/ntdll/tests/env.c index eed8ae38c14..da61d11c1f2 100644 --- a/dlls/ntdll/tests/env.c +++ b/dlls/ntdll/tests/env.c @@ -621,7 +621,7 @@ static void test_RtlSetEnvironmentVariable(void) query_env_var(env, L"cat", NULL);
status = set_env_var(&env, L"cat", NULL); - todo_wine ok(!status, "got %#x\n", status); + ok(!status, "got %#x\n", status);
status = set_env_var(&env, L"foo", L"meouw"); ok(!status, "got %#x\n", status); @@ -632,7 +632,7 @@ static void test_RtlSetEnvironmentVariable(void) query_env_var(env, L"foo", NULL);
status = set_env_var(&env, L"horse", NULL); - todo_wine ok(!status, "got %#x\n", status); + ok(!status, "got %#x\n", status); query_env_var(env, L"horse", NULL);
status = set_env_var(&env, L"me=too", L"also");