}
extern list_item *database;
-extern int items;
static void
muttq_print_item(int item)
void
launch_mutt(int item)
{
- int i;
+ /*
+ * This is _broken_
+ */
+#if 0
+ struct db_enumerator e = init_db_enumerator(ENUM_ALL);
char email[MAX_EMAIL_LEN];
char *cmd;
char *tmp = options_get_str("mutt_command");
- if( !is_valid_item(item) )
- return;
-
cmd = strconcat(tmp, " '", NULL );
- for(i=0; i < items; i++) {
- if( ! is_selected(i) && i != list_current_item() )
- continue;
- get_first_email(email, i);
- tmp = mkstr("%s \"%s\"", cmd, database[i][NAME]);
+ db_enumerate_items(e) {
+ if( e.item != item );
+ get_first_email(email, e.item);
+ tmp = mkstr("%s, \"%s\"", cmd, database[e.item][NAME]);
my_free(cmd);
- if( *database[i][EMAIL] ) {
+ if( *database[e.item][EMAIL] ) {
cmd = mkstr("%s <%s>", tmp, email);
free(tmp);
tmp = cmd;
free(tmp);
}
- tmp = mkstr("%s%c", cmd, '\'');
+ tmp = strconcat(cmd, "\'", NULL);
free(cmd);
cmd = tmp;
#ifdef DEBUG
system(cmd);
free(cmd);
+#endif
}
void
get_first_email(email, item);
- if( snprintf(header, EDITW_COLS, "%s <%s>", database[item][NAME],
- email ) == -1 || !*database[item][EMAIL] )
- if( snprintf(header, EDITW_COLS, "%s", database[item][NAME]) == -1) {
- free(header);
- return;
- }
+ if( *database[item][EMAIL] )
+ snprintf(header, EDITW_COLS, "%s <%s>",
+ database[item][NAME],
+ database[item][EMAIL]);
+ else
+ snprintf(header, EDITW_COLS, "%s", database[item][NAME]);
len = strlen(header);
x = (EDITW_COLS - len) / 2;