]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Check for windows drive letters on the start of paths and treat them the same as...
[user/henk/code/inspircd.git] / src / configreader.cpp
index 5b582b7138d1f71f2321d4489d6effe84168faec..3f99a52e21791197ad55dbc0bc947ea56f1fb7cc 100644 (file)
@@ -1649,6 +1649,11 @@ bool ServerConfig::DoPipe(ConfigDataHash &target, const std::string &file, std::
        return ret;
 }
 
+bool ServerConfig::StartsWithWindowsDriveLetter(const std::string &path)
+{
+       return (path.length() > 2 && isalpha(path[0]) && path[1] == ':');
+}
+
 bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream)
 {
        std::string confpath;
@@ -1661,7 +1666,7 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st
        std::replace(newfile.begin(),newfile.end(),'\\','/');
        std::replace(confpath.begin(),confpath.end(),'\\','/');
 
-       if ((newfile[0] != '/') && (newfile.find("://") == std::string::npos))
+       if ((newfile[0] != '/') && (!StartsWithWindowsDriveLetter(newfile)))
        {
                if((pos = confpath.rfind("/")) != std::string::npos)
                {
@@ -1883,7 +1888,7 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname)
 
        F.clear();
 
-       if ((*fname != '/') && (*fname != '\\'))
+       if ((*fname != '/') && (*fname != '\\') && (!StartsWithWindowsDriveLetter(fname)))
        {
                std::string::size_type pos;
                std::string confpath = ServerInstance->ConfigFileName;