find_package: Cleanup user package registry less aggressively

Delete only REG_SZ entries that are specifically detected to point to
invalid paths.  This will allow future versions to add other value types
for different purposes.
This commit is contained in:
Brad King 2011-04-13 11:00:06 -04:00
parent 4df119773c
commit c9563dbe1a
1 changed files with 3 additions and 4 deletions

View File

@ -1308,13 +1308,12 @@ void cmFindPackageCommand::LoadPackageRegistryWin()
{ {
data[dataSize] = 0; data[dataSize] = 0;
cmsys_ios::stringstream ss(&data[0]); cmsys_ios::stringstream ss(&data[0]);
if(this->CheckPackageRegistryEntry(ss)) if(!this->CheckPackageRegistryEntry(ss))
{ {
// The entry is okay. // The entry is invalid.
continue; bad.insert(name);
} }
} }
bad.insert(name);
break; break;
case ERROR_MORE_DATA: case ERROR_MORE_DATA:
data.resize(dataSize+1); data.resize(dataSize+1);