mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-22 17:06:36 -06:00
Fix quotes on Windows.
Boost process wchar_t conversion chokes if it's fed an empty string. This would happen when the user had no alphavantage key. Separate the process invocation to not present the empty value to boost process.
This commit is contained in:
parent
90e1e2d1c3
commit
576fc9b52c
@ -211,12 +211,21 @@ GncFQQuoteSource::run_cmd (const StrVec& args, const std::string& json_string) c
|
|||||||
boost::asio::io_service svc;
|
boost::asio::io_service svc;
|
||||||
|
|
||||||
auto input_buf = bp::buffer (json_string);
|
auto input_buf = bp::buffer (json_string);
|
||||||
bp::child process (c_cmd, args,
|
bp::child process;
|
||||||
|
if (m_api_key.empty())
|
||||||
|
process = bp::child(c_cmd, args,
|
||||||
bp::std_out > out_buf,
|
bp::std_out > out_buf,
|
||||||
bp::std_err > err_buf,
|
bp::std_err > err_buf,
|
||||||
bp::std_in < input_buf,
|
bp::std_in < input_buf,
|
||||||
bp::env["ALPHAVANTAGE_API_KEY"]= (m_api_key.empty() ? "" : m_api_key),
|
|
||||||
svc);
|
svc);
|
||||||
|
else
|
||||||
|
process = bp::child(c_cmd, args,
|
||||||
|
bp::std_out > out_buf,
|
||||||
|
bp::std_err > err_buf,
|
||||||
|
bp::std_in < input_buf,
|
||||||
|
bp::env["ALPHAVANTAGE_API_KEY"] = m_api_key,
|
||||||
|
svc);
|
||||||
|
|
||||||
svc.run();
|
svc.run();
|
||||||
process.wait();
|
process.wait();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user