Merge pull request #40 from PollRobots/fix-stdin-test

Fixes bug in parse_from_stdin
pull/5/head
j4cbo 2015-08-24 11:24:01 -07:00
commit b1e78cb1e4
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ CHECK_TRAIT(is_nothrow_destructible<Json>);
void parse_from_stdin() {
string buf;
while (!std::cin.eof()) buf += std::cin.get();
string line;
while (std::getline(std::cin, line)) {
buf += line + "\n";
}
string err;
auto json = Json::parse(buf, err);