diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-09 12:07:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-09 12:07:26 +0000 |
commit | f4aa7e3b87abf75249e35b6bcb1c37ce9f7b648b (patch) | |
tree | c4de493e697bac261ef23ddbea7631c0867f010d /src/modules/database | |
parent | 2ff607d58d8889248484d3bcd4eb123a13c0a164 (diff) |
fix for recursion in Folders
git-svn-id: http://svn.miranda-ng.org/main/trunk@6414 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database')
-rw-r--r-- | src/modules/database/database.cpp | 12 | ||||
-rw-r--r-- | src/modules/database/profilemanager.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index bdf8422569..25cfed9520 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], g_profileRoot[MAX_PATH];
+TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
TCHAR* g_defaultProfile;
void EnsureCheckerLoaded(bool);
@@ -50,12 +50,12 @@ static void fillProfileName(const TCHAR* ptszFileName) else
p++;
- _tcsncpy(g_profileName, p, SIZEOF(g_profileName));
+ _tcsncpy_s(g_profileName, SIZEOF(g_profileName), p, _TRUNCATE);
- 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);
+ _tcsncpy_s(g_shortProfileName, SIZEOF(g_shortProfileName), p, _TRUNCATE);
+ TCHAR *pos = _tcsrchr(g_shortProfileName, '.');
+ if (lstrcmpi(pos, _T(".dat")) == 0)
+ *pos = 0;
}
bool IsInsideRootDir(TCHAR* profiledir, bool exact)
diff --git a/src/modules/database/profilemanager.h b/src/modules/database/profilemanager.h index 58fd1d747d..d91b71570a 100644 --- a/src/modules/database/profilemanager.h +++ b/src/modules/database/profilemanager.h @@ -37,5 +37,5 @@ int isValidProfileName(const TCHAR *name); bool fileExist(TCHAR* fname);
bool shouldAutoCreate(TCHAR *szProfile);
-extern TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_profilePath[MAX_PATH];
+extern TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
extern bool g_bDbCreated;
|