diff --git a/Source/build.cpp b/Source/build.cpp index 79318a4d..9b1e7bb5 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -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)); diff --git a/Source/script.cpp b/Source/script.cpp index ca014873..55859d68 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -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);