From: Kevin McCarthy Date: Mon, 31 Dec 2018 22:19:44 +0000 (-0800) Subject: Remove dead code. X-Git-Tag: mutt-1-12-rel~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3aa8d8a0e7a38df94ab61d7dbf303dda56248cae;p=mutt Remove dead code. 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. --- diff --git a/compose.c b/compose.c index 6ca9c5a1..a5178036 100644 --- 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 2b0df8a6..64bdc73f 100644 --- 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. */ diff --git a/crypt-gpgme.c b/crypt-gpgme.c index cb2f248b..3decd8f4 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -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 0c3da324..0a7d6856 100644 --- 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 1ab4ece2..a682ab23 100644 --- 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 c8a89a54..fcd691df 100644 --- 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 e86c93b9..c237ecc6 100644 --- 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; diff --git a/pattern.c b/pattern.c index ae04f5bd..1a119947 100644 --- 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 6224fc32..a23a89f1 100644 --- 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; diff --git a/recvattach.c b/recvattach.c index 6f52ff01..1b9aeb59 100644 --- a/recvattach.c +++ b/recvattach.c @@ -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; } diff --git a/sendlib.c b/sendlib.c index 9e0cc65c..75947ca1 100644 --- 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)