From 597061aed11b6437c6beaaf6822b26bd39985e99 Mon Sep 17 00:00:00 2001 From: mjk Date: Thu, 18 Mar 2021 23:40:30 +0000 Subject: [PATCH] work around GetEnvironmentVariable not resetting last error --- plugins/windows-notification/api/src/win32.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/windows-notification/api/src/win32.cpp b/plugins/windows-notification/api/src/win32.cpp index 85982a09..42bc45b0 100644 --- a/plugins/windows-notification/api/src/win32.cpp +++ b/plugins/windows-notification/api/src/win32.cpp @@ -29,6 +29,7 @@ std::wstring GetEnv(const wchar_t *const variable_name) if (not bufsize) throw win32_error{}; std::wstring buf(bufsize, noncharacter); + ::SetLastError(0); const auto res = ::GetEnvironmentVariableW(variable_name, buf.data(), bufsize); if (const auto e = ::GetLastError())