Implement GetLineFromStream that actually works and use it instead of getline

This commit is contained in:
Andy Cedilnik
2003-03-27 12:24:30 -05:00
parent b133b832fd
commit a9875aa62f
9 changed files with 109 additions and 93 deletions
+6 -6
View File
@@ -125,16 +125,15 @@ bool cmCacheManager::LoadCache(const char* path,
{
return false;
}
const int bsize = 4096;
char buffer[bsize];
char *realbuffer;
const char *realbuffer;
std::string buffer;
std::string entryKey;
while(fin)
{
// Format is key:type=value
CacheEntry e;
fin.getline(buffer, bsize);
realbuffer = buffer;
cmSystemTools::GetLineFromStream(fin, buffer);
realbuffer = buffer.c_str();
while(*realbuffer != '0' &&
(*realbuffer == ' ' ||
*realbuffer == '\t' ||
@@ -150,7 +149,8 @@ bool cmCacheManager::LoadCache(const char* path,
while(realbuffer[0] == '/' && realbuffer[1] == '/')
{
e.m_Properties["HELPSTRING"] += &realbuffer[2];
fin.getline(realbuffer, bsize);
cmSystemTools::GetLineFromStream(fin, buffer);
realbuffer = buffer.c_str();
if(!fin)
{
continue;