mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-06-14 14:33:16 -04:00
selection: escape quotes in file names being DnD:ed on the command line
Closes #2363
This commit is contained in:
parent
8b047852f3
commit
ca73ec71d5
2 changed files with 12 additions and 1 deletions
|
|
@ -104,6 +104,8 @@
|
||||||
has been enabled, or foot is using 10-bit surface ([#2370][2370]).
|
has been enabled, or foot is using 10-bit surface ([#2370][2370]).
|
||||||
* Kitty text-size protocol: fix crash when text is zero-length
|
* Kitty text-size protocol: fix crash when text is zero-length
|
||||||
([#2364][2364]).
|
([#2364][2364]).
|
||||||
|
* Escape quotes in file names being DnD:ed on the command line
|
||||||
|
([#2363][2363]).
|
||||||
|
|
||||||
[2353]: https://codeberg.org/dnkl/foot/issues/2353
|
[2353]: https://codeberg.org/dnkl/foot/issues/2353
|
||||||
[2352]: https://codeberg.org/dnkl/foot/issues/2352
|
[2352]: https://codeberg.org/dnkl/foot/issues/2352
|
||||||
|
|
|
||||||
11
selection.c
11
selection.c
|
|
@ -2098,7 +2098,16 @@ decode_one_uri(struct clipboard_receive *ctx, char *uri, size_t len)
|
||||||
if (ctx->quote_paths)
|
if (ctx->quote_paths)
|
||||||
ctx->cb("'", 1, ctx->user);
|
ctx->cb("'", 1, ctx->user);
|
||||||
|
|
||||||
ctx->cb(path, strlen(path), ctx->user);
|
char *path_remaining = path;
|
||||||
|
for (char *next_quote = strchr(path_remaining, '\'');
|
||||||
|
next_quote != NULL;
|
||||||
|
path_remaining = next_quote + 1,
|
||||||
|
next_quote = strchr(path_remaining, '\''))
|
||||||
|
{
|
||||||
|
ctx->cb(path_remaining, next_quote - path_remaining, ctx->user);
|
||||||
|
ctx->cb("\\'", 2, ctx->user);
|
||||||
|
}
|
||||||
|
ctx->cb(path_remaining, strlen(path_remaining), ctx->user);
|
||||||
|
|
||||||
if (ctx->quote_paths)
|
if (ctx->quote_paths)
|
||||||
ctx->cb("'", 1, ctx->user);
|
ctx->cb("'", 1, ctx->user);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue