From 97c3fb52bfc0cae5d8c75e3de3237882fbddda62 Mon Sep 17 00:00:00 2001 From: eccles Date: Wed, 2 Oct 2002 22:45:51 +0000 Subject: [PATCH] !macroend was only being recognised at the beginning of a line git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1287 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index 583f0685..4ef7c0e5 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -425,7 +425,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char if (p > str) p--; while (p >= str && (*p == '\r' || *p == '\n' || *p == ' ' || *p == '\t')) p--; *++p=0; - if (!strnicmp(str,"!macroend",sizeof("!macroend"))) break; + LineParser l2; + if (!l2.parse(str) && !stricmp(l2.gettoken_str(0),"!macroend")) break; if (str[0]) m_macros.add(str,strlen(str)+1); else m_macros.add(" ",2); } @@ -2310,27 +2311,27 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char SCRIPT_MSG("(->%s)",line.gettoken_str(5)); a++; } - + if (!strncmp(line.gettoken_str(a),"/TIMEOUT=",9)) { ent.offsets[5]|=atoi(line.gettoken_str(a)+9)<<2; SCRIPT_MSG(" (timeout=%d)",ent.offsets[5]>>2); a++; } - - if (line.getnumtokens()>a) + + if (line.getnumtokens()>a) { PRINTHELP() } } - if (!strncmp(line.gettoken_str(3),"STR:",4)) + if (!strncmp(line.gettoken_str(3),"STR:",4)) { ent.offsets[5]|=1; ent.offsets[3]=add_string(line.gettoken_str(3)+4); } else ent.offsets[3]=add_string(line.gettoken_str(3)); - if (!strncmp(line.gettoken_str(4),"STR:",4)) + if (!strncmp(line.gettoken_str(4),"STR:",4)) { ent.offsets[5]|=2; ent.offsets[4]=add_string(line.gettoken_str(4)+4); @@ -3874,4 +3875,4 @@ int CEXEBuild::do_add_file(const char *lgss, int attrib, int recurse, int linecn } return PS_OK; } -#endif \ No newline at end of file +#endif