* edited fix from Rimgaudas Laucius to fix #7868

git-svn-id: trunk@5564 -
This commit is contained in:
florian 2006-12-10 22:49:18 +00:00
parent 139408b512
commit a5c5c0956d

View File

@ -237,9 +237,12 @@ Procedure fpc_WideStr_Incr_Ref(Var S : Pointer);[Public,Alias:'FPC_WIDESTR_INCR_
If S=Nil then
exit;
{$ifdef FPC_WINLIKEWIDESTRING}
p:=s;
fpc_WideStr_SetLength(WideString(s),length(WideString(p)));
move(p^,s^,length(WideString(p))*sizeof(widechar));
if S<>nil then
begin
p:=NewWidestring(length(WideString(S)));
move(s^,p^,length(WideString(s))*sizeof(widechar));
end;
s:= p;
{$else FPC_WINLIKEWIDESTRING}
{ Let's be paranoid : Constant string ??}
If PWideRec(S-WideFirstOff)^.Ref<0 then exit;