From 2074f7e78b88efce06a41afc2c638bb8d14bbfe8 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 15 May 2014 15:51:03 -0400 Subject: [PATCH] Fix handling of newline characters in command-prompt output --- plugins/command-prompt.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/command-prompt.cpp b/plugins/command-prompt.cpp index 19460f19b..a5903f2b3 100644 --- a/plugins/command-prompt.cpp +++ b/plugins/command-prompt.cpp @@ -56,9 +56,14 @@ public: df::global::gps->display_frames=show_fps; } - void add_response(color_value v,std::string s) + void add_response(color_value v, std::string s) { - responses.push_back(std::make_pair(v,s)); + std::stringstream ss(s); + std::string part; + while (std::getline(ss, part)) + { + responses.push_back(std::make_pair(v, part)); + } } protected: std::list > responses;