Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2019-03-18 18:02:38 +00:00
commit 1d6fe43c7b
2 changed files with 7 additions and 7 deletions

7
grid.c
View File

@ -481,11 +481,10 @@ void
grid_get_cell(struct grid *gd, u_int px, u_int py, struct grid_cell *gc) grid_get_cell(struct grid *gd, u_int px, u_int py, struct grid_cell *gc)
{ {
if (grid_check_y(gd, __func__, py) != 0 || if (grid_check_y(gd, __func__, py) != 0 ||
px >= gd->linedata[py].cellsize) { px >= gd->linedata[py].cellsize)
memcpy(gc, &grid_default_cell, sizeof *gc); memcpy(gc, &grid_default_cell, sizeof *gc);
return; else
} grid_get_cell1(&gd->linedata[py], px, gc);
return (grid_get_cell1(&gd->linedata[py], px, gc));
} }
/* Set cell at relative position. */ /* Set cell at relative position. */

View File

@ -1260,16 +1260,17 @@ window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
if (wme->mode == mode) if (wme->mode == mode)
break; break;
} }
if (wme != NULL) if (wme != NULL) {
TAILQ_REMOVE(&wp->modes, wme, entry); TAILQ_REMOVE(&wp->modes, wme, entry);
else { TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
} else {
wme = xcalloc(1, sizeof *wme); wme = xcalloc(1, sizeof *wme);
wme->wp = wp; wme->wp = wp;
wme->mode = mode; wme->mode = mode;
wme->prefix = 1; wme->prefix = 1;
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wme->screen = wme->mode->init(wme, fs, args); wme->screen = wme->mode->init(wme, fs, args);
} }
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wp->screen = wme->screen; wp->screen = wme->screen;
wp->flags |= (PANE_REDRAW|PANE_CHANGED); wp->flags |= (PANE_REDRAW|PANE_CHANGED);