implemented RFE #1459210 - !define /date should use UTC

added /utcdate flag


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4622 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-03-28 18:20:28 +00:00
parent 411a2d5c58
commit 12df15a9e5
3 changed files with 9 additions and 4 deletions

View file

@ -2693,15 +2693,20 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
char mathbuf[256];
bool date=false;
if (!stricmp(define,"/date")) {
if (!stricmp(define,"/date") || !stricmp(define,"/utcdate")) {
if (line.getnumtokens()!=4) PRINTHELP()
char *date_type = define;
define=line.gettoken_str(2);
value=line.gettoken_str(3);
time_t rawtime;
time(&rawtime);
if (!stricmp(date_type,"/utcdate"))
rawtime = mktime(gmtime(&rawtime));
datebuf[0]=0;
size_t s=strftime(datebuf,sizeof(datebuf),value,localtime(&rawtime));

View file

@ -229,7 +229,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_P_IFDEF,"!ifdef",1,-1,"symbol [| symbol2 [& symbol3 [...]]]",TP_ALL},
{TOK_P_IFNDEF,"!ifndef",1,-1,"symbol [| symbol2 [& symbol3 [...]]]",TP_ALL},
{TOK_P_ENDIF,"!endif",0,0,"",TP_ALL},
{TOK_P_DEFINE,"!define",1,4,"([/date] symbol [value]) | (/math symbol val1 OP val2)\n OP=(+ - * / %)",TP_ALL},
{TOK_P_DEFINE,"!define",1,4,"([/date|/utcdate] symbol [value]) | (/math symbol val1 OP val2)\n OP=(+ - * / %)",TP_ALL},
{TOK_P_UNDEF,"!undef",1,1,"symbol [value]",TP_ALL},
{TOK_P_ELSE,"!else",0,-1,"[if[macro][n][def] ...]",TP_ALL},
{TOK_P_ECHO,"!echo",1,0,"message",TP_ALL},