P4 to Git Change 1151506 by rili@rili_opencl_stg on 2015/05/15 14:56:06
EPR #418590 - Fix improper check for temp path.
- Existing code will change temp path to "." if tempPath is "C:\Windows\Temp\"
- Need to make sure temp path will be changed to "." if tempPath is "C:\Windows\" or "C:\Windows"
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/os/os_win32.cpp#44 edit
[ROCm/clr commit: 4b5f8c85fa]
This commit is contained in:
@@ -709,8 +709,12 @@ Os::getTempPath()
|
||||
// under windows directory, use . instead
|
||||
std::string tempPathStr(tempPath);
|
||||
char winPath[MAX_PATH];
|
||||
ret = GetWindowsDirectory(winPath, MAX_PATH);
|
||||
if (ret > 0) {
|
||||
if (GetWindowsDirectory(winPath, MAX_PATH) > 0) {
|
||||
// Need to check if tempPath is C:\Windows or C:\Windows\ //
|
||||
if (tempPath[strlen(tempPath)-1] == '\\') {
|
||||
tempPath[strlen(tempPath)-1] = '\0' ;
|
||||
ret--;
|
||||
}
|
||||
if (_memicmp(tempPath, winPath, ret) == 0) {
|
||||
return std::string(".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user