summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-03-05 20:15:56 -0500
committerAdam <Adam@anope.org>2012-03-05 20:15:56 -0500
commitab258156942cd0ca95e77bad72e6f40ae8849f39 (patch)
treed8d795260829bb5fe315910d0ed119e57c86d4e1
parent8e0104363f33b5618ac0a66856cf8d649a3c96ed (diff)
Fixed backup databases having their names collide due to not separating month and day, #1383
-rw-r--r--modules/database/db_flatfile.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp
index 5442e096f..259851b18 100644
--- a/modules/database/db_flatfile.cpp
+++ b/modules/database/db_flatfile.cpp
@@ -13,10 +13,9 @@
#include "module.h"
#include <unistd.h>
-Anope::string DatabaseFile;
-
class DBFlatFile : public Module
{
+ Anope::string DatabaseFile;
/* Day the last backup was on */
int LastDay;
/* Backup file names */
@@ -47,7 +46,7 @@ class DBFlatFile : public Module
if (tm->tm_mday != LastDay)
{
LastDay = tm->tm_mday;
- Anope::string newname = "backups/" + DatabaseFile + "." + stringify(tm->tm_year) + stringify(tm->tm_mon) + stringify(tm->tm_mday);
+ Anope::string newname = "backups/" + DatabaseFile + "." + stringify(tm->tm_year) + "." + stringify(tm->tm_mon) + "." + stringify(tm->tm_mday);
/* Backup already exists */
if (IsFile(newname))