Get the environment variable correctly.

This commit is contained in:
Martin Kemp 2016-01-15 12:44:10 +00:00
parent 9c7a037948
commit df7a662965

View File

@ -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 };