Don't add a newline if the object description already has one.

<rdar://problem/25755431>

llvm-svn: 299147
This commit is contained in:
Jim Ingham 2017-03-31 01:32:57 +00:00
parent b7b6c907ba
commit b9923589aa
1 changed files with 6 additions and 1 deletions

View File

@ -457,7 +457,12 @@ bool ValueObjectPrinter::PrintObjectDescriptionIfNeeded(bool value_printed,
else
object_desc = GetDescriptionForDisplay();
if (object_desc && *object_desc) {
m_stream->Printf("%s\n", object_desc);
// If the description already ends with a \n don't add another one.
size_t object_end = strlen(object_desc) - 1;
if (object_desc[object_end] == '\n')
m_stream->Printf("%s", object_desc);
else
m_stream->Printf("%s\n", object_desc);
return true;
} else if (value_printed == false && summary_printed == false)
return true;