From 928ca0d87eb15bfa4c150abdadadaf3b177f95bd Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 26 Nov 2006 20:26:57 +0100 Subject: [PATCH] Remove unused code Signed-off-by: Julien Danjou Signed-off-by: Pierre Habouzit --- commands.c | 10 ---------- compose.c | 8 -------- copy.c | 5 ----- imap/imap.c | 3 +-- init.c | 10 ---------- lib-crypt/pgp.c | 5 ----- lib-crypt/pgplib.c | 24 ------------------------ lib-crypt/smime.c | 4 ---- lib-mx/mh.c | 13 ------------- lib-sys/mutt_ssl.c | 3 --- lib-ui/curs_main.c | 3 --- makedoc.c | 20 -------------------- mutt.h | 3 --- nntp/newsrc.c | 10 ---------- pager.c | 5 ----- pattern.c | 6 ------ recvattach.c | 10 ---------- 17 files changed, 1 insertion(+), 141 deletions(-) diff --git a/commands.c b/commands.c index d24ba0c..4a40dc9 100644 --- a/commands.c +++ b/commands.c @@ -134,16 +134,6 @@ int mutt_display_message (HEADER * cur) mutt_wait_filter (filterpid); m_fclose(&fpfilterout); } -#if 0 - /* this is maybe just plain wrong but it makes the pager display - * what we have; i.e. for the crypto stuff we only get - * 'Could not copy message' for invalid passphrases, no PGP output - * not nothing; so just display what we have... - * - pdmef - */ - mutt_unlink (tempfile); - return 0; -#endif } if (fpfilterout != NULL && mutt_wait_filter (filterpid) != 0) diff --git a/compose.c b/compose.c index 8a8d0c5..a604ca0 100644 --- a/compose.c +++ b/compose.c @@ -1069,14 +1069,6 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ idx[menu->current]->content->unlink = !idx[menu->current]->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 d386400..5e0b7db 100644 --- a/copy.c +++ b/copy.c @@ -239,11 +239,6 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, /* Now output the headers in order */ for (x = 0; x < hdr_count; x++) { 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/imap/imap.c b/imap/imap.c index e5cf4bf..b390b45 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -178,7 +178,6 @@ int imap_read_literal (FILE * fp, IMAP_DATA * idata, long bytes, progress_t* bar return -1; } -#if 1 if (r == 1 && c != '\n') fputc ('\r', fp); @@ -188,7 +187,7 @@ int imap_read_literal (FILE * fp, IMAP_DATA * idata, long bytes, progress_t* bar } else r = 0; -#endif + fputc (c, fp); if (bar && !(pos % 1024)) mutt_progress_bar (bar, pos); diff --git a/init.c b/init.c index 842b282..03150af 100644 --- a/init.c +++ b/init.c @@ -2597,18 +2597,8 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) mutt_init_history (); if (!Muttrc) { -#if 0 - snprintf (buffer, sizeof(buffer), "%s/.madmuttrc-%s", NONULL (Homedir), - MUTT_VERSION); - if (access (buffer, F_OK) == -1) -#endif snprintf (buffer, sizeof(buffer), "%s/.madmuttrc", NONULL (Homedir)); if (access (buffer, F_OK) == -1) -#if 0 - snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc-%s", - NONULL (Homedir), MUTT_VERSION); - if (access (buffer, F_OK) == -1) -#endif snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc", NONULL (Homedir)); diff --git a/lib-crypt/pgp.c b/lib-crypt/pgp.c index e27fba7..3c3e0f7 100644 --- a/lib-crypt/pgp.c +++ b/lib-crypt/pgp.c @@ -1426,11 +1426,6 @@ int pgp_send_menu (HEADER * msg, int *redraw) crypt_pgp_void_passphrase (); /* probably need a different passphrase */ } -#if 0 - else { - msg->security &= ~SIGN; - } -#endif *redraw = REDRAW_FULL; break; diff --git a/lib-crypt/pgplib.c b/lib-crypt/pgplib.c index 9213016..5e6e821 100644 --- a/lib-crypt/pgplib.c +++ b/lib-crypt/pgplib.c @@ -34,30 +34,6 @@ const char *pgp_pkalgbytype (unsigned char type) } } - - -/* unused */ - -#if 0 - -static const char *hashalgbytype (unsigned char type) -{ - switch (type) { - case 1: - return "MD5"; - case 2: - return "SHA1"; - case 3: - return "RIPE-MD/160"; - case 4: - return "HAVAL"; - default: - return "unknown"; - } -} - -#endif - short pgp_canencrypt (unsigned char type) { switch (type) { diff --git a/lib-crypt/smime.c b/lib-crypt/smime.c index 218b442..5906f68 100644 --- a/lib-crypt/smime.c +++ b/lib-crypt/smime.c @@ -1912,10 +1912,6 @@ int smime_send_menu (HEADER * msg, int *redraw) /* probably need a different passphrase */ crypt_smime_void_passphrase (); } -#if 0 - else - msg->security &= ~SIGN; -#endif *redraw = REDRAW_FULL; break; diff --git a/lib-mx/mh.c b/lib-mx/mh.c index c3b671b..7325b0c 100644 --- a/lib-mx/mh.c +++ b/lib-mx/mh.c @@ -86,19 +86,6 @@ static short mhs_set (struct mh_sequences *mhs, int i, short f) return mhs->flags[i]; } -#if 0 - -/* unused */ - -static short mhs_unset (struct mh_sequences *mhs, int i, short f) -{ - mhs_alloc (mhs, i); - mhs->flags[i] &= ~f; - return mhs->flags[i]; -} - -#endif - static void mh_read_token (char *t, int *first, int *last) { char *p; diff --git a/lib-sys/mutt_ssl.c b/lib-sys/mutt_ssl.c index 4c7137a..5d7c551 100644 --- a/lib-sys/mutt_ssl.c +++ b/lib-sys/mutt_ssl.c @@ -333,9 +333,6 @@ static int ssl_socket_close (CONNECTION * conn) if (data) { SSL_shutdown (data->ssl); -#if 0 - X509_free (data->cert); -#endif SSL_free (data->ssl); SSL_CTX_free (data->ctx); p_delete(&conn->sockdata); diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index aa09235..780daf1 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -2315,9 +2315,6 @@ int mutt_index_menu (void) if (menu->menu == MENU_PAGER) { menu->menu = MENU_MAIN; menu->redraw = REDRAW_FULL; -#if 0 - set_option (OPTWEED); /* turn header weeding back on. */ -#endif } if (done) diff --git a/makedoc.c b/makedoc.c index 004d68b..b8a120f 100644 --- a/makedoc.c +++ b/makedoc.c @@ -557,28 +557,8 @@ static int sgml_fputc (int c) return add_s ("<"); case '>': return add_s (">"); -#if 0 - case '$': - return add_s ("$"); - case '_': - return add_s ("_"); - case '%': - return add_s ("%"); -#endif case '&': return add_s ("&"); -#if 0 - case '\\': - return add_s ("\"); - case '"': - return add_s ("""); - case '[': - return add_s ("["); - case ']': - return add_s ("]"); - case '~': - return add_s ("˜"); -#endif default: return add_c (c); } diff --git a/mutt.h b/mutt.h index 7ddd8b1..d881e2b 100644 --- a/mutt.h +++ b/mutt.h @@ -391,9 +391,6 @@ enum { OPTPGPCHECKEXIT, OPTPGPLONGIDS, OPTPGPAUTODEC, -#if 0 - OPTPGPENCRYPTSELF, -#endif OPTPGPRETAINABLESIG, OPTPGPSTRICTENC, OPTFORWDECRYPT, diff --git a/nntp/newsrc.c b/nntp/newsrc.c index 349e3e7..134040c 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -511,15 +511,6 @@ static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf, len--; } -#if 0 - if (data->entries[x].first == data->entries[x].last) - snprintf (line, len, "%d%n", data->entries[x].first, &i); - else - snprintf (line, len, "%d-%d%n", - data->entries[x].first, data->entries[x].last, &i); - len -= i; - line += i; -#else i = puti (line, data->entries[x].first); line += i; len -= i; @@ -530,7 +521,6 @@ static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf, line += i; len -= i; } -#endif } *line++ = '\n'; *line = '\0'; diff --git a/pager.c b/pager.c index 9c2d797..4bbf96c 100644 --- a/pager.c +++ b/pager.c @@ -662,13 +662,8 @@ resolve_types (char *buf, char *rawbuf, struct line_t *lineInfo, int n, int last } else if (m_strncmp("\033[0m", rawbuf, 4) == 0) /* a little hack... */ lineInfo[n].type = MT_COLOR_NORMAL; -#if 0 - else if (m_strncmp("[-- ", buf, 4) == 0) - lineInfo[n].type = MT_COLOR_ATTACHMENT; -#else else if (check_attachment_marker ((char *) rawbuf) == 0) lineInfo[n].type = MT_COLOR_ATTACHMENT; -#endif else if (m_strcmp("-- \n", buf) == 0 || m_strcmp("-- \r\n", buf) == 0) { i = n + 1; diff --git a/pattern.c b/pattern.c index 1eee48c..4db49bf 100644 --- a/pattern.c +++ b/pattern.c @@ -226,12 +226,6 @@ int eat_regexp (pattern_t * pat, 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->str = m_strdup(buf.data); p_delete(&buf.data); diff --git a/recvattach.c b/recvattach.c index 74a59fa..0403bc5 100644 --- a/recvattach.c +++ b/recvattach.c @@ -776,12 +776,6 @@ mutt_attach_display_loop (MUTTMENU * menu, int op, FILE * fp, HEADER * hdr, { ATTACHPTR **idx = *idxp; -#if 0 - int old_optweed = option (OPTWEED); - - set_option (OPTWEED); -#endif - do { switch (op) { case OP_DISPLAY_HEADERS: @@ -837,10 +831,6 @@ mutt_attach_display_loop (MUTTMENU * menu, int op, FILE * fp, HEADER * hdr, } while (op != OP_NULL); -#if 0 - if (option (OPTWEED) != old_optweed) - toggle_option (OPTWEED); -#endif return op; } -- 2.20.1