allocate g_sdata.script_cmd_args as GMEM_MOVEABLE
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5100 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
c72c1d9520
commit
2263524b66
3 changed files with 15 additions and 8 deletions
|
@ -94,7 +94,7 @@ void SetScript(const char *script, bool clearArgs /*= true*/)
|
|||
GlobalFree(g_sdata.script_cmd_args);
|
||||
}
|
||||
|
||||
g_sdata.script_cmd_args = (char *) GlobalAlloc(GPTR, 1);
|
||||
g_sdata.script_cmd_args = GlobalAlloc(GHND, 1);
|
||||
}
|
||||
|
||||
g_sdata.script = (char *) GlobalAlloc(GPTR, lstrlen(script) + 1);
|
||||
|
@ -103,13 +103,17 @@ void SetScript(const char *script, bool clearArgs /*= true*/)
|
|||
|
||||
void AddScriptCmdArgs(const char *arg)
|
||||
{
|
||||
g_sdata.script_cmd_args = (char *) GlobalReAlloc(g_sdata.script_cmd_args,
|
||||
g_sdata.script_cmd_args = GlobalReAlloc(g_sdata.script_cmd_args,
|
||||
GlobalSize(g_sdata.script_cmd_args) + lstrlen(arg) + 2 /* quotes */ + 1 /* space */,
|
||||
0);
|
||||
|
||||
lstrcat(g_sdata.script_cmd_args, " \"");
|
||||
lstrcat(g_sdata.script_cmd_args, arg);
|
||||
lstrcat(g_sdata.script_cmd_args, "\"");
|
||||
char *args = (char *) GlobalLock(g_sdata.script_cmd_args);
|
||||
|
||||
lstrcat(args, " \"");
|
||||
lstrcat(args, arg);
|
||||
lstrcat(args, "\"");
|
||||
|
||||
GlobalUnlock(args);
|
||||
}
|
||||
|
||||
void ProcessCommandLine()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue