From: Kalle Wallin Date: Fri, 17 Jun 2005 14:32:46 +0000 (+0000) Subject: Advanced search fixes X-Git-Tag: v0.12_alpha1~410 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0e1ba218ea357c2ecf9119b8a19017531536229c;p=ncmpc.git Advanced search fixes git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3362 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- diff --git a/src/screen_search.c b/src/screen_search.c index ebeb255..857d682 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;