From 86c2948eb4d4fa75e28182472094d0812fabb29e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 9 Feb 2011 20:31:34 +0000 Subject: Fix copying text/plain to clipboard svn path=/trunk/netsurf/; revision=11636 --- gtk/selection.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/selection.c b/gtk/selection.c index 68ab88f71..3ffd0db91 100644 --- a/gtk/selection.c +++ b/gtk/selection.c @@ -50,15 +50,18 @@ bool copy_handler(const char *text, size_t length, struct box *box, void *handle, const char *whitespace_text, size_t whitespace_length) { + bool add_space = box != NULL ? box->space : false; + /* add any whitespace which precedes the text from this box */ - if (whitespace_text) { + if (whitespace_text != NULL && whitespace_length > 0) { if (!gui_add_to_clipboard(whitespace_text, whitespace_length, false)) { return false; } } + /* add the text from this box */ - if (!gui_add_to_clipboard(text, length, box->space)) + if (!gui_add_to_clipboard(text, length, add_space)) return false; return true; -- cgit v1.2.3