Automatically double ampersands in the name attribute

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7131 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2019-10-24 22:15:30 +00:00
parent 2bae3414ba
commit 52cd125973
6 changed files with 19 additions and 3 deletions

View file

@ -880,6 +880,16 @@ bool IsWindowsPathRelative(const TCHAR *p)
return PathGetDosDriveNumber(p) < 0;
}
tstring replace_all(const TCHAR *str, const TCHAR *find, const TCHAR *repl)
{
tstring out = str;
for (size_t cchF = _tcslen(find), cchR = _tcslen(repl), i = 0; ; i += cchR)
if ((i = out.find(find, i)) == tstring::npos)
return out;
else
out.replace(i, cchF, repl);
}
struct ToLower
{
TCHAR operator() (TCHAR c) const { return _totlower(c); }