mirror of
https://github.com/znc/znc.git
synced 2026-07-05 17:31:06 +02:00
Fix a bug introduced in r1289
If the config dir (<datadir>/configs) didn't exist yet, ZNC didn't bother creating it and thus failed to do write a config. Thanks to m4v for testing a nightly and for reporting this bug. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1292 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -440,6 +440,15 @@ void CZNC::InitDirs(const CString& sArgvPath, const CString& sDataDir) {
|
||||
}
|
||||
}
|
||||
|
||||
CString CZNC::GetConfPath() const {
|
||||
CString sConfPath = m_sZNCPath + "/configs/";
|
||||
if (!CFile::Exists(sConfPath)) {
|
||||
CDir::MakeDir(sConfPath);
|
||||
}
|
||||
|
||||
return sConfPath;
|
||||
}
|
||||
|
||||
CString CZNC::GetUserPath() const {
|
||||
CString sUserPath = m_sZNCPath + "/users/";
|
||||
if (!CFile::Exists(sUserPath)) {
|
||||
@@ -464,12 +473,12 @@ CString CZNC::ExpandConfigPath(const CString& sConfigFile) {
|
||||
CString sRetPath;
|
||||
|
||||
if (sConfigFile.empty()) {
|
||||
sRetPath = GetZNCPath() + "/configs/znc.conf";
|
||||
sRetPath = GetConfPath() + "/znc.conf";
|
||||
} else {
|
||||
if (sConfigFile.Left(2) == "./" || sConfigFile.Left(3) == "../") {
|
||||
sRetPath = GetCurPath() + "/" + sConfigFile;
|
||||
} else if (sConfigFile.Left(1) != "/") {
|
||||
sRetPath = GetZNCPath() + "/configs/" + sConfigFile;
|
||||
sRetPath = GetConfPath() + "/" + sConfigFile;
|
||||
} else {
|
||||
sRetPath = sConfigFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user