mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
Fix URL detection regression on lines with NUL bytes
Commit 859b4c89 (url-mode: wip: more work on regex matching,
2025-01-30) regressed URL detection in weechat. Some of the URLs
still work but others don't. This is because regexec() stops at the
first NUL, thus skipping the rest of the line. weechat seems create
NUL cells between their UI widgets.
Work around this by replacing NUL with space. This is probably correct
because selecting and copying those cells also translates to space
(not sure where in the code).
This commit is contained in:
parent
325086291b
commit
4e5ad6e013
1 changed files with 2 additions and 1 deletions
|
|
@ -368,7 +368,8 @@ regex_detected(const struct terminal *term, enum url_action action,
|
|||
vline->sz = new_size;
|
||||
}
|
||||
|
||||
vline->utf8[vline->len + j] = buf[j];
|
||||
vline->utf8[vline->len + j] =
|
||||
(buf[j] == '\0') ? ' ' : buf[j];
|
||||
vline->map[vline->len + j] = (struct coord){c, term->grid->view + r};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue