From ea922a1ddd0526d37c6a299ab6260729612a8dfa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 28 Feb 2013 17:02:58 +0000 Subject: new template, VARST, to hold the result of calling Utils_ReplaceVarsT() git-svn-id: http://svn.miranda-ng.org/main/trunk@3806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/path.cpp | 7 +++---- src/modules/utils/utils.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src/modules/utils') diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 8c9cfbc6fe..0e9f38eb42 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -388,11 +388,10 @@ XCHAR *ReplaceVariables(XCHAR *str, REPLACEVARSDATA *data) static INT_PTR replaceVars(WPARAM wParam, LPARAM lParam) { REPLACEVARSDATA *data = (REPLACEVARSDATA *)lParam; - if ( !(data->dwFlags & RVF_UNICODE)) - return (INT_PTR)ReplaceVariables((char *)wParam, data); + if (data->dwFlags & RVF_UNICODE) + return (INT_PTR)ReplaceVariables((WCHAR *)wParam, data); - - return (INT_PTR)ReplaceVariables((WCHAR *)wParam, data); + return (INT_PTR)ReplaceVariables((char *)wParam, data); } int InitPathUtils(void) diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index 18d5e88973..8c577679c5 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -429,11 +429,11 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM) si.cb = sizeof(si); GetModuleFileName(NULL, mirandaPath, SIZEOF(mirandaPath)); if (wParam) { - TCHAR *profilename = Utils_ReplaceVarsT(_T("%miranda_profilename%")); - mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), profilename); - mir_free(profilename); - } else - mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId()); + VARST profilename( _T("%miranda_profilename%")); + mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename); + } + else mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId()); + CallService("CloseAction", 0, 0); CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); return 0; -- cgit v1.2.3