Skip to content

Commit

Permalink
Merge branch 'obsd-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed Nov 28, 2018
2 parents 2977317 + 40d246b commit 1ed994a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions window-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ed994a

Please sign in to comment.