summaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/API/SBFileSpec.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 8668b64b4ce7..a7df9afc4b8e 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -114,7 +114,9 @@ const char *SBFileSpec::GetFilename() const {
const char *SBFileSpec::GetDirectory() const {
LLDB_INSTRUMENT_VA(this);
- return m_opaque_up->GetDirectory().GetCString();
+ FileSpec directory{*m_opaque_up};
+ directory.ClearFilename();
+ return directory.GetPathAsConstString().GetCString();
}
void SBFileSpec::SetFilename(const char *filename) {