diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-08 15:52:29 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-08 15:52:29 (GMT) |
commit | 892a439fad949bb535523856a4c2bc18162e414e (patch) | |
tree | 0976b251a0415002790280e0b7a6e65b9617efda /Source/cmListFileCache.cxx | |
parent | d91bd3dbd37e645f756191799a9521284e81c1b2 (diff) | |
download | CMake-892a439fad949bb535523856a4c2bc18162e414e.zip CMake-892a439fad949bb535523856a4c2bc18162e414e.tar.gz CMake-892a439fad949bb535523856a4c2bc18162e414e.tar.bz2 |
BUG: Remove some old legacy code and remove memory leak
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 2013fb4..1692fdc 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -25,14 +25,12 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer, cmListFileFunction& function, const char* filename); -bool cmListFile::ParseFile(const char* path, bool requireProjectCommand) +bool cmListFile::ParseFile(const char* filename, bool requireProjectCommand) { - if(!cmSystemTools::FileExists(path)) + if(!cmSystemTools::FileExists(filename)) { return false; } - // Get a pointer to a persistent copy of the name. - const char* filename = this->GetUniqueStringPointer(path); // Create the scanner. cmListFileLexer* lexer = cmListFileLexer_New(); @@ -212,17 +210,3 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer, return false; } - -//---------------------------------------------------------------------------- -const char* cmListFile::GetUniqueStringPointer(const char* name) -{ - UniqueStrings::iterator i = m_UniqueStrings.find(name); - if(i == m_UniqueStrings.end()) - { - char* str = new char[strlen(name)+1]; - strcpy(str, name); - i = m_UniqueStrings.insert(UniqueStrings::value_type(name, str)).first; - } - return i->second; -} - |