What steps will reproduce the problem?
1. Build yaml-cpp r98 under Visual Studio.
2. Load a file with windows line endings.
3. Parse the file. For me, YAML loads a lot of bunk data at the end of the
file that causes errors in ScanScalar.
I was able to fix the problem by changing line 15 of stream.cpp from
pBuf->sgetn(buffer, size);
to:
size = pBuf->sgetn(buffer, size);
I'm not 100% sure I understand the problem, but I think it has to do with
the way the VS CRT handles windows line endings. I think pubseekoff()
returns the actual character number but sgetn() automatically converts
CRLFs to CRs under the hood, causing sgetn() to read fewer characters than
are in the file.
Original issue reported on code.google.com by devilj...@gmail.com on 6 Feb 2009 at 10:26
Original issue reported on code.google.com by
devilj...@gmail.com
on 6 Feb 2009 at 10:26