projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
pattern.c
diff --git
a/pattern.c
b/pattern.c
index
63abd4e
..
dec82b5
100644
(file)
--- a/
pattern.c
+++ b/
pattern.c
@@
-95,6
+95,7
@@
struct pattern_flags {
#endif
{
'x', M_REFERENCE, 0, eat_regexp}, {
#endif
{
'x', M_REFERENCE, 0, eat_regexp}, {
+ 'X', M_MIMEATTACH, 0, eat_range}, {
'y', M_XLABEL, 0, eat_regexp}, {
'z', M_SIZE, 0, eat_range}, {
'=', M_DUPLICATED, 0, NULL}, {
'y', M_XLABEL, 0, eat_regexp}, {
'z', M_SIZE, 0, eat_range}, {
'=', M_DUPLICATED, 0, NULL}, {
@@
-186,13
+187,13
@@
msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
return (0);
}
return (0);
}
- fseek (msg->fp, h->offset, 0);
+ fseek
o
(msg->fp, h->offset, 0);
mutt_body_handler (h->content, &s);
}
fp = s.fpout;
fflush (fp);
mutt_body_handler (h->content, &s);
}
fp = s.fpout;
fflush (fp);
- fseek (fp, 0, 0);
+ fseek
o
(fp, 0, 0);
fstat (fileno (fp), &st);
lng = (long) st.st_size;
}
fstat (fileno (fp), &st);
lng = (long) st.st_size;
}
@@
-200,12
+201,12
@@
msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
/* raw header / body */
fp = msg->fp;
if (pat->op != M_BODY) {
/* raw header / body */
fp = msg->fp;
if (pat->op != M_BODY) {
- fseek (fp, h->offset, 0);
+ fseek
o
(fp, h->offset, 0);
lng = h->content->offset - h->offset;
}
if (pat->op != M_HEADER) {
if (pat->op == M_BODY)
lng = h->content->offset - h->offset;
}
if (pat->op != M_HEADER) {
if (pat->op == M_BODY)
- fseek (fp, h->content->offset, 0);
+ fseek
o
(fp, h->content->offset, 0);
lng += h->content->length;
}
}
lng += h->content->length;
}
}
@@
-1094,6
+1095,23
@@
mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags,
&& patmatch (pat, h->env->spam->data) == 0));
case M_DUPLICATED:
return (pat->not ^ (h->thread && h->thread->duplicate_thread));
&& patmatch (pat, h->env->spam->data) == 0));
case M_DUPLICATED:
return (pat->not ^ (h->thread && h->thread->duplicate_thread));
+
+ case M_MIMEATTACH:
+ {
+ int count;
+
+ if (h->content->parts)
+ count = mutt_count_body_parts(h, 0);
+ else {
+ mutt_parse_mime_message(ctx, h);
+ count = mutt_count_body_parts(h, 0);
+ mutt_free_body(&h->content->parts);
+ }
+
+ return (pat->not ^ (count >= pat->min && (pat->max == M_MAXRANGE ||
+ count <= pat->max)));
+ }
+
case M_UNREFERENCED:
return (pat->not ^ (h->thread && !h->thread->child));
case M_MULTIPART:
case M_UNREFERENCED:
return (pat->not ^ (h->thread && !h->thread->child));
case M_MULTIPART: