summaryrefslogtreecommitdiffstats
path: root/Source/cmSiteNameCommand.cxx
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2001-10-18 22:01:19 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2001-10-18 22:01:19 (GMT)
commit5cc95e438733921b79a727ab9e0f31e64c2cee48 (patch)
tree7627df97cb32fdd6f8844ea005aa43eb9ddd9168 /Source/cmSiteNameCommand.cxx
parent8fefb3dd22599bf4e5f99551783bb2a21dcf8a59 (diff)
downloadCMake-5cc95e438733921b79a727ab9e0f31e64c2cee48.zip
CMake-5cc95e438733921b79a727ab9e0f31e64c2cee48.tar.gz
CMake-5cc95e438733921b79a727ab9e0f31e64c2cee48.tar.bz2
SITE_NAME should return the most qualified name of the host. If nslookup works, now the domain is appended to the hostname (whereas it *replaced* the host name before)
Diffstat (limited to 'Source/cmSiteNameCommand.cxx')
-rw-r--r--Source/cmSiteNameCommand.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 42a4c33..657cb86 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -79,7 +79,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
host = hostReg.match(1);
}
}
-
+
std::string siteName = host;
if(host.length())
{
@@ -90,13 +90,14 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
std::string nsOutput;
cmSystemTools::RunCommand(nsCmd.c_str(),
nsOutput);
+
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 = cmSystemTools::LowerCase(reg.match(1));
+ siteName += '.' + cmSystemTools::LowerCase(reg.match(1));
}
}