trailer: forbid leading whitespace in trailers

Currently, interpret-trailers allows leading whitespace in trailer
lines. This leads to false positives, especially for quoted lines or
bullet lists.

Forbid leading whitespace in trailers.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Tan
2016-10-21 10:55:02 -07:00
committed by Junio C Hamano
parent 146245063e
commit c463a6b280
3 changed files with 17 additions and 2 deletions

View File

@ -775,7 +775,7 @@ static int find_trailer_start(struct strbuf **lines, int count)
}
separator_pos = find_separator(lines[start]->buf);
if (separator_pos >= 1) {
if (separator_pos >= 1 && !isspace(lines[start]->buf[0])) {
struct list_head *pos;
trailer_lines++;