From 5b94e11873b93539befa9f10b9e7f11e3844dd30 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 20 Oct 2015 00:17:39 +0000 Subject: 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 --- lldb/source/Host/common/FileSpec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Host/common') 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); -- cgit v1.2.3