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
This commit is contained in:
brain 2006-11-02 18:07:23 +00:00
parent 3475ebe194
commit 35211d4c3e

View File

@ -540,6 +540,7 @@ bool InspIRCd::LoadModule(const char* filename)
if (strchr(filename,'*') || (strchr(filename,'?'))) if (strchr(filename,'*') || (strchr(filename,'?')))
{ {
bool all_success = true; bool all_success = true;
int n_match = 0;
DIR* library = opendir(Config->ModPath); DIR* library = opendir(Config->ModPath);
if (library) if (library)
{ {
@ -548,13 +549,14 @@ bool InspIRCd::LoadModule(const char* filename)
{ {
if (this->MatchText(entry->d_name, filename)) if (this->MatchText(entry->d_name, filename))
{ {
n_match++;
if (!this->LoadModule(entry->d_name)) if (!this->LoadModule(entry->d_name))
all_success = false; all_success = false;
} }
} }
closedir(library); closedir(library);
} }
return all_success; return (all_success && n_match);
} }
char modfile[MAXBUF]; char modfile[MAXBUF];