=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -r1.231 -r1.232 --- src/usr.bin/tmux/window-copy.c 2019/08/14 09:58:31 1.231 +++ src/usr.bin/tmux/window-copy.c 2019/08/14 09:59:43 1.232 @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.231 2019/08/14 09:58:31 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.232 2019/08/14 09:59:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1638,11 +1638,9 @@ const char *argument = cs->args->argv[1]; if (*argument != '\0') { + data->searchtype = WINDOW_COPY_SEARCHUP; 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); } @@ -1658,11 +1656,9 @@ const char *argument = cs->args->argv[1]; if (*argument != '\0') { + data->searchtype = WINDOW_COPY_SEARCHDOWN; 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); } @@ -2143,7 +2139,10 @@ return (0); } -/* Search in text. If direction is 0 then search up, otherwise down. */ +/* + * 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) {