mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 00:09:26 +02:00
* Complement to fix of case insensitive comparison in Locate/Lookup: handles partial key
git-svn-id: trunk@13426 -
This commit is contained in:
parent
113e2f2431
commit
13c881c9ea
@ -977,9 +977,16 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function CompInsensitivePartial(Value: PChar; const Key: String): Boolean;
|
function CompInsensitivePartial(Value: PChar; const Key: String): Boolean;
|
||||||
|
var
|
||||||
|
AnsiKey, AnsiValue: AnsiString;
|
||||||
begin
|
begin
|
||||||
|
//see comments of CompInsensitive and CompInsensitiveWild functions
|
||||||
if Value <> nil then
|
if Value <> nil then
|
||||||
Result := StrLIComp(Value, PChar(Key), Length(Key)) = 0
|
begin
|
||||||
|
AnsiKey := UTF8Decode(Key);
|
||||||
|
AnsiValue := UTF8Decode(Value);
|
||||||
|
Result := AnsiStrLIComp(PChar(AnsiValue), PChar(AnsiKey), Length(AnsiKey)) = 0;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user