mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 05:08:06 +02:00
merge r17318 from cpstrnew branch by florian:
* compilation fix by Inoussa OUEDRAOGO, resolves #19160 git-svn-id: trunk@19104 -
This commit is contained in:
parent
99dae8b97e
commit
9e0ad7baae
@ -108,6 +108,15 @@ implementation
|
||||
{ error recovery }
|
||||
consume(_RECKKLAMMER);
|
||||
end
|
||||
{else
|
||||
begin
|
||||
if (tordconstnode(p).value<=0) then
|
||||
begin
|
||||
Message(parser_e_invalid_string_size);
|
||||
tordconstnode(p).value:=255;
|
||||
end;
|
||||
consume(_RECKKLAMMER);
|
||||
end}
|
||||
else
|
||||
begin
|
||||
if (tordconstnode(p).value<=0) then
|
||||
|
@ -595,7 +595,7 @@ end;
|
||||
{$else VER2_4}
|
||||
Procedure fpc_AnsiStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_ANSISTR_RANGECHECK']; compilerproc;
|
||||
begin
|
||||
if (p=nil) or (index>PAnsiRec(p-FirstOff)^.Len) or (Index<1) then
|
||||
if (p=nil) or (index>PAnsiRec(p-AnsiFirstOff)^.Len) or (Index<1) then
|
||||
HandleErrorFrame(201,get_frame);
|
||||
end;
|
||||
{$endif VER2_4}
|
||||
@ -1115,7 +1115,7 @@ end;
|
||||
Procedure SetString (Out S : AnsiString; Buf : PWideChar; Len : SizeInt);
|
||||
begin
|
||||
if (Buf<>nil) and (Len>0) then
|
||||
widestringmanager.Wide2AnsiMoveProc(Buf,S,Len)
|
||||
widestringmanager.Wide2AnsiMoveProc(Buf,S,DefaultSystemCodePage,Len)
|
||||
else
|
||||
SetLength(S, Len);
|
||||
end;
|
||||
|
@ -1371,7 +1371,7 @@ Begin
|
||||
else
|
||||
begin
|
||||
{ valid code point -> convert to widestring}
|
||||
widestringmanager.Ansi2WideMoveProc(@str[0],ws,i+1);
|
||||
widestringmanager.Ansi2WideMoveProc(@str[0],DefaultSystemCodePage,ws,i+1);
|
||||
{ has to be exactly one widechar }
|
||||
if length(ws)=1 then
|
||||
begin
|
||||
|
@ -1113,9 +1113,9 @@ function DoCompareStringA(P1, P2: PWideChar; L1, L2: PtrUInt; Flags: DWORD): Ptr
|
||||
a1, a2: AnsiString;
|
||||
begin
|
||||
if L1>0 then
|
||||
widestringmanager.Wide2AnsiMoveProc(P1,a1,L1);
|
||||
widestringmanager.Wide2AnsiMoveProc(P1,a1,DefaultSystemCodePage,L1);
|
||||
if L2>0 then
|
||||
widestringmanager.Wide2AnsiMoveProc(P2,a2,L2);
|
||||
widestringmanager.Wide2AnsiMoveProc(P2,a2,DefaultSystemCodePage,L2);
|
||||
SetLastError(0);
|
||||
Result:=CompareStringA(LOCALE_USER_DEFAULT,Flags,pchar(a1),
|
||||
length(a1),pchar(a2),length(a2))-2;
|
||||
|
Loading…
Reference in New Issue
Block a user