kastnermario / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Parsing single char doesn't produce valid YAML::Node #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

std::istringstream sstream("5");

YAML::Node yNode;
YAML::Parser parser(sstream);
parser.GetNextDocument(yNode);

string s;
yNode >> s;
cout << s << endl; -> produces: ~
int i; yNode >> i; <- fails
------
std::istringstream sstream(" 5"); <- pad with space

YAML::Node yNode;
YAML::Parser parser(sstream);
parser.GetNextDocument(yNode);

string s;
yNode >> s;
cout << s << endl; -> produces: 5
int i; yNode >> i; <- ok
-------

What is the expected output? What do you see instead?
Singe char values produces an invalid YAML::Node showing "~".

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by m...@riedel-privat.de on 20 Oct 2011 at 3:32

GoogleCodeExporter commented 8 years ago
Whoa! Nice catch!

Original comment by jbe...@gmail.com on 20 Oct 2011 at 6:50

GoogleCodeExporter commented 8 years ago
Fixed, r3e54f4e8dfbd

Original comment by jbe...@gmail.com on 21 Oct 2011 at 3:30

GoogleCodeExporter commented 8 years ago
Uh that was quick. Thanks!

Original comment by m...@riedel-privat.de on 21 Oct 2011 at 6:19