- std::string fname = (filename.empty() ? "inspircd.pid" : filename);
- std::replace(fname.begin(), fname.end(), '\\', '/');
- if ((fname[0] != '/') && (!Config->StartsWithWindowsDriveLetter(filename)))
- {
- std::string::size_type pos;
- std::string confpath = this->ConfigFileName;
- if ((pos = confpath.rfind("/")) != std::string::npos)
- {
- /* Leaves us with just the path */
- fname = confpath.substr(0, pos) + std::string("/") + fname;
- }
- }