diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-27 14:31:58 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-27 14:31:58 +0000 |
commit | 8adb22f193181b511a9b9f3d711618bdd20bbdb2 (patch) | |
tree | b25c0b34c86130a6e3df8b6cce3f58f52f053c9d /src | |
parent | f422c0c74d6f5ece818c9ceddb6ee340b643f32a (diff) |
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/trunk/inspircd@8386 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-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; } } |