summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-03-27 17:24:30 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-03-27 17:24:30 (GMT)
commita9875aa62f41ed13b54ea9f92c65ade9f0df6845 (patch)
treeeac19ea62e63cd53b73a29144ed997e6e683ee63 /Source/cmCacheManager.cxx
parentb133b832fdcb50bc7bb9dc4bfb0631bb9aa6989e (diff)
downloadCMake-a9875aa62f41ed13b54ea9f92c65ade9f0df6845.zip
CMake-a9875aa62f41ed13b54ea9f92c65ade9f0df6845.tar.gz
CMake-a9875aa62f41ed13b54ea9f92c65ade9f0df6845.tar.bz2
Implement GetLineFromStream that actually works and use it instead of getline
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 581f118..7b213a0 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -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;