mirror of
https://github.com/znc/znc.git
synced 2026-07-03 16:31:49 +02:00
Don't write unexpected newlines to znc.conf
This patch fixes the same bug as the last commit and also makes sure that similar bugs can't happen again. Thanks to cnu for finding and reporting this bug. Thanks to kroimon for patch review. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1396 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -50,16 +50,18 @@ bool CChan::WriteConfig(CFile& File) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File.Write("\t<Chan " + GetName() + ">\n");
|
||||
File.Write("\t<Chan " + GetName().FirstLine() + ">\n");
|
||||
|
||||
if (m_pUser->GetBufferCount() != GetBufferCount())
|
||||
File.Write("\t\tBuffer = " + CString(GetBufferCount()) + "\n");
|
||||
m_pUser->PrintLine(File, "\tBuffer", CString(GetBufferCount()));
|
||||
if (m_pUser->KeepBuffer() != KeepBuffer())
|
||||
File.Write("\t\tKeepBuffer = " + CString(KeepBuffer()) + "\n");
|
||||
m_pUser->PrintLine(File, "\tKeepBuffer", CString(KeepBuffer()));
|
||||
if (IsDetached())
|
||||
File.Write("\t\tDetached = true\n");
|
||||
if (!GetKey().empty()) { File.Write("\t\tKey = " + GetKey() + "\n"); }
|
||||
if (!GetDefaultModes().empty()) { File.Write("\t\tModes = " + GetDefaultModes() + "\n"); }
|
||||
m_pUser->PrintLine(File, "\tDetached", "true");
|
||||
if (!GetKey().empty())
|
||||
m_pUser->PrintLine(File, "\tKey", GetKey());
|
||||
if (!GetDefaultModes().empty())
|
||||
m_pUser->PrintLine(File, "\tModes", GetDefaultModes());
|
||||
|
||||
File.Write("\t</Chan>\n");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user