From b20cd55d96430bfd5e1cb0c1d3f73c7b71bf8ffa Mon Sep 17 00:00:00 2001 From: anders_k Date: Wed, 9 Jun 2021 20:33:12 +0000 Subject: [PATCH] Fixed ${GetTime} hour padding (bug #980) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7270 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/history.but | 2 ++ Include/FileFunc.nsh | 15 ++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Docs/src/history.but b/Docs/src/history.but index ef859a5a..05adfe02 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -24,6 +24,8 @@ Unicode is now the default. \b Fixed StrClb Unicode bug (\W{http://sf.net/p/nsis/patches/302}{patch #302}) +\b Fixed $\{GetTime\} hour padding (\W{http://sf.net/p/nsis/bugs/980}{bug #980}) + \S2{} Translations \b Updated Corsican\#{(forum)} and Japanese (maboroshin PR\#{github.com/maboroshin}) diff --git a/Include/FileFunc.nsh b/Include/FileFunc.nsh index 76f4cbe8..3336965e 100644 --- a/Include/FileFunc.nsh +++ b/Include/FileFunc.nsh @@ -1146,17 +1146,14 @@ RefreshShellIcons System::Call 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)' FileFunc_GetTime_convert: - System::Call '*$7(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)p(.r5,.r6,.r4,.r0,.r3,.r2,.r1,)' + System::Call '*$7(&i2.r5,&i2.r6,&i2.r4,&i2.r0,&i2.r3,&i2.r2,&i2.r1,&i2)' System::Free $7 - IntCmp $0 9 0 0 +2 - StrCpy $0 '0$0' - IntCmp $1 9 0 0 +2 - StrCpy $1 '0$1' - IntCmp $2 9 0 0 +2 - StrCpy $2 '0$2' - IntCmp $6 9 0 0 +2 - StrCpy $6 '0$6' + IntFmt $6 "%.2u" $6 ; Month + IntFmt $0 "%.2u" $0 ; Day + IntFmt $3 "%.2u" $3 ; Hour + IntFmt $2 "%.2u" $2 ; Minute + IntFmt $1 "%.2u" $1 ; Second StrCmp $4 0 0 +3 StrCpy $4 Sunday