From: Max Kellermann Date: Fri, 2 Oct 2009 08:53:47 +0000 (+0200) Subject: screen_search: moved search calls to do_search() X-Git-Tag: release-0.16~215 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=72a7278e549ec96d91888327ef4ce20820dbb72e;p=ncmpc.git screen_search: moved search calls to do_search() --- diff --git a/src/screen_search.c b/src/screen_search.c index 269fedd..1710f5a 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -297,6 +297,20 @@ search_advanced_query(char *query, struct mpdclient *c) return fl; } +static struct filelist * +do_search(struct mpdclient *c, char *query) +{ + struct filelist *fl; + + fl = search_advanced_query(query, c); + if (!advanced_search_mode && browser.filelist == NULL) + return filelist_search(c, FALSE, + mode[options.search_mode].table, + query); + + return fl; +} + static void search_new(struct mpdclient *c) { @@ -321,12 +335,7 @@ search_new(struct mpdclient *c) browser.filelist = NULL; } - browser.filelist = search_advanced_query(pattern, c); - if (!advanced_search_mode && browser.filelist == NULL) - browser.filelist = filelist_search(c, FALSE, - mode[options.search_mode].table, - pattern); - + browser.filelist = do_search(c, pattern); if (browser.filelist == NULL) browser.filelist = filelist_new();