Added ${__MACRO__}
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6171 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
20dcb1923a
commit
8cde6958a8
4 changed files with 14 additions and 0 deletions
|
@ -334,6 +334,10 @@ Defined in \R{ssection}{section}, \R{ffunction}{function} or \R{pageex}{PageEx}
|
||||||
\c
|
\c
|
||||||
\c FunctionEnd
|
\c FunctionEnd
|
||||||
|
|
||||||
|
\S2{} $\{__MACRO__\}
|
||||||
|
|
||||||
|
Defined as the name of the current macro.
|
||||||
|
|
||||||
\S0{compenvvarread} Read environment variables
|
\S0{compenvvarread} Read environment variables
|
||||||
|
|
||||||
\S1{compenvvar} $%envVarName%
|
\S1{compenvvar} $%envVarName%
|
||||||
|
|
|
@ -256,6 +256,8 @@ CEXEBuild::CEXEBuild() :
|
||||||
|
|
||||||
no_space_texts=false;
|
no_space_texts=false;
|
||||||
|
|
||||||
|
m_currentmacroname=NULL;
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
||||||
build_plugin_unload=0;
|
build_plugin_unload=0;
|
||||||
plugins_processed=0;
|
plugins_processed=0;
|
||||||
|
|
|
@ -433,6 +433,7 @@ class CEXEBuild {
|
||||||
|
|
||||||
int sectiongroup_open_cnt;
|
int sectiongroup_open_cnt;
|
||||||
FastStringList m_warnings;
|
FastStringList m_warnings;
|
||||||
|
const TCHAR* m_currentmacroname;
|
||||||
GrowBuf m_macros;
|
GrowBuf m_macros;
|
||||||
|
|
||||||
StringList m_macro_entry;
|
StringList m_macro_entry;
|
||||||
|
|
|
@ -1178,6 +1178,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
int npos=m_macro_entry.add(line.gettoken_str(1),0);
|
int npos=m_macro_entry.add(line.gettoken_str(1),0);
|
||||||
|
|
||||||
wsprintf(str,_T("macro:%s"),line.gettoken_str(1));
|
wsprintf(str,_T("macro:%s"),line.gettoken_str(1));
|
||||||
|
const TCHAR* oldmacroname=m_currentmacroname;
|
||||||
|
m_currentmacroname=line.gettoken_str(1);
|
||||||
|
definedlist.del(_T("__MACRO__"));
|
||||||
|
definedlist.add(_T("__MACRO__"),m_currentmacroname);
|
||||||
while (*t)
|
while (*t)
|
||||||
{
|
{
|
||||||
lp++;
|
lp++;
|
||||||
|
@ -1212,6 +1216,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
p+=_tcslen(p)+1;
|
p+=_tcslen(p)+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
definedlist.del(_T("__MACRO__"));
|
||||||
|
m_currentmacroname = oldmacroname;
|
||||||
|
if (oldmacroname) definedlist.add(_T("__MACRO__"),oldmacroname);
|
||||||
SCRIPT_MSG(_T("!insertmacro: end of %s\n"),line.gettoken_str(1));
|
SCRIPT_MSG(_T("!insertmacro: end of %s\n"),line.gettoken_str(1));
|
||||||
}
|
}
|
||||||
return PS_OK;
|
return PS_OK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue