From d4e4fe6f3c81a6422820a920ee561cff9d1e3805 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 24 Oct 2011 15:54:14 +0000 Subject: [PATCH] codetools: fixed FindNextComment when MaxPos=0 git-svn-id: trunk@33066 - --- components/codetools/basiccodetools.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/codetools/basiccodetools.pas b/components/codetools/basiccodetools.pas index 6c2247d042..b406cf058f 100644 --- a/components/codetools/basiccodetools.pas +++ b/components/codetools/basiccodetools.pas @@ -1153,7 +1153,7 @@ function FindNextComment(const ASource: string; StartPos: integer; var NotFoundPos: Integer; begin - NotFoundPos:=MaxPos+1; + NotFoundPos:=MaxPos; if (MaxPos>length(ASource)) or (MaxPos<1) then MaxPos:=length(ASource); Result:=StartPos; @@ -1185,7 +1185,7 @@ begin end; if Result>MaxPos then if NotFoundPos>=1 then - Result:=NotFoundPos + Result:=NotFoundPos+1 else Result:=MaxPos+1; end;