make the log filename lower case always

this fixes an annoying bug where two separate log files will be written
if an irc client sends to channel #Foobar and another irc client sends
to channel #foobar.
This commit is contained in:
Rasmus Eskola
2014-07-02 11:16:03 +03:00
parent 154bf9fdd6
commit 9670d0bdc0
+4 -3
View File
@@ -82,10 +82,11 @@ void CLogMod::PutLog(const CString& sLine, const CString& sWindow /*= "Status"*/
return;
}
// TODO: Properly handle IRC case mapping
// $WINDOW has to be handled last, since it can contain %
sPath.Replace("$NETWORK", (m_pNetwork ? m_pNetwork->GetName() : "znc"));
sPath.Replace("$WINDOW", sWindow.Replace_n("/", "-").Replace_n("\\", "-"));
sPath.Replace("$USER", (m_pUser ? m_pUser->GetUserName() : "UNKNOWN"));
sPath.Replace("$NETWORK", CString((m_pNetwork ? m_pNetwork->GetName() : "znc")).AsLower());
sPath.Replace("$WINDOW", CString(sWindow.Replace_n("/", "-").Replace_n("\\", "-")).AsLower());
sPath.Replace("$USER", CString((m_pUser ? m_pUser->GetUserName() : "UNKNOWN")).AsLower());
// Check if it's allowed to write in this specific path
sPath = CDir::CheckPathPrefix(GetSavePath(), sPath);