Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2018-09-03 11:02:39 +01:00
commit 0c07b10b30
1 changed files with 5 additions and 3 deletions

View File

@ -1273,11 +1273,13 @@ window_copy_goto_line(struct window_pane *wp, const char *linestr)
{
struct window_copy_mode_data *data = wp->modedata;
const char *errstr;
u_int lineno;
int lineno;
lineno = strtonum(linestr, 0, screen_hsize(data->backing), &errstr);
lineno = strtonum(linestr, -1, INT_MAX, &errstr);
if (errstr != NULL)
return;
if (lineno < 0 || (u_int)lineno > screen_hsize(data->backing))
lineno = screen_hsize(data->backing);
data->oy = lineno;
window_copy_update_selection(wp, 1);
@ -2082,7 +2084,7 @@ window_copy_cursor_up(struct window_pane *wp, int scroll_only)
}
}
if (data->screen.sel != NULL || !data->rectflag) {
if (data->screen.sel == NULL || !data->rectflag) {
py = screen_hsize(data->backing) + data->cy - data->oy;
px = window_copy_find_length(wp, py);
if ((data->cx >= data->lastsx && data->cx != px) ||