From 5f56457576dbaedd8b8c228b245059bee3d8fcfc Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 9 Feb 2007 23:39:16 +0000 Subject: Check for nonexistent file git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6556 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 211ce9853..2818de639 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -719,9 +719,11 @@ bool ConfigReader::Verify() FileReader::FileReader(InspIRCd* Instance, const std::string &filename) : ServerInstance(Instance) { file_cache c; - ServerInstance->Config->ReadFile(c,filename.c_str()); - this->fc = c; - this->CalcSize(); + if (!ServerInstance->Config->ReadFile(c,filename.c_str())) + { + this->fc = c; + this->CalcSize(); + } } FileReader::FileReader(InspIRCd* Instance) : ServerInstance(Instance) @@ -755,9 +757,12 @@ void FileReader::CalcSize() void FileReader::LoadFile(const std::string &filename) { file_cache c; - ServerInstance->Config->ReadFile(c,filename.c_str()); - this->fc = c; - this->CalcSize(); + c.clear(); + if (ServerInstance->Config->ReadFile(c,filename.c_str())) + { + this->fc = c; + this->CalcSize(); + } } -- cgit v1.2.3