diff --git a/components/codetools/basiccodetools.pas b/components/codetools/basiccodetools.pas index 09619f220d..c2e9394f3e 100644 --- a/components/codetools/basiccodetools.pas +++ b/components/codetools/basiccodetools.pas @@ -2948,7 +2948,8 @@ function ComparePrefixIdent(PrefixIdent, Identifier: PChar): boolean; begin if PrefixIdent<>nil then begin if Identifier<>nil then begin - while UpChars[PrefixIdent^]=UpChars[Identifier^] do begin + while (UpChars[PrefixIdent^]=UpChars[Identifier^]) and (PrefixIdent^>#0) do + begin inc(PrefixIdent); inc(Identifier); end;