1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 02:23:12 +02:00

Fixed many windows problems in the debug build

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2960 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2010-05-14 20:52:17 +00:00
parent 116a4b2bea
commit 5993a65b87
4 changed files with 23 additions and 13 deletions
+20 -8
View File
@@ -52,6 +52,11 @@ static void ReadDatabase(Module *m = NULL)
return;
}
NickCore *nc = NULL;
NickAlias *na = NULL;
BotInfo *bi = NULL;
ChannelInfo *ci = NULL;
while (std::getline(db, buf))
{
if (buf.empty())
@@ -84,10 +89,6 @@ static void ReadDatabase(Module *m = NULL)
continue;
std::string mdbuf;
NickCore *nc;
NickAlias *na;
BotInfo *bi;
ChannelInfo *ci;
if (!params.empty())
{
if (params[0] == "NC")
@@ -116,7 +117,7 @@ static void ReadDatabase(Module *m = NULL)
params.erase(params.begin());
params.erase(params.begin());
if (nc && Type == MD_NC)
if (Type == MD_NC && nc)
{
try
{
@@ -132,7 +133,7 @@ static void ReadDatabase(Module *m = NULL)
Alog() << "[db_plain]: " << ex.GetReason();
}
}
else if (na && Type == MD_NA)
else if (Type == MD_NA && na)
{
try
{
@@ -148,7 +149,7 @@ static void ReadDatabase(Module *m = NULL)
Alog() << "[db_plain]: " << ex.GetReason();
}
}
else if (bi && Type == MD_BI)
else if (Type == MD_BI && bi)
{
try
{
@@ -164,7 +165,7 @@ static void ReadDatabase(Module *m = NULL)
Alog() << "[db_plain]: " << ex.GetReason();
}
}
else if (ci && Type == MD_CH)
else if (Type == MD_CH && ci)
{
try
{
@@ -571,6 +572,15 @@ class DBPlain : public Module
char *newname = new char[DatabaseFile.length() + 30];
snprintf(newname, DatabaseFile.length() + 30, "backups/%s.%d%d%d", DatabaseFile.c_str(), tm->tm_year, tm->tm_mon, tm->tm_mday);
/* Backup already exists */
if (!stat(newname, &DBInfo))
{
delete [] newname;
return;
}
Alog() << "it.. doesnt exist?";
Alog(LOG_DEBUG) << "db_plain: Attemping to rename " << DatabaseFile << " to " << newname;
if (rename(DatabaseFile.c_str(), newname) != 0)
{
ircdproto->SendGlobops(findbot(Config.s_OperServ), "Unable to backup database!");
@@ -579,6 +589,8 @@ class DBPlain : public Module
if (!Config.NoBackupOkay)
quitting = 1;
delete [] newname;
return;
}
+3 -3
View File
@@ -176,8 +176,8 @@ static int internal_addCommand(Module *m, CommandHash * cmdTable[], Command * c)
if (!cmdTable || !c) {
return MOD_ERR_PARAMS;
}
index = CMD_HASH(c->name);
index = CMD_HASH(c->name.c_str());
for (current = cmdTable[index]; current; current = current->next) {
if ((c->service) && (current->c) && (current->c->service)
@@ -283,7 +283,7 @@ static int internal_delCommand(CommandHash * cmdTable[], Command * c, const char
return MOD_ERR_PARAMS;
}
index = CMD_HASH(c->name);
index = CMD_HASH(c->name.c_str());
for (current = cmdTable[index]; current; current = current->next) {
if (stricmp(c->name.c_str(), current->name) == 0) {
if (!lastHash) {
-1
View File
@@ -14,7 +14,6 @@ NickCore::NickCore(const std::string &coredisplay)
next = prev = NULL;
display = email = greet = url = NULL;
ot = NULL;
pass[0] = '\0';
icq = 0;
language = channelcount = 0;
lastmail = 0;
-1
View File
@@ -25,7 +25,6 @@ ChannelInfo::ChannelInfo(const std::string &chname)
throw CoreException("Empty channel passed to ChannelInfo constructor");
next = prev = NULL;
name[0] = last_topic_setter[0] = '\0';
founder = successor = NULL;
desc = url = email = last_topic = forbidby = forbidreason = NULL;
last_topic_time = 0;