Code

Modified list_window_find() - case independet search (strcasecmp).
authorKalle Wallin <kaw@linux.se>
Mon, 22 Mar 2004 18:50:21 +0000 (18:50 +0000)
committerKalle Wallin <kaw@linux.se>
Mon, 22 Mar 2004 18:50:21 +0000 (18:50 +0000)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@371 09075e82-0dd4-0310-85a5-a0d7c8717e4f

screen_utils.c

index 1647fffbb75d8b06facfabd523acfe5182b0ddbf..d467c1a2c5a47d4ca62b8f2264454e8faf9e3f3e 100644 (file)
@@ -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;