Also use /etc/passwd if $HOME is set but empty

Before this, we used ./.znc as datadir in this case. Not good.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1081 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-06-03 06:32:18 +00:00
parent 5e5842333f
commit e08cb72646
+4 -1
View File
@@ -397,9 +397,12 @@ void CZNC::InitDirs(const CString& sArgvPath, const CString& sDataDir) {
// Try to set the user's home dir, default to binpath on failure
home = getenv("HOME");
m_sHomePath.clear();
if (home) {
m_sHomePath = home;
} else {
}
if (m_sHomePath.empty()) {
struct passwd* pUserInfo = getpwuid(getuid());
if (pUserInfo) {