#1787648: ${__SECTION__} is correctly defined in hidden section
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6107 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
1421a3e315
commit
ab8f90f99e
2 changed files with 10 additions and 14 deletions
|
@ -1187,10 +1187,9 @@ int CEXEBuild::add_section(const TCHAR *secname, const TCHAR *defname, int expan
|
|||
|
||||
TCHAR *name = (TCHAR*)secname;
|
||||
|
||||
// Is it a hidden section?
|
||||
if (secname[0] == _T('-'))
|
||||
if (name[0] == _T('\x1F')) // SectionGroup/SectionGroupEnd
|
||||
{
|
||||
if (secname[1])
|
||||
if (name[1])
|
||||
{
|
||||
new_section.flags |= SF_SECGRP;
|
||||
name++;
|
||||
|
@ -1199,6 +1198,10 @@ int CEXEBuild::add_section(const TCHAR *secname, const TCHAR *defname, int expan
|
|||
new_section.flags |= SF_SECGRPEND;
|
||||
}
|
||||
|
||||
int hidden = (name[0] == _T('-'));
|
||||
if (hidden)
|
||||
name++;
|
||||
|
||||
if (name[0] == _T('!'))
|
||||
{
|
||||
name++;
|
||||
|
@ -1236,8 +1239,8 @@ int CEXEBuild::add_section(const TCHAR *secname, const TCHAR *defname, int expan
|
|||
|
||||
new_section.code = cur_entries->getlen() / sizeof(entry);
|
||||
|
||||
new_section.install_types = *name ? 0 : ~0;
|
||||
new_section.name_ptr = add_string(name);
|
||||
new_section.install_types = (!hidden && *name) ? 0 : ~0;
|
||||
new_section.name_ptr = hidden ? 0 : add_string(name);
|
||||
memset(&new_section.name,0,sizeof(new_section.name));
|
||||
|
||||
cur_sections->add(&new_section, sizeof(section));
|
||||
|
|
|
@ -3457,14 +3457,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
int ret;
|
||||
|
||||
if (line.gettoken_str(a)[0]==_T('-'))
|
||||
{
|
||||
if (!_tcsnicmp(line.gettoken_str(a)+1,_T("un."),3))
|
||||
ret=add_section(_T("un."),line.gettoken_str(a+1));
|
||||
else
|
||||
ret=add_section(_T(""),line.gettoken_str(a+1));
|
||||
}
|
||||
else ret=add_section(line.gettoken_str(a),line.gettoken_str(a+1));
|
||||
ret=add_section(line.gettoken_str(a),line.gettoken_str(a+1));
|
||||
if (ret != PS_OK) return ret;
|
||||
|
||||
if (unselected)
|
||||
|
@ -3522,7 +3515,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ex = 1;
|
||||
a++;
|
||||
}
|
||||
wsprintf(buf,_T("-%s"),line.gettoken_str(a));
|
||||
wsprintf(buf,_T("\x1F%s"),line.gettoken_str(a));
|
||||
if (which_token == TOK_SECTIONGROUP || which_token == TOK_SUBSECTION)
|
||||
{
|
||||
TCHAR *s = line.gettoken_str(a);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue