summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/ValueObjectPrinter.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2017-03-31 01:32:57 +0000
committerJim Ingham <jingham@apple.com>2017-03-31 01:32:57 +0000
commitb9923589aa2d6918dac03c5d83faa64c463cf873 (patch)
tree1462d27ec30141b39f8823df73d65065777cc69e /lldb/source/DataFormatters/ValueObjectPrinter.cpp
parentb7b6c907bafc6f7fd4d4afea2a2cb67a2ff0488a (diff)
downloadbcm5719-llvm-b9923589aa2d6918dac03c5d83faa64c463cf873.tar.gz
bcm5719-llvm-b9923589aa2d6918dac03c5d83faa64c463cf873.zip
Don't add a newline if the object description already has one.
<rdar://problem/25755431> llvm-svn: 299147
Diffstat (limited to 'lldb/source/DataFormatters/ValueObjectPrinter.cpp')
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 173050b4691..863ff3af12e 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;
OpenPOWER on IntegriCloud