From: Florian Forster Date: Sun, 20 Jun 2010 19:39:33 +0000 (+0200) Subject: "list graph" action: Search case-independent. X-Git-Tag: v4.0.0~220 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=7ef6ca1ae6310242938b74bd1e79c51e4373534f;p=collection4.git "list graph" action: Search case-independent. --- diff --git a/src/action_list_graphs.c b/src/action_list_graphs.c index 131a6fb..f00c6b3 100644 --- a/src/action_list_graphs.c +++ b/src/action_list_graphs.c @@ -227,17 +227,25 @@ static int list_graphs_html (const char *term) /* {{{ */ int action_list_graphs (void) /* {{{ */ { const char *format; + const char *search; + int status; gl_update (); + search = strtolower_copy (param ("search")); + format = param ("format"); if (format == NULL) format = "html"; if (strcmp ("json", format) == 0) - return (list_graphs_json (param ("search"))); + status = list_graphs_json (search); else - return (list_graphs_html (param ("search"))); + status = list_graphs_html (search); + + free (search); + + return (status); } /* }}} int action_list_graphs */ /* vim: set sw=2 sts=2 et fdm=marker : */ diff --git a/src/graph.c b/src/graph.c index da4b5ea..d314bcc 100644 --- a/src/graph.c +++ b/src/graph.c @@ -284,6 +284,8 @@ int graph_search (graph_config_t *cfg, const char *term, /* {{{ */ return (status); } + strtolower (buffer); + if (strstr (buffer, term) != NULL) { status = inst_foreach (cfg->instances, graph_search_submit, &data); diff --git a/src/graph_instance.c b/src/graph_instance.c index 45dcefb..73aeb1b 100644 --- a/src/graph_instance.c +++ b/src/graph_instance.c @@ -435,6 +435,8 @@ int inst_search (graph_config_t *cfg, graph_instance_t *inst, /* {{{ */ return (status); } + strtolower (buffer); + /* no match */ if (strstr (buffer, term) == NULL) continue;