From 9f20c4885dd9913ba994bd9d58778cb6503f36ae Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 19 Jun 2017 20:22:53 +0100 Subject: [PATCH] Eat up the last newline in a pastie if present. --- src/kamokan_impl/pastie_response.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kamokan_impl/pastie_response.cpp b/src/kamokan_impl/pastie_response.cpp index 585071c..02b03dc 100644 --- a/src/kamokan_impl/pastie_response.cpp +++ b/src/kamokan_impl/pastie_response.cpp @@ -90,6 +90,9 @@ namespace kamokan { using boost::adaptors::transformed; using MatchRange = boost::iterator_range; + if (not parPastie.empty() and parPastie[parPastie.size() - 1] == '\n') + parPastie = parPastie.substr(0, parPastie.size() - 1); + int line_num = 1; return boost::copy_range( boost::make_iterator_range(