simplify parse_parameters tokenizer
[apps/madmutt.git] / pager.c
diff --git a/pager.c b/pager.c
index ad57de7..9f3dc2a 100644 (file)
--- a/pager.c
+++ b/pager.c
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/mapping.h>
 
 #include "mutt.h"
 #include "enter.h"
 #include "mutt_curses.h"
 #include "keymap.h"
 #include "mutt_menu.h"
-#include "mapping.h"
 #include "sort.h"
 #include "pager.h"
 #include "attach.h"
 
 #include "mx.h"
 
-#ifdef USE_IMAP
-#include "imap_private.h"
-#endif
+#include <imap/imap_private.h>
 
-#include "mutt_crypt.h"
+#include <lib-crypt/crypt.h>
 
 #include "lib/rx.h"
 #include "lib/debug.h"
@@ -1471,7 +1469,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 
   mutt_compile_help (helpstr, sizeof (helpstr), MENU_PAGER, PagerHelp);
   if (IsHeader (extra)) {
-    strfcpy (tmphelp, helpstr, sizeof (tmphelp));
+    m_strcpy(tmphelp, sizeof(tmphelp), helpstr);
     mutt_compile_help (buffer, sizeof (buffer), MENU_PAGER,
 #ifdef USE_NNTP
                        (Context
@@ -1481,17 +1479,14 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
     snprintf (helpstr, sizeof (helpstr), "%s %s", tmphelp, buffer);
   }
   if (!InHelp) {
-    strfcpy (tmphelp, helpstr, sizeof (tmphelp));
+    m_strcpy(tmphelp, sizeof(tmphelp), helpstr);
     mutt_make_help (buffer, sizeof (buffer), _("Help"), MENU_PAGER, OP_HELP);
     snprintf (helpstr, sizeof (helpstr), "%s %s", tmphelp, buffer);
   }
 
   while (ch != -1) {
     mutt_curs_set (0);
-
-#ifdef USE_IMAP
     imap_keepalive ();
-#endif
 
     if (redraw & REDRAW_FULL) {
       SETCOLOR (MT_COLOR_NORMAL);
@@ -1889,7 +1884,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 
     case OP_SEARCH:
     case OP_SEARCH_REVERSE:
-      strfcpy (buffer, searchbuf, sizeof (buffer));
+      m_strcpy(buffer, sizeof(buffer), searchbuf);
       if (mutt_get_field ((SearchBack ? _("Reverse search: ") :
                            _("Search: ")), buffer, sizeof (buffer),
                           M_CLEAR) != 0)
@@ -1910,7 +1905,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       if (!buffer[0])
         break;
 
-      strfcpy (searchbuf, buffer, sizeof (searchbuf));
+      m_strcpy(searchbuf, sizeof(searchbuf), buffer);
 
       /* leave SearchBack alone if ch == OP_SEARCH_NEXT */
       if (ch == OP_SEARCH)
@@ -2112,8 +2107,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 
     case OP_CHECK_TRADITIONAL:
       CHECK_MODE (IsHeader (extra));
-      if (!(WithCrypto & APPLICATION_PGP))
-        break;
       if (!(extra->hdr->security & PGP_TRADITIONAL_CHECKED)) {
         ch = -1;
         rc = OP_CHECK_TRADITIONAL;
@@ -2419,11 +2412,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       break;
 
     case OP_DECRYPT_SAVE:
-      if (!WithCrypto) {
-        ch = -1;
-        break;
-      }
-      /* fall through */
     case OP_SAVE:
       if (IsAttach (extra)) {
         mutt_save_attachment_list (extra->fp, 0, extra->bdy, extra->hdr,
@@ -2435,10 +2423,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
     case OP_DECODE_SAVE:
     case OP_DECODE_COPY:
     case OP_DECRYPT_COPY:
-      if (!WithCrypto && ch == OP_DECRYPT_COPY) {
-        ch = -1;
-        break;
-      }
       CHECK_MODE (IsHeader (extra));
       if (mutt_save_message (extra->hdr,
                              (ch == OP_DECRYPT_SAVE) ||
@@ -2564,10 +2548,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 
 
     case OP_MAIL_KEY:
-      if (!(WithCrypto & APPLICATION_PGP)) {
-        ch = -1;
-        break;
-      }
       CHECK_MODE (IsHeader (extra));
       CHECK_ATTACH;
       ci_send_message (SENDKEY, NULL, NULL, extra->ctx, extra->hdr);
@@ -2580,10 +2560,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       break;
 
     case OP_EXTRACT_KEYS:
-      if (!WithCrypto) {
-        ch = -1;
-        break;
-      }
       CHECK_MODE (IsHeader (extra));
       crypt_extract_keys_from_messages (extra->hdr);
       redraw = REDRAW_FULL;