Skip to content

Commit

Permalink
fixed IsCaseSensitive() to work as expected
Browse files Browse the repository at this point in the history
- it was working like a IsUpperCase() function
  • Loading branch information
Arnaud Bouchez committed Jan 8, 2019
1 parent 1097331 commit dd0f631
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions SynCommons.pas
Expand Up @@ -21530,14 +21530,14 @@ procedure FastSetString(var s: RawUTF8; p: pointer; len: PtrInt);
sr: PStrRec;
begin
if len>0 then begin
GetMem(r,len+(STRRECSIZE+2));
GetMem(r,len+(STRRECSIZE+4));
sr := pointer(r);
sr^.codePage := CP_UTF8;
sr^.elemSize := 1;
sr^.refCnt := 1;
sr^.length := len;
inc(sr);
PWord(PAnsiChar(sr)+len)^ := 0;
PCardinal(PAnsiChar(sr)+len)^ := 0;
r := pointer(sr);
if p<>nil then
MoveFast(p^,sr^,len);
Expand Down Expand Up @@ -28767,12 +28767,10 @@ function LowerCaseUnicode(const S: RawUTF8): RawUTF8;

function IsCaseSensitive(const S: RawUTF8): boolean;
var i: PtrInt;
up: PByteArray; // better x86-64 / PIC asm generation
begin
up := @NormToUpperAnsi7Byte;
result := true;
for i := 0 to length(S)-1 do
if up[PByteArray(S)[i]]<>PByteArray(S)[i] then
if PByteArray(S)[i] in [ord('a')..ord('z'), ord('A')..ord('Z')] then
exit;
result := false;
end;
Expand Down
2 changes: 1 addition & 1 deletion SynopseCommit.inc
@@ -1 +1 @@
'1.18.4946'
'1.18.4947'

0 comments on commit dd0f631

Please sign in to comment.