commit 18f46ae801a311a941478d779d8d3c9db6b588ab parent c5f47bb938b004ede4f3d0576d964c679e6409d7 Author: cfillion <cfillion@users.noreply.github.com> Date: Wed, 8 Feb 2017 18:01:29 -0500 ostream: trim trailing whitespace from changelog lines Diffstat:
M | src/ostream.cpp | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/ostream.cpp b/src/ostream.cpp @@ -19,6 +19,7 @@ #include "version.hpp" +#include <boost/algorithm/string/trim.hpp> #include <locale> using namespace std; @@ -35,10 +36,10 @@ void OutputStream::indented(const string &text) string line; while(getline(stream, line, '\n')) { - const auto first = line.find_first_not_of('\x20'); + boost::algorithm::trim(line); - if(first != string::npos) - m_stream << "\x20\x20" << line.substr(first); + if(!line.empty()) + m_stream << "\x20\x20" << line; m_stream << "\r\n"; }