From 3609d0357bf728ab83182bbe3525ca5870eeb7ed Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 15 May 2015 15:26:19 -0400
Subject: [PATCH] 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: 4b5f8c85fa3d908dc20b9d8e2b4c1093c76532ce]
---
projects/clr/rocclr/runtime/os/os_win32.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/projects/clr/rocclr/runtime/os/os_win32.cpp b/projects/clr/rocclr/runtime/os/os_win32.cpp
index a382dfb6eb..8983b6a1d9 100644
--- a/projects/clr/rocclr/runtime/os/os_win32.cpp
+++ b/projects/clr/rocclr/runtime/os/os_win32.cpp
@@ -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(".");
}