X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=compose.c;h=e8598db6b882370068bc7e67697fe06ff753efd2;hp=31a72ecb7d696b740390d7417cb211cbc3c5c054;hb=cdd5dd2b406b2af4359f7b1e7360d0c9aba13777;hpb=74a2265af51ce89bca845adc1d68f273c9933c13 diff --git a/compose.c b/compose.c index 31a72ec..e8598db 100644 --- a/compose.c +++ b/compose.c @@ -23,10 +23,10 @@ #include "mime.h" #include "attach.h" #include "mapping.h" -#include "mailbox.h" #include "sort.h" #include "charset.h" #include "mx.h" +#include "compose.h" #ifdef MIXMASTER #include "remailer.h" @@ -220,14 +220,14 @@ static void redraw_mix_line (LIST * chain) if (t && t[0] == '0' && t[1] == '\0') t = ""; - if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth) + if (c + safe_strlen (t) + 2 >= COLS - SidebarWidth) break; addstr (NONULL (t)); if (chain->next) addstr (", "); - c += mutt_strlen (t) + 2; + c += safe_strlen (t) + 2; } } #endif /* MIXMASTER */ @@ -435,10 +435,6 @@ static unsigned long cum_attachs_size (MUTTMENU * menu) return s; } -/* prototype for use below */ -static void compose_status_line (char *buf, size_t buflen, MUTTMENU * menu, - const char *p); - /* * compose_format_str() * @@ -672,7 +668,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ else buf[0] = 0; if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) { - mutt_str_replace (&msg->env->subject, buf); + str_replace (&msg->env->subject, buf); move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth); clrtoeol (); if (msg->env->subject) @@ -697,7 +693,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ mutt_message_hook (NULL, msg, M_SEND2HOOK); break; case OP_COMPOSE_EDIT_MESSAGE: - if (Editor && (mutt_strcmp ("builtin", Editor) != 0) + if (Editor && (safe_strcmp ("builtin", Editor) != 0) && !option (OPTEDITHDRS)) { mutt_edit_file (Editor, msg->content->filename); mutt_update_encoding (msg->content); @@ -707,7 +703,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ } /* fall through */ case OP_COMPOSE_EDIT_HEADERS: - if (mutt_strcmp ("builtin", Editor) != 0 && + if (safe_strcmp ("builtin", Editor) != 0 && (op == OP_COMPOSE_EDIT_HEADERS || (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) { char *tag = NULL, *err = NULL; @@ -866,13 +862,13 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ #endif mutt_expand_path (fname, sizeof (fname)); #ifdef USE_IMAP - if (!mx_is_imap (fname)) + if (mx_get_magic (fname) != M_IMAP) #endif #ifdef USE_POP - if (!mx_is_pop (fname)) + if (mx_get_magic (fname) != M_POP) #endif #ifdef USE_NNTP - if (!mx_is_nntp (fname) && !option (OPTNEWS)) + if (mx_get_magic (fname) != M_NNTP && !option (OPTNEWS)) #endif /* check to make sure the file exists and is readable */ if (access (fname, R_OK) == -1) { @@ -1001,7 +997,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ idx[menu->current]->content->description : "", sizeof (buf)); /* header names should not be translated */ if (mutt_get_field ("Description: ", buf, sizeof (buf), 0) == 0) { - mutt_str_replace (&idx[menu->current]->content->description, buf); + str_replace (&idx[menu->current]->content->description, buf); menu->redraw = REDRAW_CURRENT; } mutt_message_hook (NULL, msg, M_SEND2HOOK); @@ -1149,7 +1145,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ if (mutt_rename_file (idx[menu->current]->content->filename, fname)) break; - mutt_str_replace (&idx[menu->current]->content->filename, fname); + str_replace (&idx[menu->current]->content->filename, fname); menu->redraw = REDRAW_CURRENT; if (idx[menu->current]->content->stamp >= st.st_mtime) @@ -1211,7 +1207,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ update_idx (menu, idx, idxlen++); idx[menu->current]->content->type = itype; - mutt_str_replace (&idx[menu->current]->content->subtype, p); + str_replace (&idx[menu->current]->content->subtype, p); idx[menu->current]->content->unlink = 1; menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;