X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pattern.c;h=cd3ba3b680c570f05c4501f78ed6210f65320a47;hp=ea72544f65a08ea375d726133511560be1e82603;hb=17759b32873166573ee7bfaf298ae90434779ed7;hpb=8e075eda08c6f099ec6988e16607fb4f6a10ba92 diff --git a/pattern.c b/pattern.c index ea72544..cd3ba3b 100644 --- a/pattern.c +++ b/pattern.c @@ -10,14 +10,14 @@ #include #include -#include #include -#include +#include #include #include #include "pattern.h" #include "alias.h" +#include "crypt.h" #include "handler.h" #include "keymap.h" #include "copy.h" @@ -70,9 +70,6 @@ static struct pattern_flags { {'u', M_SUBSCRIBED_LIST, 0, NULL}, {'v', M_COLLAPSED, 0, NULL}, {'V', M_CRYPT_VERIFIED, 0, NULL}, -#ifdef USE_NNTP - {'w', M_NEWSGROUPS, 0, eat_regexp}, -#endif {'x', M_REFERENCE, 0, eat_regexp}, {'X', M_MIMEATTACH, 0, eat_range}, {'y', M_XLABEL, 0, eat_regexp}, @@ -141,7 +138,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) p_clear(&s, 1); s.fpin = msg->fp; s.flags = M_CHARCONV; - s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL); if (!s.fpout) { mutt_error(_("Could not create temporary file")); return (0); @@ -152,17 +149,6 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) if (pat->op != M_HEADER) { mutt_parse_mime_message (ctx, h); - - if ((h->security & ENCRYPT) && !crypt_valid_passphrase (h->security)) - { - mx_close_message (&msg); - if (fp) { - m_fclose(&fp); - unlink (tempfile); - } - return (0); - } - fseeko (msg->fp, h->offset, 0); mutt_body_handler (h->content, &s); } @@ -395,8 +381,8 @@ static const char *get_offset (struct tm *tm, const char *s, int sign) default: return s; } - mutt_normalize_time (tm); - return (ps + 1); + mktime(tm); + return ps + 1; } static void adjust_date_range (struct tm *min, struct tm *max) @@ -613,8 +599,8 @@ static int eat_date (pattern_t * pat, BUFFER * s, BUFFER * err) /* Since we allow two dates to be specified we'll have to adjust that. */ adjust_date_range (&min, &max); - pat->min = mutt_mktime (&min, 1); - pat->max = mutt_mktime (&max, 1); + pat->min = mktime(&min); + pat->max = mktime(&max); p_delete(&buffer.data); @@ -631,20 +617,16 @@ static const struct pattern_flags *lookup_tag (char tag) return NULL; } -static /* const */ char *find_matching_paren ( /* const */ char *s) +static const char *find_matching_paren (const char *s) { - int level = 1; - - for (; *s; s++) { - if (*s == '(') - level++; - else if (*s == ')') { - level--; - if (!level) - break; + int level = 1; + + for (; *s; s++) { + level += (*s == '(') - (*s == ')'); + if (!level) + break; } - } - return s; + return s; } pattern_t *mutt_pattern_comp(const char *s, int flags, BUFFER *err) @@ -1068,12 +1050,6 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, && valid_realname(h->env-> from->personal) && h->env->from->mailbox) )) ^ pat->not; -#ifdef USE_NNTP - case M_NEWSGROUPS: - return (pat-> - not ^ (h->env->newsgroups - && patmatch (pat, h->env->newsgroups) == 0)); -#endif } mutt_error (_("error: unknown op %d (report this error)."), pat->op); return (-1); @@ -1129,7 +1105,7 @@ void mutt_check_simple (char *s, ssize_t len, const char *simple) } } -int mutt_pattern_func (int op, char *prompt) +int mutt_pattern_func (int op, const char *prompt) { pattern_t *pat; char buf[LONG_STRING] = "", *simple, error[STRING];