From 7604e28f3fb630b20aebbb256d059f62c46869cd Mon Sep 17 00:00:00 2001 From: justin1014 Date: Fri, 13 Sep 2002 23:09:23 +0000 Subject: [PATCH] made SendMessage command logic more sensitive git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1010 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/script.cpp b/Source/script.cpp index f24ac6d2..37bc98ac 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -2280,6 +2280,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char return add_entry(&ent); case TOK_SENDMESSAGE: ent.which=EW_SENDMESSAGE; + + if (line.gettoken_str(1)[0] == '/' || line.gettoken_str(2)[0] == '/' || + line.gettoken_str(3)[0] == '/' || line.gettoken_str(4)[0] == '/') + { + PRINTHELP() + } + SCRIPT_MSG("SendMessage:"); { int a=5; @@ -2289,11 +2296,17 @@ 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) + { + PRINTHELP() } }