=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.173 retrieving revision 1.174 diff -c -r1.173 -r1.174 *** src/usr.bin/tmux/window-copy.c 2017/05/07 22:27:57 1.173 --- src/usr.bin/tmux/window-copy.c 2017/05/12 10:45:38 1.174 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.173 2017/05/07 22:27:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.174 2017/05/12 10:45:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 208,215 **** data->rectflag = 0; data->scroll_exit = 0; ! data->searchtype = WINDOW_COPY_OFF; ! data->searchstr = NULL; data->searchmark = NULL; data->searchx = data->searchy = data->searcho = -1; --- 208,220 ---- data->rectflag = 0; data->scroll_exit = 0; ! if (wp->searchstr != NULL) { ! data->searchtype = WINDOW_COPY_SEARCHUP; ! data->searchstr = xstrdup(wp->searchstr); ! } else { ! data->searchtype = WINDOW_COPY_OFF; ! data->searchstr = NULL; ! } data->searchmark = NULL; data->searchx = data->searchy = data->searcho = -1; *************** *** 1134,1139 **** --- 1139,1147 ---- u_int fx, fy, endline; int wrapflag, cis, found; + free(wp->searchstr); + wp->searchstr = xstrdup(data->searchstr); + fx = data->cx; fy = screen_hsize(data->backing) - data->oy + data->cy; *************** *** 2481,2497 **** window_copy_update_cursor(wp, x, y); if (window_copy_update_selection(wp, 1)) window_copy_redraw_selection(wp, old_cy); - } - - const char * - window_copy_search_string(struct window_pane *wp) - { - struct window_copy_mode_data *data; - - if (wp->mode != &window_copy_mode) - return (""); - data = wp->modedata; - if (data->searchtype == WINDOW_COPY_OFF || data->searchstr == NULL) - return (""); - return (data->searchstr); } --- 2489,2492 ----