summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/configreader.cpp16
-rw-r--r--src/modules/m_check.cpp2
2 files changed, 16 insertions, 2 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 1059770b4..e0e249963 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1271,7 +1271,21 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname)
char linebuf[MAXBUF];
F.clear();
- file = fopen(fname, "r");
+
+ if (*fname != '/')
+ {
+ std::string::size_type pos;
+ std::string confpath = CONFIG_FILE;
+ if((pos = confpath.find("/inspircd.conf")) != std::string::npos)
+ {
+ /* Leaves us with just the path */
+ std::string newfile = confpath.substr(0, pos) + std::string("/") + newfile;
+ file = fopen(newfile.c_str(), "r");
+
+ }
+ }
+ else
+ file = fopen(fname, "r");
if (file)
{
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 6a4bcc84f..3a8b8dd92 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -123,7 +123,7 @@ class cmd_check : public command_t
/*
* Unlike Asuka, I define a clone as coming from the same host. --w00t
*/
- snprintf(tmpbuf, MAXBUF, "%d %s%s (%s@%s) %s ", i->second->GlobalCloneCount(), targchan->GetAllPrefixChars(i->second), i->second->nick, i->second->ident, i->second->dhost, i->second->fullname);
+ snprintf(tmpbuf, MAXBUF, "%lu %s%s (%s@%s) %s ", i->second->GlobalCloneCount(), targchan->GetAllPrefixChars(i->second), i->second->nick, i->second->ident, i->second->dhost, i->second->fullname);
user->WriteServ(checkstr + " member " + tmpbuf);
}
}