]> granicus.if.org Git - llvm/commit
Process tilde in llvm::sys::path::native
authorSerge Pavlov <sepavloff@gmail.com>
Wed, 1 Mar 2017 09:38:15 +0000 (09:38 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 1 Mar 2017 09:38:15 +0000 (09:38 +0000)
commit82d2de36f56323d9e6c40e0ab365333af64f592e
tree7fc4a922d214c201599702ed2e082aad862681bd
parentaac0739778225b43c7767e6b0e986dfcd5f51191
Process tilde in llvm::sys::path::native

Windows does not treat `~` as a reference to home directory, so the call
to `llvm::sys::path::native` on, say, `~/somedir` produces `~\somedir`,
which has different meaning than the original path. With this change
tilde is expanded on Windows to user profile directory. Such behavior
keeps original meaning of the path and is consistent with the algorithm
of `llvm::sys::path::home_directory`.

Differential Revision: https://reviews.llvm.org/D27527

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296590 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Path.cpp
unittests/Support/Path.cpp