summaryrefslogtreecommitdiff
path: root/src/modules/utils
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-28 17:02:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-28 17:02:58 +0000
commitea922a1ddd0526d37c6a299ab6260729612a8dfa (patch)
tree56bc15af2b2b173b4368ef3c1a6a065267a23ccf /src/modules/utils
parent7b44e3c9879ed7cb1ab3f64b829e0c0b09c6ffae (diff)
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
Diffstat (limited to 'src/modules/utils')
-rw-r--r--src/modules/utils/path.cpp7
-rw-r--r--src/modules/utils/utils.cpp10
2 files changed, 8 insertions, 9 deletions
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>((char *)wParam, data);
+ if (data->dwFlags & RVF_UNICODE)
+ return (INT_PTR)ReplaceVariables<WCHAR>((WCHAR *)wParam, data);
-
- return (INT_PTR)ReplaceVariables<WCHAR>((WCHAR *)wParam, data);
+ return (INT_PTR)ReplaceVariables<char>((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;