X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=abook.c;h=b79fcae0b2fad72537bcb29bd681f7f0dd9bdfdd;hb=7cae3af85f57515c6b6cce8ac45a986223e30736;hp=57db4e46be931493510da3f2e981595020e126ad;hpb=8aec8ef9c11d69cc6f68847d831a63d0d3e02035;p=pkg%2Fabook.git diff --git a/abook.c b/abook.c index 57db4e4..b79fcae 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); @@ -295,23 +295,26 @@ void 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 @@ -319,6 +322,11 @@ launch_mutt(int item) #endif system(cmd); free(cmd); + + /* + * we need to make sure that curses settings are correct + */ + ui_init_curses(); } void @@ -340,6 +348,11 @@ launch_wwwbrowser(int item) system(cmd); free(cmd); + + /* + * we need to make sure that curses settings are correct + */ + ui_init_curses(); } void *