Do not modify string returned by getenv on Windows.
Fixes PR9875, patch by Nikola Smiljanic! llvm-svn: 135356
This commit is contained in:
@@ -420,10 +420,8 @@ static bool getVisualStudioDir(std::string &path) {
|
||||
vscomntools = vs80comntools;
|
||||
|
||||
if (vscomntools && *vscomntools) {
|
||||
char *p = const_cast<char *>(strstr(vscomntools, "\\Common7\\Tools"));
|
||||
if (p)
|
||||
*p = '\0';
|
||||
path = vscomntools;
|
||||
const char *p = strstr(vscomntools, "\\Common7\\Tools");
|
||||
path = p ? std::string(vscomntools, p) : vscomntools;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user