mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Made home dir optional in CDir::ChangeDir() and have it default to CZNC::Get().GetHomePath()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1536 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "FileUtils.h"
|
||||
#include "znc.h"
|
||||
#include "Utils.h"
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
@@ -420,12 +421,18 @@ CString CFile::GetDir() const {
|
||||
return sDir;
|
||||
}
|
||||
|
||||
CString CDir::ChangeDir(const CString& sPath, const CString& sAdd, const CString& sHomeDir) {
|
||||
CString CDir::ChangeDir(const CString& sPath, const CString& sAdd, const CString& sHome) {
|
||||
CString sHomeDir(sHome);
|
||||
|
||||
if (sHomeDir.empty()) {
|
||||
sHomeDir = CZNC::Get().GetHomePath();
|
||||
}
|
||||
|
||||
if (sAdd == "~") {
|
||||
return sHomeDir;
|
||||
}
|
||||
|
||||
CString sAddDir = sAdd;
|
||||
CString sAddDir(sAdd);
|
||||
|
||||
if (sAddDir.Left(2) == "~/") {
|
||||
sAddDir.LeftChomp();
|
||||
|
||||
Reference in New Issue
Block a user