added !appendfile
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4322 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
e7bdb6aad8
commit
c94fdbf119
4 changed files with 39 additions and 0 deletions
|
@ -1069,6 +1069,30 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
SCRIPT_MSG("!delfile: \"%s\"\n", line.gettoken_str(1));
|
||||
return PS_OK;
|
||||
|
||||
case TOK_P_APPENDFILE:
|
||||
{
|
||||
char *file = line.gettoken_str(1);
|
||||
char *text = line.gettoken_str(2);
|
||||
|
||||
FILE *fp = FOPEN(file, "a");
|
||||
if (!fp)
|
||||
{
|
||||
ERROR_MSG("!appendfile: \"%s\" couldn't be opened.\n", file);
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
if (fputs(text, fp) < 0)
|
||||
{
|
||||
ERROR_MSG("!appendfile: error writing to \"%s\".\n", file);
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
SCRIPT_MSG("!appendfile: \"%s\" \"%s\"\n", file, text);
|
||||
}
|
||||
return PS_OK;
|
||||
|
||||
// page ordering shit
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue