From 0d598d51ed6b3e6b2d3355d2eab368fb7d26af5a Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 30 Mar 2023 16:41:25 -0700 Subject: [PATCH] Fix Finance::Quote use on Win32. By dealing with Win32 \r\n newlines on return from finance-quote-wrapper. --- libgnucash/app-utils/gnc-quotes.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp index 69c6de5075..d8b1215de0 100644 --- a/libgnucash/app-utils/gnc-quotes.cpp +++ b/libgnucash/app-utils/gnc-quotes.cpp @@ -237,8 +237,13 @@ GncFQQuoteSource::run_cmd (const StrVec& args, const std::string& json_string) c std::istream is(&sb); while (std::getline(is, line) && !line.empty()) + { +#ifdef __WIN32 + if (line.back() == '\r') + line.pop_back(); +#endif out_vec.push_back (std::move(line)); - + } raw = err_buf.get(); bio::stream_buffer eb(raw.data(), raw.size()); std::istream es(&eb);