From 579f3cf8e397bb427098f1bf2bdf3cd2cd19152e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 21 Jan 2021 15:18:33 +0100 Subject: [PATCH] =?UTF-8?q?selection:=20unbreak=20text/uri-list=20decoding?= =?UTF-8?q?:=20we=E2=80=99re=20not=20using=20\r,=20not=20\n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before passing the pasted text to the decoder, we now replace \r\n, and \n, with \r. The URI decoder was looking for a \n, which meant we failed to split up the list and instead pasted a single “multi-line” URI. --- selection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selection.c b/selection.c index 4d6bddf4..fa8ef7a5 100644 --- a/selection.c +++ b/selection.c @@ -1254,7 +1254,7 @@ fdm_receive_decoder_uri(struct clipboard_receive *ctx, char *data, size_t size) char *start = ctx->buf.data; char *end = NULL; - while ((end = memchr(start, '\n', ctx->buf.idx - (start - ctx->buf.data))) != NULL) { + while ((end = memchr(start, '\r', ctx->buf.idx - (start - ctx->buf.data))) != NULL) { decode_one_uri(ctx, start, end - start); start = end + 1; }