summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2001-10-11 18:57:59 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2001-10-11 18:57:59 (GMT)
commit8a72356cff6ce39d7fa3c1afd0ab107137702706 (patch)
tree3169189bf98a22a5764ab6cb263e6c5e9cc6fc63 /Source/cmCacheManager.cxx
parent70bc593afeb3ab6750cdd75d9e0799284c85f16f (diff)
downloadCMake-8a72356cff6ce39d7fa3c1afd0ab107137702706.zip
CMake-8a72356cff6ce39d7fa3c1afd0ab107137702706.tar.gz
CMake-8a72356cff6ce39d7fa3c1afd0ab107137702706.tar.bz2
Added removing of spaces in CMakeCache.txt in front of comments and variables
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 5872905..9014216 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -133,6 +133,7 @@ bool cmCacheManager::LoadCache(const char* path,
}
const int bsize = 4096;
char buffer[bsize];
+ char *realbuffer;
// input line is: key:type=value
cmRegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
// input line is: "key":type=value
@@ -145,21 +146,29 @@ bool cmCacheManager::LoadCache(const char* path,
// Format is key:type=value
CacheEntry e;
fin.getline(buffer, bsize);
+ realbuffer = buffer;
+ while(*realbuffer != '0' &&
+ (*realbuffer == ' ' ||
+ *realbuffer == '\t' ||
+ *realbuffer == '\n'))
+ {
+ realbuffer++;
+ }
// skip blank lines and comment lines
- if(buffer[0] == '#' || buffer[0] == 0)
+ if(realbuffer[0] == '#' || realbuffer[0] == 0)
{
continue;
}
- while(buffer[0] == '/')
+ while(realbuffer[0] == '/')
{
- e.m_HelpString += &buffer[2];
- fin.getline(buffer, bsize);
+ e.m_HelpString += &realbuffer[2];
+ fin.getline(realbuffer, bsize);
if(!fin)
{
continue;
}
}
- if(regQuoted.find(buffer))
+ if(regQuoted.find(realbuffer))
{
entryKey = regQuoted.match(1);
if ( excludes.find(entryKey) == excludes.end() )
@@ -189,7 +198,7 @@ bool cmCacheManager::LoadCache(const char* path,
}
}
}
- else if (reg.find(buffer))
+ else if (reg.find(realbuffer))
{
entryKey = reg.match(1);
if ( excludes.find(entryKey) == excludes.end() )
@@ -224,7 +233,7 @@ bool cmCacheManager::LoadCache(const char* path,
else
{
cmSystemTools::Error("Parse error in cache file ", cacheFile.c_str(),
- ". Offending entry: ", buffer);
+ ". Offending entry: ", realbuffer);
}
}
// if CMAKE version not found in the list file