mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-29 04:10:05 -04:00
Fix for bug in windows with backslash directory seperators in config path when used with <include> tag and a relative include path, reported by daurnimator
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8387 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
66445ed7a2
commit
fa6b96d825
@ -1285,15 +1285,10 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st
|
|||||||
confpath = ServerInstance->ConfigFileName;
|
confpath = ServerInstance->ConfigFileName;
|
||||||
newfile = file;
|
newfile = file;
|
||||||
|
|
||||||
for (std::string::iterator c = newfile.begin(); c != newfile.end(); c++)
|
std::replace(newfile.begin(),newfile.end(),'\\','/');
|
||||||
{
|
std::replace(confpath.begin(),confpath.end(),'\\','/');
|
||||||
if (*c == '\\')
|
|
||||||
{
|
|
||||||
*c = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file[0] != '/')
|
if (newfile[0] != '/')
|
||||||
{
|
{
|
||||||
if((pos = confpath.rfind("/")) != std::string::npos)
|
if((pos = confpath.rfind("/")) != std::string::npos)
|
||||||
{
|
{
|
||||||
@ -1302,7 +1297,7 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errorstream << "Couldn't get config path from: " << confpath << std::endl;
|
errorstream << "Couldn't get config path from: " << ServerInstance->ConfigFileName << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user