Fixes bug in parse_from_stdin

Handles end of file correctly
master
Paul C Roberts 8 years ago
parent 61ba0a1dd2
commit a021c3fbe2
  1. 5
      test.cpp

@ -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);

Loading…
Cancel
Save