about summary refs log tree commit diff
path: root/magrep.c
diff options
context:
space:
mode:
Diffstat (limited to 'magrep.c')
-rw-r--r--magrep.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/magrep.c b/magrep.c
index cd7784a..e6e53cc 100644
--- a/magrep.c
+++ b/magrep.c
@@ -84,9 +84,19 @@ match_part(int depth, struct message *msg, char *body, size_t bodylen)
 		    strcasecmp(charset, "utf-8") == 0 ||
 		    strcasecmp(charset, "utf8") == 0 ||
 		    strcasecmp(charset, "us-ascii") == 0) {
-			(void) bodylen;	 /* XXX */
-			if (match(curfile, "/", body))
+			if (pflag && !cflag && !oflag && !vflag) {
+				char *s, *p;
+				for (p = s = body; p < body+bodylen+1; p++) {
+					if (*p == '\r' || *p == '\n') {
+						*p = 0;
+						if (p-s > 1 && match(curfile, "/", s))
+							r = MIME_STOP;
+						s = p+1;
+					}
+				}
+			} else if (match(curfile, "/", body)) {
 				r = MIME_STOP;
+			}
 		} else {
 			/* XXX decode here */
 		}