summaryrefslogtreecommitdiff
path: root/src/modules/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/database')
-rw-r--r--src/modules/database/database.cpp7
-rw-r--r--src/modules/database/profilemanager.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp
index 240daf3277..bdf8422569 100644
--- a/src/modules/database/database.cpp
+++ b/src/modules/database/database.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// contains the location of mirandaboot.ini
extern TCHAR mirandabootini[MAX_PATH];
bool g_bDbCreated;
-TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH];
+TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_profileRoot[MAX_PATH];
TCHAR* g_defaultProfile;
void EnsureCheckerLoaded(bool);
@@ -51,6 +51,11 @@ static void fillProfileName(const TCHAR* ptszFileName)
p++;
_tcsncpy(g_profileName, p, SIZEOF(g_profileName));
+
+ TCHAR *szProfile = NEWTSTR_ALLOCA(p);
+ TCHAR *pExt = _tcsstr( _tcslwr(szProfile), _T(".dat"));
+ if (pExt) *pExt = 0;
+ mir_sntprintf(g_profileRoot, SIZEOF(g_profileRoot), _T("%s\\%s"), g_profileDir, szProfile);
}
bool IsInsideRootDir(TCHAR* profiledir, bool exact)
diff --git a/src/modules/database/profilemanager.h b/src/modules/database/profilemanager.h
index f289a77ef8..58fd1d747d 100644
--- a/src/modules/database/profilemanager.h
+++ b/src/modules/database/profilemanager.h
@@ -37,6 +37,5 @@ int isValidProfileName(const TCHAR *name);
bool fileExist(TCHAR* fname);
bool shouldAutoCreate(TCHAR *szProfile);
-extern TCHAR g_profileDir[MAX_PATH];
-extern TCHAR g_profileName[MAX_PATH];
+extern TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_profilePath[MAX_PATH];
extern bool g_bDbCreated;