mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02:00
Do not create empty directories if one does ./znc --datadir=NON_EXISTING_DIR
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1878 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -467,9 +467,9 @@ void CZNC::InitDirs(const CString& sArgvPath, const CString& sDataDir) {
|
||||
}
|
||||
}
|
||||
|
||||
CString CZNC::GetConfPath() const {
|
||||
CString CZNC::GetConfPath(bool bAllowMkDir) const {
|
||||
CString sConfPath = m_sZNCPath + "/configs";
|
||||
if (!CFile::Exists(sConfPath)) {
|
||||
if (bAllowMkDir && !CFile::Exists(sConfPath)) {
|
||||
CDir::MakeDir(sConfPath);
|
||||
}
|
||||
|
||||
@@ -496,16 +496,16 @@ CString CZNC::GetModPath() const {
|
||||
}
|
||||
|
||||
|
||||
CString CZNC::ExpandConfigPath(const CString& sConfigFile) {
|
||||
CString CZNC::ExpandConfigPath(const CString& sConfigFile, bool bAllowMkDir) {
|
||||
CString sRetPath;
|
||||
|
||||
if (sConfigFile.empty()) {
|
||||
sRetPath = GetConfPath() + "/znc.conf";
|
||||
sRetPath = GetConfPath(bAllowMkDir) + "/znc.conf";
|
||||
} else {
|
||||
if (sConfigFile.Left(2) == "./" || sConfigFile.Left(3) == "../") {
|
||||
sRetPath = GetCurPath() + "/" + sConfigFile;
|
||||
} else if (sConfigFile.Left(1) != "/") {
|
||||
sRetPath = GetConfPath() + "/" + sConfigFile;
|
||||
sRetPath = GetConfPath(bAllowMkDir) + "/" + sConfigFile;
|
||||
} else {
|
||||
sRetPath = sConfigFile;
|
||||
}
|
||||
@@ -985,7 +985,7 @@ bool CZNC::ParseConfig(const CString& sConfig)
|
||||
{
|
||||
CString s;
|
||||
|
||||
m_sConfigFile = ExpandConfigPath(sConfig);
|
||||
m_sConfigFile = ExpandConfigPath(sConfig, false);
|
||||
|
||||
return DoRehash(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user