mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 11:49:24 +02:00
* fpc_AnsiStr_Concat: if one of the strings is empty and CP_NONE is passed, the code page
of the other string is taken, this is also like fpc_AnsiStr_Concat_multi works if length(sarr)=2 git-svn-id: trunk@47976 -
This commit is contained in:
parent
390be00327
commit
8b08079224
@ -236,12 +236,16 @@ begin
|
|||||||
S2CP:=TranslatePlaceholderCP(S2CP);
|
S2CP:=TranslatePlaceholderCP(S2CP);
|
||||||
{$ifdef FPC_HAS_CPSTRING}
|
{$ifdef FPC_HAS_CPSTRING}
|
||||||
{ if the result is rawbytestring and both strings have the same code page,
|
{ if the result is rawbytestring and both strings have the same code page,
|
||||||
keep that code page }
|
keep that code page or keep the code page if the other string is empty }
|
||||||
if (cp=CP_NONE) and
|
if cp=CP_NONE then
|
||||||
(S1CP=S2CP) then
|
begin
|
||||||
DestCP:=S1CP;
|
if (S1CP=S2CP) or (S2='') then
|
||||||
|
DestCP:=S1CP
|
||||||
|
else if S1='' then
|
||||||
|
DestCP:=S2CP;
|
||||||
|
end;
|
||||||
{$endif FPC_HAS_CPSTRING}
|
{$endif FPC_HAS_CPSTRING}
|
||||||
if (S1CP<>DestCP) or (S2CP<>DestCP) then
|
if ((S1CP<>DestCP) and (s1<>'')) or ((S2CP<>DestCP) and (s2<>'')) then
|
||||||
begin
|
begin
|
||||||
ansistr_concat_complex(DestS,S1,S2,DestCP);
|
ansistr_concat_complex(DestS,S1,S2,DestCP);
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user