size optimization - no need for both GetEnvironmentVariable and ExpandEnvironmentStrings
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4970 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5ea297c4ca
commit
b00c69290f
2 changed files with 9 additions and 15 deletions
|
@ -618,21 +618,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
{
|
||||
char *p=var0;
|
||||
char *buf0=GetStringFromParm(0x01);
|
||||
if (parm2)
|
||||
if (!ExpandEnvironmentStrings(buf0,p,NSIS_MAX_STRLEN)
|
||||
|| (parm2 && !lstrcmp(buf0, p)))
|
||||
{
|
||||
if (!GetEnvironmentVariable(buf0,p,NSIS_MAX_STRLEN))
|
||||
{
|
||||
exec_error++;
|
||||
*p=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ExpandEnvironmentStrings(buf0,p,NSIS_MAX_STRLEN))
|
||||
{
|
||||
exec_error++;
|
||||
*p=0;
|
||||
}
|
||||
exec_error++;
|
||||
*p=0;
|
||||
}
|
||||
p[NSIS_MAX_STRLEN-1]=0;
|
||||
}
|
||||
|
|
|
@ -5239,7 +5239,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.which=EW_READENVSTR;
|
||||
ent.offsets[0]=GetUserVarIndex(line, 1);
|
||||
{
|
||||
ent.offsets[1]=add_string(line.gettoken_str(2));
|
||||
char str[NSIS_MAX_STRLEN];
|
||||
strcpy(str, "%");
|
||||
strcat(str, line.gettoken_str(2));
|
||||
strcat(str, "%");
|
||||
ent.offsets[1]=add_string(str);
|
||||
if (ent.offsets[0] < 0 || strlen(line.gettoken_str(2))<1) PRINTHELP()
|
||||
}
|
||||
ent.offsets[2]=1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue