Only count a section as required if it is both SELECTED and RO

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7312 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-09-04 01:06:30 +00:00
parent 488ecccde5
commit ded87462dc

View file

@ -2795,20 +2795,14 @@ retry_output:
if (PAGE_COMPLETED != PAGE_INSTFILES && np) --np; // Special page not part of count
INFO_MSG(_T("%d page%") NPRIs _T(" (%d bytes), "),np,np==1?_T(""):_T("s"),np*sizeof(page));
#endif
#define IsRequiredSection(s) ( !(s).name_ptr || (((s).flags & (SF_RO|SF_SELECTED)) == (SF_RO|SF_SELECTED)))
{
int ns=build_sections.getlen()/sizeof(section);
int ns=build_sections.getlen()/sizeof(section), x;
section *s=(section*)build_sections.get();
int x;
unsigned int req=0;
for (x = 1; x < ns; x ++)
{
if (!s[x].name_ptr || s[x].flags & SF_RO) req++;
}
for (x = 0; x < ns; x ++) if (IsRequiredSection(s[x])) ++req;
INFO_MSG(_T("%d section%") NPRIs,ns,ns==1?_T(""):_T("s"));
if (req)
{
INFO_MSG(_T(" (%u required)"),req);
}
if (req) INFO_MSG(_T(" (%u required)"),req);
INFO_MSG(_T(" (%d bytes), "), build_sections.getlen());
}
int ne=build_header.blocks[NB_ENTRIES].num;
@ -2826,19 +2820,12 @@ retry_output:
INFO_MSG(_T("%d page%") NPRIs _T(" (%d bytes), "),np,np==1?_T(""):_T("s"),ubuild_pages.getlen());
#endif
{
int ns=ubuild_sections.getlen()/sizeof(section);
int ns=ubuild_sections.getlen()/sizeof(section), x;
section *s=(section*)ubuild_sections.get();
int x;
unsigned int req=0;
for (x = 1; x < ns; x ++)
{
if (!s[x].name_ptr || s[x].flags & SF_RO) req++;
}
for (x = 0; x < ns; x ++) if (IsRequiredSection(s[x])) ++req;
INFO_MSG(_T("%d section%") NPRIs,ns,ns==1?_T(""):_T("s"));
if (req)
{
INFO_MSG(_T(" (%u required)"),req);
}
if (req) INFO_MSG(_T(" (%u required)"),req);
INFO_MSG(_T(" (%d bytes), "), ubuild_sections.getlen());
}
ne=build_uninst.blocks[NB_ENTRIES].num;