mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 07:10:45 +01: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
|
var
|
||||||
NotFoundPos: Integer;
|
NotFoundPos: Integer;
|
||||||
begin
|
begin
|
||||||
NotFoundPos:=MaxPos+1;
|
NotFoundPos:=MaxPos;
|
||||||
if (MaxPos>length(ASource)) or (MaxPos<1) then
|
if (MaxPos>length(ASource)) or (MaxPos<1) then
|
||||||
MaxPos:=length(ASource);
|
MaxPos:=length(ASource);
|
||||||
Result:=StartPos;
|
Result:=StartPos;
|
||||||
@ -1185,7 +1185,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if Result>MaxPos then
|
if Result>MaxPos then
|
||||||
if NotFoundPos>=1 then
|
if NotFoundPos>=1 then
|
||||||
Result:=NotFoundPos
|
Result:=NotFoundPos+1
|
||||||
else
|
else
|
||||||
Result:=MaxPos+1;
|
Result:=MaxPos+1;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user