mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:39:37 +02:00
codetools: fixed FindNextComment when MaxPos=0
git-svn-id: trunk@33066 -
This commit is contained in:
parent
794b3c6aec
commit
d4e4fe6f3c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user