=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.230 retrieving revision 1.231 diff -c -r1.230 -r1.231 *** src/usr.bin/tmux/window-copy.c 2019/08/01 14:31:39 1.230 --- src/usr.bin/tmux/window-copy.c 2019/08/14 09:58:31 1.231 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.230 2019/08/01 14:31:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.231 2019/08/14 09:58:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1638,1646 **** const char *argument = cs->args->argv[1]; if (*argument != '\0') { - data->searchtype = WINDOW_COPY_SEARCHUP; free(data->searchstr); data->searchstr = xstrdup(argument); for (; np != 0; np--) window_copy_search_up(wme); } --- 1638,1648 ---- const char *argument = cs->args->argv[1]; if (*argument != '\0') { free(data->searchstr); data->searchstr = xstrdup(argument); + } + if (data->searchstr != NULL) { + data->searchtype = WINDOW_COPY_SEARCHUP; for (; np != 0; np--) window_copy_search_up(wme); } *************** *** 1656,1664 **** const char *argument = cs->args->argv[1]; if (*argument != '\0') { - data->searchtype = WINDOW_COPY_SEARCHDOWN; free(data->searchstr); data->searchstr = xstrdup(argument); for (; np != 0; np--) window_copy_search_down(wme); } --- 1658,1668 ---- const char *argument = cs->args->argv[1]; if (*argument != '\0') { free(data->searchstr); data->searchstr = xstrdup(argument); + } + if (data->searchstr != NULL) { + data->searchtype = WINDOW_COPY_SEARCHDOWN; for (; np != 0; np--) window_copy_search_down(wme); } *************** *** 2139,2148 **** return (0); } ! /* ! * Search in for text searchstr. If direction is 0 then search up, otherwise ! * down. ! */ static int window_copy_search(struct window_mode_entry *wme, int direction) { --- 2143,2149 ---- return (0); } ! /* Search in text. If direction is 0 then search up, otherwise down. */ static int window_copy_search(struct window_mode_entry *wme, int direction) {