summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSpec.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-04-09 18:08:50 +0000
committerZachary Turner <zturner@google.com>2015-04-09 18:08:50 +0000
commit4e8ddf53337ba922e85681400c16d51ef43ccd0a (patch)
tree582dddbd4b632a06ffbd7dd661fb79445ab108bd /lldb/source/Host/common/FileSpec.cpp
parent37099d9afd9b08cea378f1c8b03d6160d4dc3e35 (diff)
downloadbcm5719-llvm-4e8ddf53337ba922e85681400c16d51ef43ccd0a.tar.gz
bcm5719-llvm-4e8ddf53337ba922e85681400c16d51ef43ccd0a.zip
[Python] Fix issue configuring sys.path during startup.
Previously, users on Windows had to manually specify PYTHONPATH to point to the site-packages directory before running LLDB. The reason for this was because sys.path was being initialized with a path containing unescaped backslashes, causing escape sequences to end up in the paths. llvm-svn: 234516
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index a968dd93b61..a3f5e6d7c10 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -798,17 +798,23 @@ FileSpec::GetPath(char *path, size_t path_max_len, bool denormalize) const
}
std::string
-FileSpec::GetPath (bool denormalize) const
+FileSpec::GetPath(bool denormalize) const
{
llvm::SmallString<64> result;
+ GetPath(result, denormalize);
+ return std::string(result.begin(), result.end());
+}
+
+void
+FileSpec::GetPath(llvm::SmallVectorImpl<char> &path, bool denormalize) const
+{
if (m_directory)
- result.append(m_directory.GetCString());
+ path.append(m_directory.GetCString(), m_directory.GetCString() + m_directory.GetLength());
if (m_filename)
- llvm::sys::path::append(result, m_filename.GetCString());
- if (denormalize && !result.empty())
- DeNormalize(result, m_syntax);
-
- return std::string(result.begin(), result.end());
+ llvm::sys::path::append(path, m_filename.GetCString());
+ Normalize(path, m_syntax);
+ if (denormalize && !path.empty())
+ DeNormalize(path, m_syntax);
}
ConstString
OpenPOWER on IntegriCloud