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

@ -1279,7 +1279,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
if (SetInnerString(NLF_NAME,line.gettoken_str(1)) == PS_WARNING)
warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
SetInnerString(NLF_NAME_DA,line.gettoken_str(2));
tstring da;
const TCHAR *normstr = line.gettoken_str(1), *dastr = line.gettoken_str(2);
if (!*dastr && _tcschr(normstr,_T('&'))) dastr = (da = replace_all(normstr,_T("&"),_T("&&"))).c_str();
SetInnerString(NLF_NAME_DA,dastr);
SCRIPT_MSG(_T("Name: \"%") NPRIs _T("\""),line.gettoken_str(1));
if (*line.gettoken_str(2))
SCRIPT_MSG(_T(" \"%") NPRIs _T("\""),line.gettoken_str(2));