aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screen_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/screen_utils.c b/screen_utils.c
index 1647fffbb..d467c1a2c 100644
--- a/screen_utils.c
+++ b/screen_utils.c
@@ -4,6 +4,7 @@
*/
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <glib.h>
#include <ncurses.h>
@@ -160,14 +161,13 @@ list_window_find(list_window_t *lw,
void *callback_data,
char *str)
{
+ int h;
int i = lw->selected+1;
+ char *label;
- while( i< lw->rows )
+ while( (label=(callback) (i,&h,callback_data)) )
{
- int h;
- char *label = (callback) (i,&h,callback_data);
-
- if( str && label && strstr(label, str) )
+ if( str && label && strcasestr(label, str) )
{
lw->selected = i;
return 0;