summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xamiga/clipboard.c4
-rwxr-xr-xatari/gui.c5
-rw-r--r--cocoa/selection.m4
-rw-r--r--gtk/selection.c7
-rw-r--r--riscos/textselection.c7
-rw-r--r--windows/gui.c6
6 files changed, 23 insertions, 10 deletions
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 61f60a087..177b5025c 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -246,7 +246,9 @@ bool ami_clipboard_copy(const char *text, size_t length, struct box *box,
if(text)
{
- if (!ami_add_to_clipboard(text, length, box->space)) return false;
+ bool add_space = box != NULL ? box->space : false;
+
+ if (!ami_add_to_clipboard(text, length, add_space)) return false;
}
PopChunk(iffh);
diff --git a/atari/gui.c b/atari/gui.c
index 9f1c3d1d3..c848f3ff5 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -876,14 +876,15 @@ gui_selection_traverse_handler(const char *text,
const char *space_text,
size_t space_length)
{
+ bool add_space = box != NULL ? box->space : false;
- if (space_text) {
+ if (space_text != NULL && space_length > 0) {
if (!gui_add_to_clipboard(space_text, space_length, false)) {
return false;
}
}
- if (!gui_add_to_clipboard(text, length, box->space))
+ if (!gui_add_to_clipboard(text, length, add_space))
return false;
return true;
diff --git a/cocoa/selection.m b/cocoa/selection.m
index cb0c3dca9..208776ebb 100644
--- a/cocoa/selection.m
+++ b/cocoa/selection.m
@@ -72,9 +72,11 @@ static bool cocoa_clipboard_copy_handler(const char *text, size_t length, struct
void *handle, const char *whitespace_text,
size_t whitespace_length)
{
+ bool add_space = box != NULL ? box->space : false;
+
if (whitespace_text && !gui_add_to_clipboard( whitespace_text,
whitespace_length, false )) return false;
- return gui_add_to_clipboard( text, length, box->space );
+ return gui_add_to_clipboard( text, length, add_space );
}
bool gui_commit_clipboard(void)
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;
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;
diff --git a/windows/gui.c b/windows/gui.c
index ba4dad571..03f3d67ec 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -2488,13 +2488,15 @@ gui_selection_traverse_handler(const char *text,
const char *space_text,
size_t space_length)
{
- if (space_text) {
+ bool add_space = box != NULL ? box->space : false;
+
+ if (space_text != NULL && space_length > 0) {
if (!gui_add_to_clipboard(space_text, space_length, false)) {
return false;
}
}
- if (!gui_add_to_clipboard(text, length, box->space))
+ if (!gui_add_to_clipboard(text, length, add_space))
return false;
return true;