From e81d9d49145e432d917eea3a70d2ae74dcad1d89 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 30 Dec 2015 11:55:28 +0000 Subject: Vendor import of stripped lldb trunk r256633: https://llvm.org/svn/llvm-project/lldb/trunk@256633 --- .../ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp') diff --git a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 8209d23c0aee..f2a74b05fe26 100644 --- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -103,9 +103,13 @@ ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, lldb::off } else { - // Strip off any spaces (if the object file name contains spaces it - // will use the extended format above). - str.erase (str.find(' ')); + // Strip off any trailing spaces. + const size_t last_pos = str.find_last_not_of(' '); + if (last_pos != std::string::npos) + { + if (last_pos + 1 < 16) + str.erase (last_pos + 1); + } ar_name.SetCString(str.c_str()); } -- cgit v1.2.3