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)
{
/*
* 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);
}
}