未验证 提交 18841275 编写于 作者: W wanderingbort 提交者: GitHub

Merge pull request #2113 from EOSIO/fix-cleos-large-json

Fix problems with large json strings in cleos commands
......@@ -71,6 +71,7 @@ Options:
*/
#include <string>
#include <vector>
#include <regex>
#include <boost/asio.hpp>
#include <boost/format.hpp>
#include <iostream>
......@@ -398,7 +399,8 @@ chain::action create_unlinkauth(const name& account, const name& code, const nam
fc::variant json_from_file_or_string(const string& file_or_str, fc::json::parse_type ptype = fc::json::legacy_parser)
{
if ( is_regular_file(file_or_str) ) {
regex r("^[ \t]*[\{\[]");
if ( !regex_search(file_or_str, r) && is_regular_file(file_or_str) ) {
return fc::json::from_file(file_or_str, ptype);
} else {
return fc::json::from_string(file_or_str, ptype);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册