From cde0aea7704dbbe933812fc67bcb1f615015899e Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 5 Dec 2009 21:52:39 +0000 Subject: [PATCH] fixed bug #2849872 - LogicLib Do..Loop warning git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6005 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/LogicLib.nsi | 20 ++++++++++++++++++++ Include/LogicLib.nsh | 1 + 2 files changed, 21 insertions(+) diff --git a/Examples/LogicLib.nsi b/Examples/LogicLib.nsi index 824bb45c..ce7574b9 100644 --- a/Examples/LogicLib.nsi +++ b/Examples/LogicLib.nsi @@ -440,6 +440,15 @@ Section /o "Run tests" TESTS DetailPrint "FAILED For[Each]..Next test" ${EndIf} + ; do..loop + StrCpy $R1 0 + Call DoLoop + ${If} $R1 == 5 + DetailPrint "PASSED Do..Loop test" + ${Else} + DetailPrint "FAILED Do..Loop test" + ${EndIf} + ; do..exitdo..loop StrCpy $R1 0 StrCpy $R2 "" @@ -596,4 +605,15 @@ Function ComponentsLeave ${EndIf} FunctionEnd +Function DoLoop + + ${Do} + IntOp $R1 $R1 + 1 + ${If} $R1 == 5 + Return + ${EndIf} + ${Loop} + +FunctionEnd + !verbose 3 diff --git a/Include/LogicLib.nsh b/Include/LogicLib.nsh index 326417a2..9e78e425 100644 --- a/Include/LogicLib.nsh +++ b/Include/LogicLib.nsh @@ -576,6 +576,7 @@ !endif !undef _c=${_c} Goto ${_Continue} ; Just to ensure it is referenced at least once + Goto ${_Exit${_n}} ; Just to ensure it is referenced at least once ${_Exit${_n}}: ; Place the loop exit point !undef ${_Logic}Condition !insertmacro _PopScope Continue