aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-10-20 16:57:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-10-20 16:57:25 +0000
commitfbc0155c55c5dede2afef2721aad4a2768ae98d6 (patch)
tree2b77076baf06056ec1097f0a02794f278cc773de /selection.c
parentMerge branch 'nordiq' (diff)
parentselection: convert \r -> \n when reading clipboard data (diff)
Merge branch 'clipboard-convert-carriage-ret-to-new-line'
Closes #752
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/selection.c b/selection.c
index b6bae978..91523d3b 100644
--- a/selection.c
+++ b/selection.c
@@ -1609,6 +1609,11 @@ fdm_receive_timeout(struct fdm *fdm, int fd, int events, void *data)
static void
fdm_receive_decoder_plain(struct clipboard_receive *ctx, char *data, size_t size)
{
+ /* \r -> \n */
+ for (size_t i = 0; i < size; i++) {
+ if (data[i] == '\r')
+ data[i] = '\n';
+ }
ctx->cb(data, size, ctx->user);
}