GenerateExportHeader: Work around buggy std::getline behavior in BCB5.
This commit is contained in:
parent
4aff1650d6
commit
d5eb7d8565
|
@ -39,6 +39,18 @@ void compare(const char* refName, const char* testName)
|
||||||
std::string testLine;
|
std::string testLine;
|
||||||
std::getline(ref, refLine);
|
std::getline(ref, refLine);
|
||||||
std::getline(test, testLine);
|
std::getline(test, testLine);
|
||||||
|
// Some very old Borland runtimes (C++ Builder 5 WITHOUT Update 1) add a
|
||||||
|
// trailing null to the string that we need to strip before testing for a
|
||||||
|
// trailing space.
|
||||||
|
if (refLine.size() && refLine[refLine.size()-1] == 0)
|
||||||
|
{
|
||||||
|
refLine = refLine.substr(0, refLine.size() - 1);
|
||||||
|
}
|
||||||
|
if (testLine.size() && testLine[testLine.size()-1] == 0)
|
||||||
|
{
|
||||||
|
testLine = testLine.substr(0, testLine.size() - 1);
|
||||||
|
}
|
||||||
|
// The reference files never have trailing spaces:
|
||||||
if (testLine.size() && testLine[testLine.size()-1] == ' ')
|
if (testLine.size() && testLine[testLine.size()-1] == ' ')
|
||||||
{
|
{
|
||||||
testLine = testLine.substr(0, testLine.size() - 1);
|
testLine = testLine.substr(0, testLine.size() - 1);
|
||||||
|
|
Loading…
Reference in New Issue