diff options
-rw-r--r-- | builtin-mailinfo.c | 6 | ||||
-rw-r--r-- | t/t5100/sample.mbox | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 3577382d70..26d3e5d7af 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -175,7 +175,7 @@ static void handle_content_type(struct strbuf *line) message_type = TYPE_OTHER; if (slurp_attr(line->buf, "boundary=", boundary)) { strbuf_insert(boundary, 0, "--", 2); - if (content_top++ >= &content[MAX_BOUNDARIES]) { + if (++content_top > &content[MAX_BOUNDARIES]) { fprintf(stderr, "Too many boundaries to handle\n"); exit(1); } @@ -603,7 +603,7 @@ static void handle_filter(struct strbuf *line); static int find_boundary(void) { while (!strbuf_getline(&line, fin, '\n')) { - if (is_multipart_boundary(&line)) + if (*content_top && is_multipart_boundary(&line)) return 1; } return 0; @@ -626,7 +626,7 @@ again: /* technically won't happen as is_multipart_boundary() will fail first. But just in case.. */ - if (content_top-- < content) { + if (--content_top < content) { fprintf(stderr, "Detected mismatched boundaries, " "can't recover\n"); exit(1); diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox index d7ca79b1fc..4bf7947b41 100644 --- a/t/t5100/sample.mbox +++ b/t/t5100/sample.mbox @@ -500,3 +500,4 @@ index 3e5fe51..aabfe5c 100644 1.6.0.rc2 --=-=-=-- + |