Commit abec998f authored by Juha Manninen's avatar Juha Manninen
Browse files

GTK2: Remove trailing NULL only when GTK_REMOVE_CLIPBOARD_NULL is defined....

GTK2: Remove trailing NULL only when GTK_REMOVE_CLIPBOARD_NULL is defined. Issues #21453 and #31547.

git-svn-id: trunk@55180 -
parent 7026faf6
......@@ -3578,9 +3578,11 @@ begin
GetMem(Buffer,BufLength);
Assert(Assigned(Buffer) and (BufLength>0), 'SetData: GTK2 clipboard Buffer=Nil or empty.');
MemStream.Read(Buffer^,BufLength);
{$IFDEF GTK_REMOVE_CLIPBOARD_NULL}
// Issue #21453. gtk_selection_data_set adds the required null. Remove it here.
if PChar(Buffer+BufLength-1)^ = #0 then
dec(BufLength);
{$ENDIF}
gtk_selection_data_set(SelectionData,SelectionData^.Target,8,Buffer,BufLength);
FreeMem(Buffer);
end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment