Masks: fix TMask.Matches() when converting the case alters UTF8Length Issue #0026790). Based on patch by laz-andy.

git-svn-id: trunk@46339 -
This commit is contained in:
bart 2014-09-27 15:33:23 +00:00
parent 51ab663b7f
commit 1d7f7a7b0a

View File

@ -289,7 +289,7 @@ var
if fCaseSensitive then
CharValue := GetCodePoint(AValue,I)
else
CharValue := Utf8UpperCase(GetCodePoint(AValue,I));
CharValue := Utf8LowerCase(GetCodePoint(AValue,I));
end;
Inc(FMask.MinLength);
@ -374,6 +374,8 @@ var
end;
mcAnyChar:
begin
//CP := GetCodePoint(S, CharIndex);
//writeln('mcAnyChar: CP = ',UTF8ToConsole(CP),' CharIndex = ',CharIndex);
if CharIndex > L then Exit;
Inc(CharIndex);
end;
@ -411,7 +413,10 @@ begin
if fCaseSensitive then
S := AFileName
else
S := Utf8UpperCase(AFileName);
begin
S := Utf8LowerCase(AFileName);
L := Utf8Length(S);
end;
Result := MatchToEnd(0, 1);
end;