fixed a crash caused by defining a macro in a file included by another macro

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3573 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-06-25 10:16:31 +00:00
parent c1dc7b8c92
commit 88c19d767d

View file

@ -902,6 +902,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
if (!line.gettoken_str(1)[0]) PRINTHELP()
char *t=(char *)m_macros.get();
char *m=t;
while (t && *t)
{
if (!stricmp(t,line.gettoken_str(1))) break;
@ -975,6 +976,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
return ret;
}
}
{
// fix t if process_oneline changed m_macros
char *nm=(char *)m_macros.get();
if (nm != m)
{
t += nm - m;
m = nm;
}
}
t+=strlen(t)+1;
}
m_macro_entry.delbypos(npos);