mirror of
https://github.com/znc/znc.git
synced 2026-08-07 09:22:55 +02:00
Use unix EOLs (\n) instead of DOS ones (\r\n) for writing znc.conf
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1022 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -55,20 +55,20 @@ bool CChan::WriteConfig(CFile& File) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File.Write("\t<Chan " + GetName() + ">\r\n");
|
||||
File.Write("\t<Chan " + GetName() + ">\n");
|
||||
|
||||
if (m_pUser->GetBufferCount() != GetBufferCount())
|
||||
File.Write("\t\tBuffer = " + CString(GetBufferCount()) + "\r\n");
|
||||
File.Write("\t\tBuffer = " + CString(GetBufferCount()) + "\n");
|
||||
if (m_pUser->KeepBuffer() != KeepBuffer())
|
||||
File.Write("\t\tKeepBuffer = " + CString((KeepBuffer()) ? "true" : "false") + "\r\n");
|
||||
File.Write("\t\tKeepBuffer = " + CString((KeepBuffer()) ? "true" : "false") + "\n");
|
||||
if (IsDetached())
|
||||
File.Write("\t\tDetached = true\r\n");
|
||||
File.Write("\t\tDetached = true\n");
|
||||
if (m_pUser->AutoCycle() != AutoCycle())
|
||||
File.Write("\t\tAutoCycle = " + CString((AutoCycle()) ? "true" : "false") + "\r\n");
|
||||
if (!GetKey().empty()) { File.Write("\t\tKey = " + GetKey() + "\r\n"); }
|
||||
if (!GetDefaultModes().empty()) { File.Write("\t\tModes = " + GetDefaultModes() + "\r\n"); }
|
||||
File.Write("\t\tAutoCycle = " + CString((AutoCycle()) ? "true" : "false") + "\n");
|
||||
if (!GetKey().empty()) { File.Write("\t\tKey = " + GetKey() + "\n"); }
|
||||
if (!GetDefaultModes().empty()) { File.Write("\t\tModes = " + GetDefaultModes() + "\n"); }
|
||||
|
||||
File.Write("\t</Chan>\r\n");
|
||||
File.Write("\t</Chan>\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -532,11 +532,11 @@ bool CUser::PrintLine(CFile& File, const CString& sName, const CString& sValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
return File.Write("\t" + sName + " = " + sValue + "\r\n");
|
||||
return File.Write("\t" + sName + " = " + sValue + "\n");
|
||||
}
|
||||
|
||||
bool CUser::WriteConfig(CFile& File) {
|
||||
File.Write("<User " + GetUserName() + ">\r\n");
|
||||
File.Write("<User " + GetUserName() + ">\n");
|
||||
|
||||
PrintLine(File, "Pass", GetPass() + ((IsPassHashed()) ? " -" : ""));
|
||||
PrintLine(File, "Nick", GetNick());
|
||||
@@ -563,7 +563,7 @@ bool CUser::WriteConfig(CFile& File) {
|
||||
PrintLine(File, "PrependTimestamp", CString((GetTimestampPrepend()) ? "true" : "false"));
|
||||
PrintLine(File, "TimezoneOffset", CString(m_fTimezoneOffset));
|
||||
PrintLine(File, "JoinTries", CString(m_uMaxJoinTries));
|
||||
File.Write("\r\n");
|
||||
File.Write("\n");
|
||||
|
||||
// Allow Hosts
|
||||
if (!m_ssAllowedHosts.empty()) {
|
||||
@@ -571,7 +571,7 @@ bool CUser::WriteConfig(CFile& File) {
|
||||
PrintLine(File, "Allow", *it);
|
||||
}
|
||||
|
||||
File.Write("\r\n");
|
||||
File.Write("\n");
|
||||
}
|
||||
|
||||
// CTCP Replies
|
||||
@@ -580,7 +580,7 @@ bool CUser::WriteConfig(CFile& File) {
|
||||
PrintLine(File, "CTCPReply", itb->first.AsUpper() + " " + itb->second);
|
||||
}
|
||||
|
||||
File.Write("\r\n");
|
||||
File.Write("\n");
|
||||
}
|
||||
|
||||
#ifdef _MODULES
|
||||
@@ -598,7 +598,7 @@ bool CUser::WriteConfig(CFile& File) {
|
||||
PrintLine(File, "LoadModule", Mods[a]->GetModName() + sArgs);
|
||||
}
|
||||
|
||||
File.Write("\r\n");
|
||||
File.Write("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -611,14 +611,14 @@ bool CUser::WriteConfig(CFile& File) {
|
||||
for (unsigned int c = 0; c < m_vChans.size(); c++) {
|
||||
CChan* pChan = m_vChans[c];
|
||||
if (pChan->InConfig()) {
|
||||
File.Write("\r\n");
|
||||
File.Write("\n");
|
||||
if (!pChan->WriteConfig(File)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.Write("</User>\r\n");
|
||||
File.Write("</User>\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -483,25 +483,25 @@ bool CZNC::WriteConfig() {
|
||||
|
||||
CString s6 = (pListener->IsIPV6()) ? "6" : " ";
|
||||
|
||||
File.Write("Listen" + s6 + " = " + sHostPortion + CString((pListener->IsSSL()) ? "+" : "") + CString(pListener->GetPort()) + "\r\n");
|
||||
File.Write("Listen" + s6 + " = " + sHostPortion + CString((pListener->IsSSL()) ? "+" : "") + CString(pListener->GetPort()) + "\n");
|
||||
}
|
||||
|
||||
File.Write("ConnectDelay = " + CString(m_uiConnectDelay) + "\r\n");
|
||||
File.Write("ConnectDelay = " + CString(m_uiConnectDelay) + "\n");
|
||||
|
||||
if (!m_sISpoofFile.empty()) {
|
||||
File.Write("ISpoofFile = " + m_sISpoofFile + "\r\n");
|
||||
if (!m_sISpoofFormat.empty()) { File.Write("ISpoofFormat = " + m_sISpoofFormat + "\r\n"); }
|
||||
File.Write("ISpoofFile = " + m_sISpoofFile + "\n");
|
||||
if (!m_sISpoofFormat.empty()) { File.Write("ISpoofFormat = " + m_sISpoofFormat + "\n"); }
|
||||
}
|
||||
|
||||
if (!m_sPidFile.empty()) { File.Write("PidFile = " + m_sPidFile + "\r\n"); }
|
||||
if (!m_sStatusPrefix.empty()) { File.Write("StatusPrefix = " + m_sStatusPrefix + "\r\n"); }
|
||||
if (!m_sPidFile.empty()) { File.Write("PidFile = " + m_sPidFile + "\n"); }
|
||||
if (!m_sStatusPrefix.empty()) { File.Write("StatusPrefix = " + m_sStatusPrefix + "\n"); }
|
||||
|
||||
for (unsigned int m = 0; m < m_vsMotd.size(); m++) {
|
||||
File.Write("Motd = " + m_vsMotd[m] + "\r\n");
|
||||
File.Write("Motd = " + m_vsMotd[m] + "\n");
|
||||
}
|
||||
|
||||
for (unsigned int v = 0; v < m_vsVHosts.size(); v++) {
|
||||
File.Write("VHost = " + m_vsVHosts[v] + "\r\n");
|
||||
File.Write("VHost = " + m_vsVHosts[v] + "\n");
|
||||
}
|
||||
|
||||
#ifdef _MODULES
|
||||
@@ -514,7 +514,7 @@ bool CZNC::WriteConfig() {
|
||||
sArgs = " " + sArgs;
|
||||
}
|
||||
|
||||
File.Write("LoadModule = " + Mods[a]->GetModName() + sArgs + "\r\n");
|
||||
File.Write("LoadModule = " + Mods[a]->GetModName() + sArgs + "\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -526,7 +526,7 @@ bool CZNC::WriteConfig() {
|
||||
continue;
|
||||
}
|
||||
|
||||
File.Write("\r\n");
|
||||
File.Write("\n");
|
||||
|
||||
if (!it->second->WriteConfig(File)) {
|
||||
DEBUG_ONLY(cerr << "** Error writing config for user [" << it->first << "]" << endl);
|
||||
|
||||
Reference in New Issue
Block a user