summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Host/windows/HostInfoWindows.cpp3
-rw-r--r--lldb/test/functionalities/paths/TestPaths.py6
2 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Host/windows/HostInfoWindows.cpp b/lldb/source/Host/windows/HostInfoWindows.cpp
index b1c880f0ffe..6dce71d9172 100644
--- a/lldb/source/Host/windows/HostInfoWindows.cpp
+++ b/lldb/source/Host/windows/HostInfoWindows.cpp
@@ -109,8 +109,7 @@ HostInfoWindows::ComputePythonDirectory(FileSpec &file_spec)
FileSpec lldb_file_spec;
if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
return false;
- llvm::SmallString<64> path;
- lldb_file_spec.GetPath(path);
+ llvm::SmallString<64> path(lldb_file_spec.GetDirectory().AsCString());
llvm::sys::path::remove_filename(path);
llvm::sys::path::append(path, "lib", "site-packages");
std::replace(path.begin(), path.end(), '\\', '/');
diff --git a/lldb/test/functionalities/paths/TestPaths.py b/lldb/test/functionalities/paths/TestPaths.py
index bc549a64bf8..abc13d83c45 100644
--- a/lldb/test/functionalities/paths/TestPaths.py
+++ b/lldb/test/functionalities/paths/TestPaths.py
@@ -34,6 +34,12 @@ class TestPaths(TestBase):
# file path if it doesn't exist in the current directory.
self.assertTrue (file_only.GetDirectory() == None)
+ def test_directory_doesnt_end_with_slash(self):
+ current_directory_spec = lldb.SBFileSpec(os.path.curdir)
+ current_directory_string = current_directory_spec.GetDirectory()
+ self.assertNotEqual(current_directory_string[-1:], '/')
+ pass
+
@skipUnlessPlatform(["windows"])
def test_windows_double_slash (self):
'''Test to check the path with double slash is handled correctly '''
OpenPOWER on IntegriCloud