X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pattern.c;h=1eee48c52b2857192de268e47db1e551077755e9;hp=cef1722b9092de735ff907321b3a5bda7bc72ac1;hb=5444b60629a8e4d01a78f5999615a084dd6cbd8a;hpb=711f787502b6a1a1c150b948a5ed9156c8ef9ba1 diff --git a/pattern.c b/pattern.c index cef1722..1eee48c 100644 --- a/pattern.c +++ b/pattern.c @@ -7,33 +7,16 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include #include - #include +#include +#include #include "mutt.h" #include "alias.h" #include "handler.h" -#include "mx.h" #include "keymap.h" #include "copy.h" @@ -119,19 +102,6 @@ static char LastSearchExpn[LONG_STRING] = { 0 }; /* expanded version of #define M_PDR_ERROR 0x0100 #define M_PDR_ERRORDONE (M_PDR_ERROR | M_PDR_DONE) - -int mutt_getvaluebychar (char ch, struct mapping_t *table) -{ - int i; - - for (i = 0; table[i].name; i++) { - if (ch == table[i].name[0]) - return table[i].value; - } - - return (-1); -} - /* if no uppercase letters are given, do a case-insensitive search */ int mutt_which_case (const char *s) { @@ -163,9 +133,9 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) p_clear(&s, 1); s.fpin = msg->fp; s.flags = M_CHARCONV; - mutt_mktemp (tempfile); - if ((s.fpout = safe_fopen (tempfile, "w+")) == NULL) { - mutt_perror (tempfile); + s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + if (!s.fpout) { + mutt_error(_("Could not create temporary file")); return (0); } @@ -179,7 +149,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) { mx_close_message (&msg); if (fp) { - fclose (fp); + m_fclose(&fp); unlink (tempfile); } return (0); @@ -230,7 +200,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) mx_close_message (&msg); if (option (OPTTHOROUGHSRC)) { - fclose (fp); + m_fclose(&fp); unlink (tempfile); } } @@ -1090,7 +1060,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, else { mutt_parse_mime_message(ctx, h); count = mutt_count_body_parts(h, 0); - mutt_free_body(&h->content->parts); + body_list_wipe(&h->content->parts); } return (pat->not ^ (count >= pat->min && (pat->max == M_MAXRANGE || @@ -1171,7 +1141,7 @@ void mutt_check_simple (char *s, ssize_t len, const char *simple) m_strcpy(s, len, "~U"); else { quote_simple (tmp, sizeof (tmp), s); - mutt_expand_fmt (s, len, simple, tmp); + m_file_fmt(s, len, simple, tmp); } } }