diff options
author | Greg Clayton <gclayton@apple.com> | 2015-10-20 00:17:39 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-10-20 00:17:39 +0000 |
commit | 5b94e11873b93539befa9f10b9e7f11e3844dd30 (patch) | |
tree | ea47860d1391b58dc805acfe50a2e9effbb369ba /lldb/source/Host/common | |
parent | 7869148c4741f30893159e028ad991bd2e0a5d63 (diff) | |
download | bcm5719-llvm-5b94e11873b93539befa9f10b9e7f11e3844dd30.tar.gz bcm5719-llvm-5b94e11873b93539befa9f10b9e7f11e3844dd30.zip |
When calling FileSpec::AppendPathComponent() we don't need to include "." in the path if m_filename is set to exactly '.'. Previously this would cause a FileSpec object that looked like:
m_directory = "/tmp"
m_filename = "."
To look like:
m_directory = "/tmp/."
m_filename = "foo.txt"
if "foo.txt" was appended to it. With this fix it will be:
m_directory = "/tmp"
m_filename = "foo.txt"
llvm-svn: 250770
Diffstat (limited to 'lldb/source/Host/common')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 9efdacb010b..8885a791d88 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -1431,7 +1431,7 @@ FileSpec::AppendPathComponent(const char *new_path) return; } StreamString stream; - if (m_filename.IsEmpty()) + if (m_filename.IsEmpty() || (m_filename.GetLength() == 1 && m_filename.GetCString()[0] == '.')) stream.Printf("%s/%s", m_directory.GetCString(), new_path); else if (m_directory.IsEmpty()) stream.Printf("%s/%s", m_filename.GetCString(), new_path); |