Error if a channel is defined more than once

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@944 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-02-07 22:23:51 +00:00
parent c20f8427bb
commit 64d6d0d5af
+8 -1
View File
@@ -845,7 +845,14 @@ bool CZNC::ParseConfig(const CString& sConfig) {
if (pUser) {
if (pChan) {
if (sTag.CaseCmp("Chan") == 0) {
pUser->AddChan(pChan);
// Save the channel name, because AddChan
// deletes the CChannel*, if adding fails
sTag = pChan->GetName(); /* FIXME */
if (!pUser->AddChan(pChan)) {
CUtils::PrintError("Channel [" + sTag + "] defined more than once");
return false;
}
sTag.clear();
pChan = NULL;
continue;
}