diff options
author | George Hazan <george.hazan@gmail.com> | 2015-03-17 21:28:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-03-17 21:28:31 +0000 |
commit | c37d75940462df40da126c7696bacc604923a043 (patch) | |
tree | 782b54a7ff5439a0f9183cee5868422844a4e317 /src/modules/utils/path.cpp | |
parent | dd3d0e59dcd34beb222fcf612a51d3fee82c0e43 (diff) |
fix for replacing core variables
git-svn-id: http://svn.miranda-ng.org/main/trunk@12425 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/utils/path.cpp')
-rw-r--r-- | src/modules/utils/path.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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;
|