diff options
-rw-r--r-- | src/configreader.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index ed1216c8b..d14fc92a8 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1391,15 +1391,10 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st confpath = ServerInstance->ConfigFileName; newfile = file; - for (std::string::iterator c = newfile.begin(); c != newfile.end(); c++) - { - if (*c == '\\') - { - *c = '/'; - } - } + std::replace(newfile.begin(),newfile.end(),'\\','/'); + std::replace(confpath.begin(),confpath.end(),'\\','/'); - if (file[0] != '/') + if (newfile[0] != '/') { if((pos = confpath.rfind("/")) != std::string::npos) { @@ -1408,7 +1403,7 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st } else { - errorstream << "Couldn't get config path from: " << confpath << std::endl; + errorstream << "Couldn't get config path from: " << ServerInstance->ConfigFileName << std::endl; return false; } } |