diff options
author | Thomas Adam <thomas@xteddy.org> | 2018-11-28 12:02:36 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2018-11-28 12:02:36 +0000 |
commit | 1ed994a6c8ef1fcdfb3eb458b9a403cce5846a38 (patch) | |
tree | 9f5092c52f7254e28973d2ddccfff9ce636c0a66 | |
parent | 2977317243eac07f819190a38f74da24bfa1b741 (diff) | |
parent | 40d246b29c8e0ee012d7836969dc8b41d6516444 (diff) | |
download | rtmux-1ed994a6c8ef1fcdfb3eb458b9a403cce5846a38.tar.gz rtmux-1ed994a6c8ef1fcdfb3eb458b9a403cce5846a38.tar.bz2 rtmux-1ed994a6c8ef1fcdfb3eb458b9a403cce5846a38.zip |
Merge branch 'obsd-master'
-rw-r--r-- | window-copy.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/window-copy.c b/window-copy.c index 516eb71e..59fb24d3 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1817,15 +1817,27 @@ window_copy_in_set(struct window_pane *wp, u_int px, u_int py, const char *set) struct window_copy_mode_data *data = wp->modedata; struct grid_cell gc; const struct utf8_data *ud; + struct utf8_data *copy; + struct utf8_data *loop; + int found = 0; grid_get_cell(data->backing->grid, px, py, &gc); - - ud = &gc.data; - if (ud->size != 1 || (gc.flags & GRID_FLAG_PADDING)) - return (0); - if (*ud->data == 0x00 || *ud->data == 0x7f) + if (gc.flags & GRID_FLAG_PADDING) return (0); - return (strchr(set, *ud->data) != NULL); + ud = &gc.data; + + copy = utf8_fromcstr(set); + for (loop = copy; loop->size != 0; loop++) { + if (loop->size != ud->size) + continue; + if (memcmp(loop->data, ud->data, loop->size) == 0) { + found = 1; + break; + } + } + free(copy); + + return (found); } static u_int |