aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2005-06-17 14:32:46 +0000
committerKalle Wallin <kaw@linux.se>2005-06-17 14:32:46 +0000
commit0e1ba218ea357c2ecf9119b8a19017531536229c (patch)
tree39ebe82618670a5418dfe9fe9c9f355df831ab91 /src
parent330597ae6f18695bba58fbc64b27e21e69e33e68 (diff)
downloadmpd-0e1ba218ea357c2ecf9119b8a19017531536229c.tar.gz
mpd-0e1ba218ea357c2ecf9119b8a19017531536229c.tar.xz
mpd-0e1ba218ea357c2ecf9119b8a19017531536229c.zip
Advanced search fixes
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3362 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/screen_search.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/screen_search.c b/src/screen_search.c
index ebeb25592..857d682aa 100644
--- a/src/screen_search.c
+++ b/src/screen_search.c
@@ -223,7 +223,7 @@ search_advanced_query(char *query, mpdclient_t *c)
i=0;
j=0;
- while( strv[i] && i<9 )
+ while( strv[i] && strlen(strv[i])>0 && i<9 )
{
D("strv[%d] = \"%s\"\n", i, strv[i]);
@@ -243,11 +243,13 @@ search_advanced_query(char *query, mpdclient_t *c)
}
i++;
}
- else if( strv[i+1] == NULL )
+ else if( strv[i+1] == NULL || strlen(strv[i+1])==0 )
{
D("No argument for search tag %s\n", strv[i]);
screen_status_printf(_("No argument for search tag %s"), strv[i]);
i++;
+ // j--;
+ //table[j] = -1;
}
else
{
@@ -264,7 +266,7 @@ search_advanced_query(char *query, mpdclient_t *c)
g_strfreev(strv);
- if( advanced_search_mode )
+ if( advanced_search_mode && j>0 )
{
/*-----------------------------------------------------------------------
* NOTE (again): This code exists to test a new search ui,
@@ -298,7 +300,7 @@ search_advanced_query(char *query, mpdclient_t *c)
filelist->length++;
}
- if( mpdclient_finish_command(c) )
+ if( mpdclient_finish_command(c) && filelist )
filelist = mpdclient_filelist_free(filelist);
filelist->updated = TRUE;