From df7a6629659ece3c9af23ef8076f964e9a49c866 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 12:44:10 +0000 Subject: [PATCH] Get the environment variable correctly. --- launcher/src/CmderLauncher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index bf616ad..eeff868 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -160,7 +160,9 @@ void StartCmder(std::wstring path, bool is_single_mode) } else { - SetEnvironmentVariable(L"CMDER_START", GetEnvironmentVariable(L"USER_PROFILE")); + static char buff[MAX_PATH]; + GetEnvironmentVariable(L"USER_PROFILE", buff, MAX_PATH); + SetEnvironmentVariable(L"CMDER_START", buff); } STARTUPINFO si = { 0 };