From: Jaakko Heinonen Date: Tue, 12 Jun 2001 07:37:30 +0000 (+0000) Subject: launch_mutt() update X-Git-Tag: upstream/0.6.1~2^2~363 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=7c5cfcacf9b413a8b9c41dfd8a41f0c643fbee18;p=pkg%2Fabook.git launch_mutt() update --- diff --git a/abook.c b/abook.c index 57db4e4..2cbbbd1 100644 --- a/abook.c +++ b/abook.c @@ -284,7 +284,7 @@ make_mailstr(int item) ret = *database[item][EMAIL] ? mkstr("%s <%s>", name, email) : - name; + strdup(name); free(name); @@ -298,18 +298,17 @@ launch_mutt(int item) 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, "\'", NULL); diff --git a/edit.c b/edit.c index 0d14512..6436032 100644 --- a/edit.c +++ b/edit.c @@ -381,8 +381,8 @@ edit_loop(int item) case 'r': roll_emails(item); break; case '?': display_help(HELP_EDITOR); break; case 'u': edit_undo(item, RESTORE_ITEM); break; - case 'm': launch_mutt(item); break; - case 'v': launch_wwwbrowser(item); break; + case 'm': launch_mutt(item); clearok(stdscr, 1); break; + case 'v': launch_wwwbrowser(item); clearok(stdscr, 1); break; case 12 : clearok(stdscr, 1); break; /* ^L (refresh screen) */ default: return edit_field(tab, c, item) ? item : -1; } diff --git a/ui.c b/ui.c index d490fc3..c706963 100644 --- a/ui.c +++ b/ui.c @@ -465,7 +465,8 @@ get_commands() case 'Z': move_curitem(MOVE_ITEM_DOWN); break; - case 'm': launch_mutt(list_current_item()); + case 'm': launch_mutt(selected_items() ? + -1 : list_current_item()); refresh_screen(); break;