projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move mutt_get_parameter -> parameter_getval into mime.c
[apps/madmutt.git]
/
query.c
diff --git
a/query.c
b/query.c
index
5509aac
..
2a60afa
100644
(file)
--- a/
query.c
+++ b/
query.c
@@
-11,6
+11,10
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
#include <lib-lib/mem.h>
#include <lib-lib/str.h>
#include <lib-lib/macros.h>
#include <lib-lib/mem.h>
#include <lib-lib/str.h>
#include <lib-lib/macros.h>
@@
-20,15
+24,10
@@
#include <lib-ui/menu.h>
#include "mutt.h"
#include <lib-ui/menu.h>
#include "mutt.h"
+#include "alias.h"
#include "mutt_idna.h"
#include "sort.h"
#include "mutt_idna.h"
#include "sort.h"
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
typedef struct query {
address_t *addr;
char *name;
typedef struct query {
address_t *addr;
char *name;
@@
-55,7
+54,7
@@
static struct mapping_t QueryHelp[] = {
static int FirstColumn;
static int SecondColumn;
static int FirstColumn;
static int SecondColumn;
-static void query_menu (char *buf, size_t buflen, QUERY * results,
+static void query_menu (char *buf, s
s
ize_t buflen, QUERY * results,
int retbuf);
static address_t *result_to_addr (QUERY * r)
int retbuf);
static address_t *result_to_addr (QUERY * r)
@@
-78,7
+77,7
@@
static QUERY *run_query (char *s, int quiet)
QUERY *cur = NULL;
char cmd[_POSIX_PATH_MAX];
char *buf = NULL;
QUERY *cur = NULL;
char cmd[_POSIX_PATH_MAX];
char *buf = NULL;
- size_t buflen;
+ s
s
ize_t buflen;
int dummy = 0;
char msg[STRING];
char *p;
int dummy = 0;
char msg[STRING];
char *p;
@@
-89,7
+88,6
@@
static QUERY *run_query (char *s, int quiet)
mutt_expand_file_fmt (cmd, sizeof (cmd), QueryCmd, s);
if ((thepid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) {
mutt_expand_file_fmt (cmd, sizeof (cmd), QueryCmd, s);
if ((thepid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) {
- debug_print (1, ("unable to fork command: %s\n", cmd));
return 0;
}
if (!quiet)
return 0;
}
if (!quiet)
@@
-132,7
+130,6
@@
static QUERY *run_query (char *s, int quiet)
p_delete(&buf);
fclose (fp);
if (mutt_wait_filter (thepid)) {
p_delete(&buf);
fclose (fp);
if (mutt_wait_filter (thepid)) {
- debug_print (1, ("Error: %s\n", msg));
if (!quiet)
mutt_error ("%s", msg);
}
if (!quiet)
mutt_error ("%s", msg);
}
@@
-207,7
+204,7
@@
static int query_tag (MUTTMENU * menu, int n, int m)
return cur->tagged - ot;
}
return cur->tagged - ot;
}
-int mutt_query_complete (char *buf, size_t buflen)
+int mutt_query_complete (char *buf, s
s
ize_t buflen)
{
QUERY *results = NULL;
address_t *tmpa;
{
QUERY *results = NULL;
address_t *tmpa;
@@
-226,7
+223,7
@@
int mutt_query_complete (char *buf, size_t buflen)
mutt_addrlist_to_local (tmpa);
buf[0] = '\0';
rfc822_write_address (buf, buflen, tmpa, 0);
mutt_addrlist_to_local (tmpa);
buf[0] = '\0';
rfc822_write_address (buf, buflen, tmpa, 0);
- address_
delete
(&tmpa);
+ address_
list_wipe
(&tmpa);
mutt_clear_error ();
return (0);
}
mutt_clear_error ();
return (0);
}
@@
-236,7
+233,7
@@
int mutt_query_complete (char *buf, size_t buflen)
return (0);
}
return (0);
}
-void mutt_query_menu (char *buf, size_t buflen)
+void mutt_query_menu (char *buf, s
s
ize_t buflen)
{
if (!QueryCmd) {
mutt_error _("Query command not defined.");
{
if (!QueryCmd) {
mutt_error _("Query command not defined.");
@@
-254,7
+251,7
@@
void mutt_query_menu (char *buf, size_t buflen)
}
}
}
}
-static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
+static void query_menu (char *buf, s
s
ize_t buflen, QUERY * results, int retbuf)
{
MUTTMENU *menu;
HEADER *msg = NULL;
{
MUTTMENU *menu;
HEADER *msg = NULL;
@@
-311,7
+308,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
if (op == OP_QUERY) {
queryp = results;
while (queryp) {
if (op == OP_QUERY) {
queryp = results;
while (queryp) {
- address_
delete
(&queryp->addr);
+ address_
list_wipe
(&queryp->addr);
p_delete(&queryp->name);
p_delete(&queryp->other);
results = queryp->next;
p_delete(&queryp->name);
p_delete(&queryp->other);
results = queryp->next;
@@
-390,7
+387,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
address_t *a = result_to_addr (QueryTable[menu->current].data);
mutt_create_alias (NULL, a);
address_t *a = result_to_addr (QueryTable[menu->current].data);
mutt_create_alias (NULL, a);
- address_
delete
(&a);
+ address_
list_wipe
(&a);
}
break;
}
break;
@@
-426,7
+423,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
/* if we need to return the selected entries */
if (retbuf && (done == 2)) {
int tagged = 0;
/* if we need to return the selected entries */
if (retbuf && (done == 2)) {
int tagged = 0;
- size_t curpos = 0;
+ s
s
ize_t curpos = 0;
p_clear(buf, buflen);
p_clear(buf, buflen);
@@
-440,7
+437,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
tagged = 1;
rfc822_write_address (buf, buflen, tmpa, 0);
curpos = m_strlen(buf);
tagged = 1;
rfc822_write_address (buf, buflen, tmpa, 0);
curpos = m_strlen(buf);
- address_
delete
(&tmpa);
+ address_
list_wipe
(&tmpa);
}
else if (curpos + 2 < buflen) {
address_t *tmpa = result_to_addr (QueryTable[i].data);
}
else if (curpos + 2 < buflen) {
address_t *tmpa = result_to_addr (QueryTable[i].data);
@@
-450,7
+447,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
rfc822_write_address ((char *) buf + curpos + 1,
buflen - curpos - 1, tmpa, 0);
curpos = m_strlen(buf);
rfc822_write_address ((char *) buf + curpos + 1,
buflen - curpos - 1, tmpa, 0);
curpos = m_strlen(buf);
- address_
delete
(&tmpa);
+ address_
list_wipe
(&tmpa);
}
}
}
}
}
}
@@
-460,14
+457,14
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
mutt_addrlist_to_local (tmpa);
rfc822_write_address (buf, buflen, tmpa, 0);
mutt_addrlist_to_local (tmpa);
rfc822_write_address (buf, buflen, tmpa, 0);
- address_
delete
(&tmpa);
+ address_
list_wipe
(&tmpa);
}
}
queryp = results;
while (queryp) {
}
}
queryp = results;
while (queryp) {
- address_
delete
(&queryp->addr);
+ address_
list_wipe
(&queryp->addr);
p_delete(&queryp->name);
p_delete(&queryp->other);
results = queryp->next;
p_delete(&queryp->name);
p_delete(&queryp->other);
results = queryp->next;