X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=commands.c;h=a14b47177ca340b7152b4044e40e482894bad732;hp=9b00f9edf3b6e50c5df68c9d87adc9dff1516586;hb=85832555b8d510499b13bc454e458382d36e195d;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/commands.c b/commands.c index 9b00f9e..a14b471 100644 --- a/commands.c +++ b/commands.c @@ -13,14 +13,17 @@ #endif #include +#include +#include +#include + +#include #include "mutt.h" #include "enter.h" #include "recvattach.h" -#include "ascii.h" #include "mutt_curses.h" #include "mutt_menu.h" -#include "mime.h" #include "sort.h" #include "copy.h" #include "mx.h" @@ -40,9 +43,6 @@ #include "buffy.h" #endif -#include "lib/mem.h" -#include "lib/intl.h" -#include "lib/str.h" #include "lib/debug.h" #include @@ -54,8 +54,6 @@ #include #include -extern char *ReleaseDate; - /* The folder the user last saved to. Used by ci_save_message() */ static char LastSaveFolder[_POSIX_PATH_MAX] = ""; @@ -97,7 +95,7 @@ int mutt_display_message (HEADER * cur) } } - if (!Pager || str_cmp (Pager, "builtin") == 0) + if (!Pager || m_strcmp(Pager, "builtin") == 0) builtin = 1; else { mutt_make_string (buf, sizeof (buf), NONULL (PagerFmt), Context, cur); @@ -215,7 +213,7 @@ int mutt_display_message (HEADER * cur) } /* Invoke the builtin pager */ - memset (&info, 0, sizeof (pager_t)); + p_clear(&info, 1); info.hdr = cur; info.ctx = Context; rc = mutt_pager (NULL, tempfile, M_PAGER_MESSAGE, &info); @@ -246,14 +244,14 @@ void ci_bounce_message (HEADER * h, int *redraw) { char prompt[SHORT_STRING]; char buf[HUGE_STRING] = { 0 }; - ADDRESS *adr = NULL; + address_t *adr = NULL; char *err = NULL; int rc; if (h) - strfcpy (prompt, _("Bounce message to: "), sizeof (prompt)); + m_strcpy(prompt, sizeof(prompt), _("Bounce message to: ")); else - strfcpy (prompt, _("Bounce tagged messages to: "), sizeof (prompt)); + m_strcpy(prompt, sizeof(prompt), _("Bounce tagged messages to: ")); rc = mutt_get_field (prompt, buf, sizeof (buf), M_ALIAS); @@ -276,7 +274,7 @@ void ci_bounce_message (HEADER * h, int *redraw) if (mutt_addrlist_to_idna (adr, &err) < 0) { mutt_error (_("Bad IDN: '%s'"), err); p_delete(&err); - rfc822_free_address (&adr); + address_delete (&adr); return; } @@ -289,16 +287,15 @@ void ci_bounce_message (HEADER * h, int *redraw) buf); if (mutt_strwidth (prompt) > COLS - extra_space) { - mutt_format_string (prompt, sizeof (prompt), - 0, COLS - extra_space, 0, 0, - prompt, sizeof (prompt), 0); - str_cat (prompt, sizeof (prompt), "...?"); + mutt_format_string(prompt, sizeof(prompt), 0, COLS - extra_space, 0, 0, + prompt, sizeof(prompt), 0); + m_strcat(prompt, sizeof(prompt), "...?"); + } else { + m_strcat(prompt, sizeof(prompt), "?"); } - else - str_cat (prompt, sizeof (prompt), "?"); if (query_quadoption (OPT_BOUNCE, prompt) != M_YES) { - rfc822_free_address (&adr); + address_delete (&adr); CLEARLINE (LINES - 1); mutt_message (h ? _("Message not bounced.") : _("Messages not bounced.")); return; @@ -307,7 +304,7 @@ void ci_bounce_message (HEADER * h, int *redraw) CLEARLINE (LINES - 1); rc = mutt_bounce_message (NULL, h, adr); - rfc822_free_address (&adr); + address_delete (&adr); /* If no error, or background, display message. */ if ((rc == 0) || (rc == S_BKG)) mutt_message (h ? _("Message bounced.") : _("Messages bounced.")); @@ -557,7 +554,7 @@ void mutt_shell_escape (void) buf[0] = 0; if (mutt_get_field (_("Shell command: "), buf, sizeof (buf), M_CMD) == 0) { if (!buf[0] && Shell) - strfcpy (buf, Shell, sizeof (buf)); + m_strcpy(buf, sizeof(buf), Shell); if (buf[0]) { CLEARLINE (LINES - 1); mutt_endwin (NULL); @@ -581,7 +578,7 @@ void mutt_enter_command (void) return; err.data = errbuf; err.dsize = sizeof (errbuf); - memset (&token, 0, sizeof (token)); + p_clear(&token, 1); r = mutt_parse_rc_line (buffer, &token, &err); p_delete(&token.data); if (errbuf[0]) { @@ -599,7 +596,7 @@ void mutt_display_address (ENVELOPE * env) { const char *pfx = NULL; char buf[SHORT_STRING]; - ADDRESS *adr = NULL; + address_t *adr = NULL; adr = mutt_get_address(env, &pfx); @@ -751,10 +748,10 @@ int mutt_save_message (HEADER * h, int delete, /* This is an undocumented feature of ELM pointed out to me by Felix von * Leitner */ - if (str_cmp (buf, ".") == 0) - strfcpy (buf, LastSaveFolder, sizeof (buf)); + if (m_strcmp(buf, ".") == 0) + m_strcpy(buf, sizeof(buf), LastSaveFolder); else - strfcpy (LastSaveFolder, buf, sizeof (LastSaveFolder)); + m_strcpy(LastSaveFolder, sizeof(LastSaveFolder), buf); mutt_expand_path (buf, sizeof (buf)); @@ -852,17 +849,17 @@ void mutt_edit_content_type (HEADER * h, BODY * b, FILE * fp) short type_changed = 0; cp = mutt_get_parameter ("charset", b->parameter); - strfcpy (charset, NONULL (cp), sizeof (charset)); + m_strcpy(charset, sizeof(charset), NONULL(cp)); snprintf (buf, sizeof (buf), "%s/%s", TYPE (b), b->subtype); - strfcpy (obuf, buf, sizeof (obuf)); + m_strcpy(obuf, sizeof(obuf), buf); if (b->parameter) { size_t l; for (p = b->parameter; p; p = p->next) { - l = str_len (buf); + l = m_strlen(buf); - rfc822_cat (tmp, sizeof (tmp), p->value, MimeSpecials); + rfc822_strcpy(tmp, sizeof(tmp), p->value, MimeSpecials); snprintf (buf + l, sizeof (buf) - l, "; %s=%s", p->attribute, tmp); } }