mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
url-mode: fix ‘n’ parameter to wcstombs()
This commit is contained in:
parent
2cc84db979
commit
d75688b0bd
1 changed files with 8 additions and 4 deletions
12
url-mode.c
12
url-mode.c
|
|
@ -87,12 +87,16 @@ urls_input(struct seat *seat, struct terminal *term, uint32_t key,
|
|||
if (match) {
|
||||
size_t chars = wcstombs(NULL, match->url, 0);
|
||||
|
||||
char url_utf8[chars + 1];
|
||||
wcstombs(url_utf8, match->url, chars);
|
||||
if (chars != (size_t)-1) {
|
||||
char url_utf8[chars + 1];
|
||||
wcstombs(url_utf8, match->url, chars + 1);
|
||||
spawn(term->reaper, term->cwd, (char *const[]){"xdg-open", url_utf8, NULL}, -1, -1, -1);
|
||||
}
|
||||
|
||||
spawn(term->reaper, term->cwd, (char *const[]){"xdg-open", url_utf8, NULL}, -1, -1, -1);
|
||||
urls_reset(term);
|
||||
} else if (is_valid) {
|
||||
}
|
||||
|
||||
else if (is_valid) {
|
||||
xassert(seq_len + 1 <= ALEN(term->url_keys));
|
||||
term->url_keys[seq_len] = wc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue