]> granicus.if.org Git - mutt/commitdiff
Remove dead code.
authorKevin McCarthy <kevin@8t8.us>
Mon, 31 Dec 2018 22:19:44 +0000 (14:19 -0800)
committerKevin McCarthy <kevin@8t8.us>
Mon, 31 Dec 2018 23:22:01 +0000 (15:22 -0800)
Most of these have been "#if 0" out for 10-20 years.  Any utility in
keeping them around is miniscule at this point.

There are a few other "#if 0" in the code, but I've kept them for now.
Some are utility functions that are not used, but I think still may
have some documentation value.

compose.c
copy.c
crypt-gpgme.c
crypt.c
init.c
mutt.h
pager.c
pattern.c
pgp.c
recvattach.c
sendlib.c

index 6ca9c5a12b5eeac577d14da13a9499d77ad10131..a5178036ae32f9d16bf74e6c40349d71e0ef921d 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -1156,15 +1156,6 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
       case OP_COMPOSE_TOGGLE_UNLINK:
        CHECK_COUNT;
        CURATTACH->content->unlink = !CURATTACH->content->unlink;
-
-#if 0
-        /* OPTRESOLVE is otherwise ignored on this menu.
-        * Where's the bug?
-        */
-
-        if (option (OPTRESOLVE) && menu->current + 1 < menu->max)
-         menu->current++;
-# endif
        menu->redraw = REDRAW_INDEX;
         /* No send2hook since this doesn't change the message. */
        break;
diff --git a/copy.c b/copy.c
index 2b0df8a604df497fd8e0817d6a3a8309756b287c..64bdc73f2b4c465d03d4a2d249c538a9387ed347 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -289,11 +289,6 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags,
   {
     if (headers[x])
     {
-#if 0
-      if (flags & CH_DECODE)
-       rfc2047_decode (&headers[x]);
-#endif
-
       /* We couldn't do the prefixing when reading because RFC 2047
        * decoding may have concatenated lines.
        */
index cb2f248bca5aa113ac9307bf2ba3ad4515d5bd1e..3decd8f4a0fc5cc0ae7150c2b51eab0024d68182 100644 (file)
@@ -4222,28 +4222,6 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret)
           if (key->disabled)
             flags |= KEYFLAG_DISABLED;
 
-#if 0 /* DISABLED code */
-          if (!flags)
-            {
-             /* Bug in gpg.  Capabilities are not listed for secret
-                keys.  Try to deduce them from the algorithm. */
-
-             switch (key->subkeys[0].pubkey_algo)
-                {
-                case GPGME_PK_RSA:
-                  flags |= KEYFLAG_CANENCRYPT;
-                  flags |= KEYFLAG_CANSIGN;
-                  break;
-                case GPGME_PK_ELG_E:
-                  flags |= KEYFLAG_CANENCRYPT;
-                  break;
-                case GPGME_PK_DSA:
-                  flags |= KEYFLAG_CANSIGN;
-                  break;
-                }
-            }
-#endif /* DISABLED code */
-
          for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next)
             {
               k = safe_calloc (1, sizeof *k);
@@ -4814,10 +4792,6 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode)
   int r;
   int key_selected;
 
-#if 0
-  *r_application = APPLICATION_PGP|APPLICATION_SMIME;
-#endif
-
   for (p = adrlist; p ; p = p->next)
     {
       key_selected = 0;
@@ -4858,13 +4832,8 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode)
                   }
                 else if (! oppenc_mode)
                   {
-#if 0
-                    k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT,
-                                                *r_application, &forced_valid);
-#else
                     k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT,
                                                 app, &forced_valid);
-#endif
                   }
               }
             else if (r == MUTT_NO)
@@ -4896,11 +4865,7 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode)
 
             k_info = crypt_ask_for_key (buf, q->mailbox,
                                         KEYFLAG_CANENCRYPT,
-#if 0
-                                        *r_application,
-#else
                                         app,
-#endif
                                         &forced_valid);
           }
 
@@ -4915,13 +4880,6 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode)
 
         keyID = crypt_fpr_or_lkeyid (k_info);
 
-#if 0
-        if (k_info->flags & KEYFLAG_ISX509)
-          *r_application &= ~APPLICATION_PGP;
-        if (!(k_info->flags & KEYFLAG_ISX509))
-          *r_application &= ~APPLICATION_SMIME;
-#endif
-
     bypass_selection:
         keylist_size += mutt_strlen (keyID) + 4 + 1;
         safe_realloc (&keylist, keylist_size);
diff --git a/crypt.c b/crypt.c
index 0c3da3240998fb5394ffbb445f4ca713f62f8ab3..0a7d6856ea0f2efac3ca8115bc59804348b626dd 100644 (file)
--- a/crypt.c
+++ b/crypt.c
@@ -519,13 +519,9 @@ int mutt_is_application_smime (BODY *m)
     {
       len++;
       if (!ascii_strcasecmp ((t+len), "p7m"))
-#if 0
-       return SMIMEENCRYPT;
-#else
       /* Not sure if this is the correct thing to do, but
          it's required for compatibility with Outlook */
        return (SMIMESIGN|SMIMEOPAQUE);
-#endif
       else if (!ascii_strcasecmp ((t+len), "p7s"))
        return (SMIMESIGN|SMIMEOPAQUE);
     }
diff --git a/init.c b/init.c
index 1ab4ece2916db4ee1704bbb5461a0f8fc32cf1d3..a682ab23aa0492b1d2cdf477289bf895d5e4899d 100644 (file)
--- a/init.c
+++ b/init.c
@@ -3676,10 +3676,6 @@ void mutt_init (int skip_sys_rc, LIST *commands)
 
   mutt_read_histfile ();
 
-#if 0
-  set_option (OPTWEED); /* turn weeding on by default */
-#endif
-
   FREE (&err.data);
 }
 
diff --git a/mutt.h b/mutt.h
index c8a89a5426bd594aac769adeba9e5a4e849cb60d..fcd691df7413d643bc1672d3b1efcef828839e5d 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -557,9 +557,6 @@ enum
   OPTPGPCHECKGPGDECRYPTSTATUSFD,
   OPTPGPLONGIDS,
   OPTPGPAUTODEC,
-#if 0
-  OPTPGPENCRYPTSELF,
-#endif
   OPTPGPRETAINABLESIG,
   OPTPGPSELFENCRYPT,
   OPTPGPSTRICTENC,
diff --git a/pager.c b/pager.c
index e86c93b988edc7883562da6aec2a0848ff0eca93..c237ecc66f5d2a741ab7dbbe4f30b5d682a3b1f4 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -819,13 +819,8 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last,
   }
   else if (mutt_strncmp ("\033[0m", raw, 4) == 0)      /* a little hack... */
     lineInfo[n].type = MT_COLOR_NORMAL;
-#if 0
-  else if (mutt_strncmp ("[-- ", buf, 4) == 0)
-    lineInfo[n].type = MT_COLOR_ATTACHMENT;
-#else
   else if (check_attachment_marker ((char *) raw) == 0)
     lineInfo[n].type = MT_COLOR_ATTACHMENT;
-#endif
   else if (mutt_strcmp ("-- \n", buf) == 0 || mutt_strcmp ("-- \r\n", buf) == 0)
   {
     i = n + 1;
index ae04f5bde876afc7513e38c9424359c34100c053..1a1199479c2553019591835adde40b3d265b9f9b 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -276,12 +276,6 @@ static int eat_regexp (pattern_t *pat, int flags, BUFFER *s, BUFFER *err)
     return (-1);
   }
 
-#if 0
-  /* If there are no RE metacharacters, use simple search anyway */
-  if (!pat->stringmatch && !strpbrk (buf.data, "|[{.*+?^$"))
-    pat->stringmatch = 1;
-#endif
-
   if (pat->stringmatch)
   {
     pat->p.str = safe_strdup (buf.data);
diff --git a/pgp.c b/pgp.c
index 6224fc3239abd2b01bad012bded202c763e46e8d..a23a89f1d8553341d2cc59f25a2830f302ffb63c 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -1740,16 +1740,6 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
   
   b->filename = safe_strdup (pgpoutfile);
   
-#if 0
-  /* The following is intended to give a clue to some completely brain-dead 
-   * "mail environments" which are typically used by large corporations.
-   */
-
-  b->d_filename = safe_strdup ("msg.pgp");
-  b->use_disp = 1;
-
-#endif
-
   b->disposition = DISPNONE;
   b->unlink   = 1;
 
index 6f52ff01288eeda5be4f3e2e15bb207cf2b704c5..1b9aeb59bb446295c29f1ede3594426f219ecee9 100644 (file)
@@ -917,10 +917,6 @@ mutt_attach_display_loop (MUTTMENU *menu, int op, HEADER *hdr,
   }
   while (op != OP_NULL);
 
-#if 0
-  if (option (OPTWEED) != old_optweed)
-    toggle_option (OPTWEED);
-#endif
   return op;
 }
 
index 9e0cc65c429f22aeecdb10abdd9204e80822abf0..75947ca1fe16409aa4a56b85e80190c4de52f84a 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1201,10 +1201,6 @@ static void mutt_set_encoding (BODY *b, CONTENT *info)
   else if (b->type == TYPEAPPLICATION && ascii_strcasecmp (b->subtype, "pgp-keys") == 0)
     b->encoding = ENC7BIT;
   else
-#if 0
-    if (info->lobin || info->hibin || info->binary || info->linemax > 990
-          || info->cr || (/* option (OPTENCODEFROM) && */ info->from))
-#endif
   {
     /* Determine which encoding is smaller  */
     if (1.33 * (float)(info->lobin+info->hibin+info->ascii) <
@@ -1213,10 +1209,6 @@ static void mutt_set_encoding (BODY *b, CONTENT *info)
     else
       b->encoding = ENCQUOTEDPRINTABLE;
   }
-#if 0
-  else
-    b->encoding = ENC7BIT;
-#endif
 }
 
 void mutt_stamp_attachment(BODY *a)