]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Add filename/line information to all ConfigTag objects
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 155e29dd465b7ec6e664f580c6a32b8f3ad0b92f..cd173b55ffb1148fe22ab32013a957552815ab09 100644 (file)
@@ -17,7 +17,7 @@
 #include "xline.h"
 #include "exitcodes.h"
 
-std::string InspIRCd::GetServerDescription(const char* servername)
+std::string InspIRCd::GetServerDescription(const std::string& servername)
 {
        std::string description;
 
@@ -281,20 +281,6 @@ bool InspIRCd::OpenLog(char**, int)
        {
                this->Logs->SetupNoFork();
        }
-       Config->MyDir = Config->GetFullProgDir();
-
-       /* Attempt to find home directory, portable to windows */
-       const char* home = getenv("HOME");
-       if (!home)
-       {
-               /* No $HOME, log to %USERPROFILE% */
-               home = getenv("USERPROFILE");
-               if (!home)
-               {
-                       /* Nothing could be found at all, log to current dir */
-                       Config->logpath = "./startup.log";
-               }
-       }
 
        if (!Config->writelog) return true; // Skip opening default log if -nolog
 
@@ -302,7 +288,7 @@ bool InspIRCd::OpenLog(char**, int)
        {
                if (Config->logpath.empty())
                {
-                       Config->logpath = "./startup.log";
+                       Config->logpath = "logs/startup.log";
                }
 
                if (!Config->log_file)
@@ -401,22 +387,21 @@ long InspIRCd::Duration(const std::string &str)
        return total + subtotal;
 }
 
-bool InspIRCd::ULine(const char* sserver)
+bool InspIRCd::ULine(const std::string& sserver)
 {
-       if (!sserver)
-               return false;
-       if (!*sserver)
+       if (sserver.empty())
                return true;
 
-       return (Config->ulines.find(sserver) != Config->ulines.end());
+       return (Config->ulines.find(sserver.c_str()) != Config->ulines.end());
 }
 
-bool InspIRCd::SilentULine(const char* sserver)
+bool InspIRCd::SilentULine(const std::string& sserver)
 {
-       std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver);
+       std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver.c_str());
        if (n != Config->ulines.end())
                return n->second;
-       else return false;
+       else
+               return false;
 }
 
 std::string InspIRCd::TimeString(time_t curtime)