aboutsummaryrefslogtreecommitdiffstats
path: root/screen_utils.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-22 18:50:21 +0000
committerKalle Wallin <kaw@linux.se>2004-03-22 18:50:21 +0000
commit100c1e6babd68573344527f31648503f34a802cf (patch)
treecda06b299e3001a053a3c2b10f62084f9d5b3d89 /screen_utils.c
parent070f67aef44e135b2fbe14a35ca8b3f9bb8a1cc7 (diff)
downloadmpd-100c1e6babd68573344527f31648503f34a802cf.tar.gz
mpd-100c1e6babd68573344527f31648503f34a802cf.tar.xz
mpd-100c1e6babd68573344527f31648503f34a802cf.zip
Modified list_window_find() - case independet search (strcasecmp).
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@371 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'screen_utils.c')
-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;