Crash fix in search prev/next match

Fixes #87
This commit is contained in:
Nicolas Viennot 2016-06-10 18:00:50 -04:00
parent 27169b7c07
commit b27f3bacc0

View File

@ -1054,6 +1054,11 @@ window_copy_search_up(struct window_pane *wp, const char *searchstr)
int n, wrapped, wrapflag, cis;
const char *ptr;
#ifdef TMATE
if (!searchstr)
return;
#endif
if (*searchstr == '\0')
return;
wrapflag = options_get_number(wp->window->options, "wrap-search");
@ -1120,6 +1125,11 @@ window_copy_search_down(struct window_pane *wp, const char *searchstr)
int n, wrapped, wrapflag, cis;
const char *ptr;
#ifdef TMATE
if (!searchstr)
return;
#endif
if (*searchstr == '\0')
return;
wrapflag = options_get_number(wp->window->options, "wrap-search");