[fpc-devel] move(xx, ansistring[1] versus ansistring, len)
Jonas Maebe
jonas.maebe at elis.ugent.be
Tue May 13 00:22:12 CEST 2008
On 13 May 2008, at 00:17, Martin Friebe wrote:
> move(somepchar^,pchar(ansi_str_dest)^,len);
>
> doesn't check fpc_ansistr_unique. So it works only if ansi_str_dest
> has only one reference; or both strings will be modified (because no
> copy-on-write happens).
>
> At least, that's what I get to see, if I compile with -al and look
> at the assembler.
You can call uniquestring(ansi_str_dest) before the move()
Jonas
More information about the fpc-devel
mailing list