diff --git a/src/screen_search.c b/src/screen_search.c
index 42253d0ad8c2d4c423a5c75c453929569119b9bc..90e075fe96c95d2da9469a74c5bb5ac421d0b997 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
/* ncmpc (Ncurses MPD Client)
- * (c) 2004-2010 The Music Player Daemon Project
+ * (c) 2004-2017 The Music Player Daemon Project
* Project homepage: http://musicpd.org
*
* This program is free software; you can redistribute it and/or modify
static int
search_get_tag_id(const char *name)
{
- unsigned i;
-
if (g_ascii_strcasecmp(name, "file") == 0 ||
strcasecmp(name, _("file")) == 0)
return SEARCH_URI;
- for (i = 0; i < MPD_TAG_COUNT; ++i)
+ for (unsigned i = 0; i < MPD_TAG_COUNT; ++i)
if (search_tag[i].name != NULL &&
(strcasecmp(search_tag[i].name, name) == 0 ||
strcasecmp(search_tag[i].localname, name) == 0))
static struct filelist *
search_advanced_query(struct mpd_connection *connection, char *query)
{
- int i,j;
- char **strv;
- int table[10];
- char *arg[10];
- struct filelist *fl = NULL;
-
advanced_search_mode = FALSE;
if (strchr(query, ':') == NULL)
return NULL;
- strv = g_strsplit_set(query, ": ", 0);
+ char **strv = g_strsplit_set(query, ": ", 0);
+ int table[10];
memset(table, 0, 10*sizeof(int));
+
+ char *arg[10];
memset(arg, 0, 10*sizeof(char *));
- i=0;
- j=0;
+ int i = 0, j = 0;
while (strv[i] && strlen(strv[i]) > 0 && i < 9) {
int id = search_get_tag_id(strv[i]);
if (id == -1) {
}
mpd_search_commit(connection);
- fl = filelist_new_recv(connection);
+ struct filelist *fl = filelist_new_recv(connection);
if (!mpd_response_finish(connection)) {
filelist_free(fl);
fl = NULL;
screen_search_init(WINDOW *w, int cols, int rows)
{
browser.lw = list_window_init(w, cols, rows);
+ if (options.search_format != NULL) {
+ browser.song_format = options.search_format;
+ } else {
+ browser.song_format = options.list_format;
+ }
list_window_set_length(browser.lw, G_N_ELEMENTS(help_text));
}
options.search_mode = 0;
screen_status_printf(_("Search mode: %s"),
_(mode[options.search_mode].label));
- /* continue and update... */
+ /* fall through */
case CMD_SCREEN_UPDATE:
screen_search_reload(c);
search_repaint();