fixed !include not failing when it can't find the requested file
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3232 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
92e433d64c
commit
164f6462b3
1 changed files with 10 additions and 2 deletions
|
@ -2469,6 +2469,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int malloced = sizeof(fd.cFileName) + strlen(f) + 1;
|
||||
char *incfile = (char *) malloc(malloced);
|
||||
|
||||
int included = 0;
|
||||
|
||||
strcpy(incfile, f);
|
||||
char *slash = strrchr(incfile, '\\');
|
||||
|
||||
|
@ -2484,6 +2486,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
strcat(incfile, fd.cFileName);
|
||||
if (includeScript(incfile) != PS_OK)
|
||||
return PS_ERROR;
|
||||
included++;
|
||||
}
|
||||
while (FindNextFile(search, &fd));
|
||||
FindClose(search);
|
||||
|
@ -2516,10 +2519,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
else
|
||||
incfile[0] = 0;
|
||||
strcat(incfile, fd.cFileName);
|
||||
SCRIPT_MSG("--> %s\n", incfile);
|
||||
if (includeScript(incfile) != PS_OK)
|
||||
return PS_ERROR;
|
||||
SCRIPT_MSG("%s\n", incfile);
|
||||
included++;
|
||||
}
|
||||
while (FindNextFile(search, &fd));
|
||||
FindClose(search);
|
||||
|
@ -2533,6 +2535,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
|
||||
free(incfile);
|
||||
|
||||
if (!included)
|
||||
{
|
||||
ERROR_MSG("!include: could not find: \"%s\"\n",f);
|
||||
return PS_ERROR;
|
||||
}
|
||||
}
|
||||
return PS_OK;
|
||||
case TOK_P_CD:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue