[libcxx-commits] [PATCH] D91175: [19/N] [libcxx] Fix the fallback case in temp_directory_path for windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 10 08:43:26 PST 2020


mstorsjo created this revision.
mstorsjo added a reviewer: libc++.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.
mstorsjo requested review of this revision.

Alternatively, the function could just call GetTempPath instead, which checks the TMP, TEMP, USERPROFILE env vars, and falls back on c:\windows.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91175

Files:
  libcxx/src/filesystem/operations.cpp


Index: libcxx/src/filesystem/operations.cpp
===================================================================
--- libcxx/src/filesystem/operations.cpp
+++ libcxx/src/filesystem/operations.cpp
@@ -1594,8 +1594,13 @@
   for (auto& ep : env_paths)
     if ((ret = getenv(ep)))
       break;
-  if (ret == nullptr)
+  if (ret == nullptr) {
+#if defined(_LIBCPP_WIN32API)
+    ret = "c:\\windows";
+#else
     ret = "/tmp";
+#endif
+  }
 
   path p(ret);
   error_code m_ec;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91175.304210.patch
Type: text/x-patch
Size: 472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201110/0c2def85/attachment-0001.bin>


More information about the libcxx-commits mailing list