ENH: Correct sitename

This commit is contained in:
Dan Blezek 2001-05-04 16:43:54 -04:00
parent 089aa3e106
commit f386664efc
1 changed files with 5 additions and 1 deletions

View File

@ -78,12 +78,16 @@ bool cmSiteNameCommand::Invoke(std::vector<std::string>& args)
std::string nsOutput;
cmSystemTools::RunCommand(nsCmd.c_str(),
nsOutput);
cmRegularExpression reg(".*Name:(.*)\n");
std::string RegExp = ".*Name:[ \t\n]*";
RegExp += host;
RegExp += "\\.([^ \t\n\r]*)[ \t\n\r]*Address:";
cmRegularExpression reg( RegExp.c_str() );
if(reg.find(nsOutput.c_str()))
{
siteName = reg.match(1);
}
}
cmCacheManager::GetInstance()->
AddCacheEntry("SITE",
siteName.c_str(),