From b9923589aa2d6918dac03c5d83faa64c463cf873 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 31 Mar 2017 01:32:57 +0000 Subject: [PATCH] Don't add a newline if the object description already has one. llvm-svn: 299147 --- lldb/source/DataFormatters/ValueObjectPrinter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index 173050b46911..863ff3af12e8 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -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;