summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/textselection.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 369346ca0..07a87e50b 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -207,15 +207,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;