diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-23 18:07:07 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-23 18:07:07 +0000 |
commit | 2f1b4c7ce35651262f7903e801fd9428881ee05b (patch) | |
tree | 20516a60a8b17881ff33fe6a05736c774a2df995 /src/configreader.cpp | |
parent | 2cbb6537d96c253369b3782f2250d1cf38874236 (diff) |
Patch from dz to fix bug 622 (config errors build up from /rehash to /rehash), thanks!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10690 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 493bba8c9..50e86f4df 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -747,7 +747,8 @@ void ServerConfig::Read(bool bail, const std::string &useruid) static char announceinvites[MAXBUF]; /* options:announceinvites setting */ static char disabledumodes[MAXBUF]; /* Disabled usermodes */ static char disabledcmodes[MAXBUF]; /* Disabled chanmodes */ - errstr.clear(); + /* std::ostringstream::clear() does not clear the string itself, only the error flags. */ + this->errstr = new std::ostringstream(std::stringstream::in | std::stringstream::out); include_stack.clear(); @@ -940,11 +941,14 @@ void ServerConfig::Read(bool bail, const std::string &useruid) /* Make a copy here so if it fails then we can carry on running with an unaffected config */ newconfig.clear(); - if (!this->DoInclude(newconfig, ServerInstance->ConfigFileName, errstr)) + if (!this->DoInclude(newconfig, ServerInstance->ConfigFileName, *errstr)) { - ReportConfigError(errstr.str(), bail, useruid); + ReportConfigError(errstr->str(), bail, useruid); + delete errstr; return; } + + delete errstr; /* The stuff in here may throw CoreException, be sure we're in a position to catch it. */ try |