From 27a1e0040c74e8a4b7c92a12916ea0f4f7a3f9fd Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 23 Aug 2005 17:45:25 +0000 Subject: [PATCH] (Instructor) WordReplace - Fixed: Incorrect rule for return errorlevel 1 in situation when string beginning with word to replace and its only one word in string and when uses option - deletes all found words git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4225 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/WordFuncTest.nsi | 3 +++ Include/WordFunc.nsh | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Examples/WordFuncTest.nsi b/Examples/WordFuncTest.nsi index 1f7ce3e6..f8c13bef 100644 --- a/Examples/WordFuncTest.nsi +++ b/Examples/WordFuncTest.nsi @@ -269,6 +269,9 @@ Section WordReplace ${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' '' '+' $OUT StrCmp $OUT 'C:\io. C:\logo. C:\WINDOWS' 0 error + ${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'C:\io.sys' '' '+' $OUT + StrCmp $OUT ' C:\logo.sys C:\WINDOWS' 0 error + ${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' ' ' ' ' '+1*' $OUT StrCmp $OUT 'C:\io.sys C:\logo.sys C:\WINDOWS' 0 error diff --git a/Include/WordFunc.nsh b/Include/WordFunc.nsh index 19a95c32..a7b8500c 100644 --- a/Include/WordFunc.nsh +++ b/Include/WordFunc.nsh @@ -1,7 +1,7 @@ /* _____________________________________________________________________________ - Word Functions Header v3.0 + Word Functions Header v3.1 _____________________________________________________________________________ 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru) @@ -808,11 +808,11 @@ VersionConvert all: StrCpy $5 0 StrCpy $2 $R0 $7 $5 - StrCmp $2$3 '' error1 StrCmp $2 '' +4 - StrCmp $2 $0 +5 + StrCmp $2 $0 +6 IntOp $5 $5 + 1 - goto -5 + goto -4 + StrCmp $R0 $R1 error1 StrCpy $R0 '$3$R0' goto end StrCpy $2 $R0 $5