From 80131e24f0b7392cc73a666b9f89c014265d0f4c Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 24 Jun 2019 11:55:36 +0200 Subject: [PATCH] Remove potential extra newline in Debug::LLDB::get_value --- src/debug_lldb.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/debug_lldb.cc b/src/debug_lldb.cc index 7fdbaf0..5d6ead0 100644 --- a/src/debug_lldb.cc +++ b/src/debug_lldb.cc @@ -434,7 +434,10 @@ std::string Debug::LLDB::get_value(const std::string &variable, const boost::fil value_decl_path /= file_spec.GetFilename(); if(value_decl_path == file_path) { value.GetDescription(stream); - return stream.GetData(); + std::string variable_value = stream.GetData(); + if(variable_value.size() >= 2 && variable_value.compare(variable_value.size() - 2, 2, "\n\n", 2) == 0) + variable_value.pop_back(); // Remove newline at end of string + return variable_value; } } }