From 88c19d767df23b351d2ab8367a39acae18c6883b Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 25 Jun 2004 10:16:31 +0000 Subject: [PATCH] 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 --- Source/script.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/script.cpp b/Source/script.cpp index e0db6315..63903177 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -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);