diff options
author | George Hazan <george.hazan@gmail.com> | 2013-01-12 19:49:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-01-12 19:49:43 +0000 |
commit | 86af3b9f5006773c3acd00493384be7483a0d4a3 (patch) | |
tree | 6a1d02a371d45893bb28c9c5cecd8ad13028b981 /plugins/AutoRun | |
parent | 61b011937f55446542eb829004d14336837f1ce7 (diff) |
the same fix for AutoRun
fixes: #97
git-svn-id: http://svn.miranda-ng.org/main/trunk@3078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoRun')
-rw-r--r-- | plugins/AutoRun/src/main.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index b65a22175b..7794fe0f3f 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -25,15 +25,14 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) void GetProfilePath(TCHAR *res, size_t resLen)
{
- TCHAR dbname[MAX_PATH], dbpath[MAX_PATH], exename[MAX_PATH];
- CallService(MS_DB_GETPROFILENAMET, SIZEOF(dbname), (LPARAM)(TCHAR*) dbname);
- CallService(MS_DB_GETPROFILEPATHT, SIZEOF(dbpath), (LPARAM)(TCHAR*) dbpath);
- GetModuleFileName(NULL,exename, SIZEOF(exename));
- lstrcat(dbpath, _T("\\"));
- lstrcpyn(dbpath + lstrlen(dbpath), dbname, lstrlen(dbname)-3);
- lstrcat(dbpath, _T("\\"));
- lstrcat(dbpath, dbname); // path + profile name
- mir_sntprintf(res, resLen, _T("\"%s\" \"%s\""), exename, dbpath);
+ TCHAR dbname[MAX_PATH], exename[MAX_PATH];
+ CallService(MS_DB_GETPROFILENAMET, SIZEOF(dbname), (LPARAM)dbname);
+ GetModuleFileName(NULL, exename, SIZEOF(exename));
+
+ TCHAR *p = _tcsrchr(dbname, '.');
+ if (p) *p = 0;
+
+ mir_sntprintf(res, resLen, _T("\"%s\" \"/profile:%s\""), exename, dbname);
}
static void SetAutorun(BOOL autorun)
|