From 35211d4c3e3db8419c831e450ad463a8542ac117 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 2 Nov 2006 18:07:23 +0000 Subject: [PATCH 1/1] LoadModule will now also return false if the glob pattern matches no modules and loads nothing git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5627 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 055e42a73..916812357 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -540,6 +540,7 @@ bool InspIRCd::LoadModule(const char* filename) if (strchr(filename,'*') || (strchr(filename,'?'))) { bool all_success = true; + int n_match = 0; DIR* library = opendir(Config->ModPath); if (library) { @@ -548,13 +549,14 @@ bool InspIRCd::LoadModule(const char* filename) { if (this->MatchText(entry->d_name, filename)) { + n_match++; if (!this->LoadModule(entry->d_name)) all_success = false; } } closedir(library); } - return all_success; + return (all_success && n_match); } char modfile[MAXBUF]; -- 2.39.2