summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp')
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index d9d399c5eff..f2a74b05fe2 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -103,11 +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).
- const size_t space_pos = str.find(' ');
- if (space_pos != std::string::npos)
- str.erase (space_pos);
+ // 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());
}
OpenPOWER on IntegriCloud