| 754 | } |
| 755 | |
| 756 | static int check_inbody_header(struct mailinfo *mi, const struct strbuf *line) |
| 757 | { |
| 758 | if (mi->inbody_header_accum.len && |
| 759 | (line->buf[0] == ' ' || line->buf[0] == '\t')) { |
| 760 | if (mi->use_scissors && is_scissors_line(line->buf)) { |
| 761 | /* |
| 762 | * This is a scissors line; do not consider this line |
| 763 | * as a header continuation line. |
| 764 | */ |
| 765 | flush_inbody_header_accum(mi); |
| 766 | return 0; |
| 767 | } |
| 768 | strbuf_strip_suffix(&mi->inbody_header_accum, "\n"); |
| 769 | strbuf_addbuf(&mi->inbody_header_accum, line); |
| 770 | return 1; |
| 771 | } |
| 772 | |
| 773 | flush_inbody_header_accum(mi); |
| 774 | |
| 775 | if (starts_with(line->buf, ">From") && isspace(line->buf[5])) |
| 776 | return is_format_patch_separator(line->buf + 1, line->len - 1); |
| 777 | if (starts_with(line->buf, "[PATCH]") && isspace(line->buf[7])) { |
| 778 | int i; |
| 779 | for (i = 0; i < ARRAY_SIZE(header); i++) |
| 780 | if (!strcmp("Subject", header[i])) { |
| 781 | handle_header(&mi->s_hdr_data[i], line); |
| 782 | return 1; |
| 783 | } |
| 784 | return 0; |
| 785 | } |
| 786 | if (is_inbody_header(mi, line)) { |
| 787 | strbuf_addbuf(&mi->inbody_header_accum, line); |
| 788 | return 1; |
| 789 | } |
| 790 | return 0; |
| 791 | } |
| 792 | |
| 793 | static int handle_commit_msg(struct mailinfo *mi, struct strbuf *line) |
| 794 | { |
no test coverage detected