mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 20:19:02 -04:00
Allow confpath to be a file name in the current directory
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11864 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
2602f4efbd
commit
382cac82df
@ -1673,16 +1673,12 @@ bool ServerConfig::DoInclude(const std::string &file, bool allowexeinc)
|
||||
|
||||
if ((newfile[0] != '/') && (!StartsWithWindowsDriveLetter(newfile)))
|
||||
{
|
||||
if((pos = confpath.rfind("/")) != std::string::npos)
|
||||
pos = confpath.rfind("/")
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
/* Leaves us with just the path */
|
||||
newfile = confpath.substr(0, pos) + std::string("/") + newfile;
|
||||
}
|
||||
else
|
||||
{
|
||||
errstr << "Couldn't get config path from: " << ServerInstance->ConfigFileName << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
FILE* conf = fopen(newfile.c_str(), "r");
|
||||
|
Loading…
x
Reference in New Issue
Block a user