/*
* $Id$
*
- * by JH <jheinonen@bigfoot.com>
+ * by JH <jheinonen@users.sourceforge.net>
*
* Copyright (C) Jaakko Heinonen
*/
ret = *database[item][EMAIL] ?
mkstr("%s <%s>", name, email) :
- name;
+ strdup(name);
free(name);
launch_mutt(int item)
{
char *cmd = NULL, *mailstr = NULL;
+ char *mutt_command = options_get_str("mutt_command");
+
+ if(mutt_command == NULL || !*mutt_command)
+ return;
if( is_valid_item(item) )
mailstr = make_mailstr(item);
-
- /*
- * need to implement for multiple addresses
- */
- /*
- } else {
+ else {
struct db_enumerator e = init_db_enumerator(ENUM_SELECTED);
+ char *tmp = NULL;
db_enumerate_items(e) {
tmp = mailstr;
- mailstr = strconcat(tmp, make_mailstr(e.item);
-
- }*/
+ mailstr = tmp ?
+ strconcat(tmp, ",", make_mailstr(e.item), NULL):
+ strconcat(make_mailstr(e.item), NULL);
+ free(tmp);
+ }
+ }
- cmd = strconcat(options_get_str("mutt_command"), " \'", mailstr,
+ cmd = strconcat(mutt_command, " \'", mailstr,
"\'", NULL);
free(mailstr);
#ifdef DEBUG
#endif
system(cmd);
free(cmd);
+
+ /*
+ * we need to make sure that curses settings are correct
+ */
+ ui_init_curses();
}
void
system(cmd);
free(cmd);
+
+ /*
+ * we need to make sure that curses settings are correct
+ */
+ ui_init_curses();
}
void *
strlower(srcformat);
strlower(dstformat);
+#ifndef DEBUG
if( !strcmp(srcformat, dstformat) ) {
printf( "input and output formats are the same\n"
"exiting...\n");
exit(1);
}
+#endif
set_filenames();
init_options();