summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp11
-rw-r--r--src/init.cpp4
-rw-r--r--src/messages.cpp4
3 files changed, 7 insertions, 12 deletions
diff --git a/src/config.cpp b/src/config.cpp
index eac2be8c6..17d15a0d9 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -94,11 +94,6 @@ template<> time_t Block::Get(const Anope::string &tag, const Anope::string &def)
return Anope::DoTime(Get<const Anope::string>(tag, def));
}
-template<> const char* Block::Get(const Anope::string &tag, const Anope::string &def) const
-{
- return this->Get<const Anope::string>(tag, def).c_str();
-}
-
template<> bool Block::Get(const Anope::string &tag, const Anope::string &def) const
{
const Anope::string &str = Get<const Anope::string>(tag, def);
@@ -507,7 +502,7 @@ Conf::Conf() : Block("")
{
try
{
- Anope::casemap = std::locale(options->Get<const char *>("casemap"));
+ Anope::casemap = std::locale(options->Get<const Anope::string>("casemap").c_str());
}
catch (const std::runtime_error &)
{
@@ -524,7 +519,7 @@ Conf::Conf() : Block("")
if (!options->Get<const Anope::string>("user").empty())
{
errno = 0;
- struct passwd *u = getpwnam(options->Get<const char *>("user"));
+ struct passwd *u = getpwnam(options->Get<const Anope::string>("user").c_str());
if (u == NULL)
Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
else if (setuid(u->pw_uid) == -1)
@@ -535,7 +530,7 @@ Conf::Conf() : Block("")
if (!options->Get<const Anope::string>("group").empty())
{
errno = 0;
- struct group *g = getgrnam(options->Get<const char *>("group"));
+ struct group *g = getgrnam(options->Get<const Anope::string>("group").c_str());
if (g == NULL)
Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
else if (setuid(g->gr_gid) == -1)
diff --git a/src/init.cpp b/src/init.cpp
index faa57c18b..205fb2501 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -197,14 +197,14 @@ static void InitSignals()
static void remove_pidfile()
{
- remove(Config->GetBlock("serverinfo")->Get<const char *>("pid"));
+ remove(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid").c_str());
}
/* Create our PID file and write the PID to it. */
static void write_pidfile()
{
- FILE *pidfile = fopen(Config->GetBlock("serverinfo")->Get<const char *>("pid"), "w");
+ FILE *pidfile = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid").c_str(), "w");
if (pidfile)
{
#ifdef _WIN32
diff --git a/src/messages.cpp b/src/messages.cpp
index 9bbfb42c0..ed601a206 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -225,7 +225,7 @@ void MOTD::Run(MessageSource &source, const std::vector<Anope::string> &params)
if (s != Me)
return;
- FILE *f = fopen(Config->GetBlock("serverinfo")->Get<const char *>("motd"), "r");
+ FILE *f = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("motd").c_str(), "r");
if (f)
{
IRCD->SendNumeric(375, source.GetSource(), ":- %s Message of the Day", s->GetName().c_str());
@@ -454,7 +454,7 @@ void Whois::Run(MessageSource &source, const std::vector<Anope::string> &params)
IRCD->SendNumeric(311, source.GetSource(), "%s %s %s * :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->realname.c_str());
if (bi)
IRCD->SendNumeric(307, source.GetSource(), "%s :is a registered nick", bi->nick.c_str());
- IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<const char *>("description"));
+ IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<const Anope::string>("description").c_str());
if (bi)
IRCD->SendNumeric(317, source.GetSource(), "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), static_cast<long>(Anope::CurTime - bi->lastmsg), static_cast<long>(bi->signon));
IRCD->SendNumeric(318, source.GetSource(), "%s :End of /WHOIS list.", params[0].c_str());