From c37d75940462df40da126c7696bacc604923a043 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Mar 2015 21:28:31 +0000 Subject: fix for replacing core variables git-svn-id: http://svn.miranda-ng.org/main/trunk@12425 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/path.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 60b242db54..a7ac429900 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -369,6 +369,8 @@ XCHAR *ReplaceVariables(XCHAR *str, REPLACEVARSDATA *data) else if (!varStart) length++; } + if (varStart) + length += (p - varStart)+1; XCHAR *result = (XCHAR *)mir_alloc(sizeof(XCHAR) * (length + 1)); XCHAR *q = result; @@ -397,6 +399,12 @@ XCHAR *ReplaceVariables(XCHAR *str, REPLACEVARSDATA *data) *q++=*p; } + if (varStart) { + size_t len = p - varStart + 1; + _xcsncpy(q, varStart-1, len); + q += len; + } + *q = 0; return result; -- cgit v1.2.3