[PATCH] Windows ToolChain: remove excessive backslash if we find WindowsSDK

Andrey Kuharev an.kuharev at gmail.com
Mon Apr 21 22:14:21 PDT 2014


akuharev added you to the CC list for the revision "Windows ToolChain: remove excessive backslash if we find WindowsSDK".

Hi chandlerc,

Previously we had:
clang -cc1 ... double backslash in windowsSDK include

Excessive backslash is returned by function getWindowsSDKDir.
The Windows registry contains Microsoft InstallDir with trailing backslash.

http://reviews.llvm.org/D3440

Files:
  lib/Driver/WindowsToolChain.cpp

Index: lib/Driver/WindowsToolChain.cpp
===================================================================
--- lib/Driver/WindowsToolChain.cpp
+++ lib/Driver/WindowsToolChain.cpp
@@ -196,6 +196,9 @@
                                            sizeof(windowsSDKInstallDir) - 1);
     // If we have both vc80 and vc90, pick version we were compiled with.
   if (hasSDKDir && windowsSDKInstallDir[0]) {
+    char *p = windowsSDKInstallDir + strlen(windowsSDKInstallDir) - 1;
+    if (*p == '\\')
+      *p = '\0';
     path = windowsSDKInstallDir;
     return true;
   }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3440.1.patch
Type: text/x-patch
Size: 577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140421/43315d43/attachment.bin>


More information about the cfe-commits mailing list