diff options
author | Chaoren Lin <chaorenl@google.com> | 2015-05-19 23:11:58 +0000 |
---|---|---|
committer | Chaoren Lin <chaorenl@google.com> | 2015-05-19 23:11:58 +0000 |
commit | 70e0cbb3ed7c66dfc1c8ace91e86c8777aa045ce (patch) | |
tree | 8b6ca362341bf936812410e8dbeea86f616da329 /lldb/source/Host/common/FileSpec.cpp | |
parent | 4bcd428117abacf4851f6a38fa1fbb5a92f2a8ea (diff) | |
download | bcm5719-llvm-70e0cbb3ed7c66dfc1c8ace91e86c8777aa045ce.tar.gz bcm5719-llvm-70e0cbb3ed7c66dfc1c8ace91e86c8777aa045ce.zip |
Remove trailing slash from dumping directory FileSpec.
Reviewers: domipheus, ovyalov
Reviewed By: ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9862
llvm-svn: 237741
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 062cdcd98b4..7f0407578e1 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -609,12 +609,13 @@ FileSpec::RemoveBackupDots (const ConstString &input_const_str, ConstString &res // directory delimiter, and the filename. //------------------------------------------------------------------ void -FileSpec::Dump(Stream *s) const +FileSpec::Dump(Stream *s, bool trailing_slash) const { if (s) { m_directory.Dump(s); - if (m_directory && m_directory.GetStringRef().back() != '/') + if ((m_filename || trailing_slash) && m_directory && + !m_directory.GetStringRef().endswith("/")) s->PutChar('/'); m_filename.Dump(s); } @@ -816,7 +817,7 @@ void FileSpec::GetPath(llvm::SmallVectorImpl<char> &path, bool denormalize) const { StreamString stream; - Dump(&stream); + Dump(&stream, false); path.append(stream.GetString().begin(), stream.GetString().end()); Normalize(path, m_syntax); if (denormalize && !path.empty()) |