diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datafiles.c | 34 | ||||
-rw-r--r-- | src/rdb.c | 2 |
2 files changed, 26 insertions, 10 deletions
diff --git a/src/datafiles.c b/src/datafiles.c index b49780687..b42566848 100644 --- a/src/datafiles.c +++ b/src/datafiles.c @@ -619,12 +619,6 @@ static void remove_backups(void) #else DeleteFile(path); #endif - snprintf(path, sizeof(path), "backups/%s.%s", BotDBName, ext); -#ifndef _WIN32 - unlink(path); -#else - DeleteFile(path); -#endif snprintf(path, sizeof(path), "backups/%s.%s", ChanDBName, ext); #ifndef _WIN32 unlink(path); @@ -649,12 +643,31 @@ static void remove_backups(void) #else DeleteFile(path); #endif - snprintf(path, sizeof(path), "backups/%s.%s", HostDBName, ext); + + if (s_BotServ) { + snprintf(path, sizeof(path), "backups/%s.%s", BotDBName, ext); #ifndef _WIN32 - unlink(path); + unlink(path); #else - DeleteFile(path); + DeleteFile(path); +#endif + } + if (s_HostServ) { + snprintf(path, sizeof(path), "backups/%s.%s", HostDBName, ext); +#ifndef _WIN32 + unlink(path); +#else + DeleteFile(path); #endif + } + if (NSEmailReg) { + snprintf(path, sizeof(path), "backups/%s.%s", PreNickDBName, ext); +#ifndef _WIN32 + unlink(path); +#else + DeleteFile(path); +#endif + } } /*************************************************************************/ @@ -703,6 +716,9 @@ void backup_databases(void) if (s_HostServ) { rename_database(HostDBName, ext); } + if (NSEmailReg) { + rename_database(PreNickDBName, ext); + } } rename_database(OperDBName, ext); @@ -231,7 +231,7 @@ int rdb_ns_set_display(char *newnick, char *oldnick) if (ret) ret = db_mysql_try - ("UPDATE anope_na_access SET display='%s' WHERE display='%s'", + ("UPDATE anope_ns_access SET display='%s' WHERE display='%s'", q_newnick, q_oldnick); /* No need to update anope_cs_info here as it is updated when we |