summaryrefslogtreecommitdiffstats
path: root/query.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-06-08 09:17:25 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-06-08 09:17:25 +0000
commit57c930bf79e06c485142efeb62ffb1e9d8fe3d3b (patch)
treec3c1e876454aead42f16023f45b23a73961a03d6 /query.c
parent1a5381e07e97fe482c2b3a7c75f99938f0b105d4 (diff)
Mutt 0.92.9i.mutt-0-92-9i
Diffstat (limited to 'query.c')
-rw-r--r--query.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/query.c b/query.c
index f9d75e97..b8cfe09b 100644
--- a/query.c
+++ b/query.c
@@ -142,7 +142,7 @@ static QUERY *run_query (char *s, int quiet)
return first;
}
-int query_search (MUTTMENU *m, regex_t *re, int n)
+static int query_search (MUTTMENU *m, regex_t *re, int n)
{
ENTRY *table = (ENTRY *) m->data;
@@ -152,7 +152,7 @@ int query_search (MUTTMENU *m, regex_t *re, int n)
/* This is the callback routine from mutt_menuLoop() which is used to generate
* a menu entry for the requested item number.
*/
-void query_entry (char *s, size_t slen, MUTTMENU *m, int num)
+static void query_entry (char *s, size_t slen, MUTTMENU *m, int num)
{
ENTRY *table = (ENTRY *) m->data;
char buf[SHORT_STRING] = "";
@@ -177,7 +177,7 @@ void query_entry (char *s, size_t slen, MUTTMENU *m, int num)
table[num].data->other);
}
-int query_tag (MUTTMENU *menu, int n)
+static int query_tag (MUTTMENU *menu, int n)
{
return (((ENTRY *) menu->data)[n].tagged = !((ENTRY *) menu->data)[n].tagged);
}
@@ -186,6 +186,12 @@ int mutt_query_complete (char *buf, size_t buflen)
{
QUERY *results = NULL;
+ if (!QueryCmd)
+ {
+ mutt_error ("Query command not defined.");
+ return 0;
+ }
+
results = run_query (buf, 1);
if (results)
{
@@ -205,6 +211,12 @@ int mutt_query_complete (char *buf, size_t buflen)
void mutt_query_menu (char *buf, size_t buflen)
{
+ if (!QueryCmd)
+ {
+ mutt_error ("Query command not defined.");
+ return;
+ }
+
if (buf == NULL)
{
char buffer[STRING] = "";
@@ -238,11 +250,6 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf)
if (results == NULL)
{
- if (!QueryCmd)
- {
- mutt_error ("Query command not defined.");
- return;
- }
/* Prompt for Query */
if (mutt_get_field ("Query: ", buf, buflen, 0) == 0 && buf[0])
{