X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pretty.c;h=5b1078beb6b27f08b196d0e35b4acfb72df643b7;hb=7ee906694c28ab7281492d5114d2afabd964bd41;hp=9db75b4e4f24b28ca44d65750ec6ebb4feb99eee;hpb=9b433e44964202befd175f1f28687067b8bd058f;p=git.git diff --git a/pretty.c b/pretty.c index 9db75b4e4..5b1078beb 100644 --- a/pretty.c +++ b/pretty.c @@ -412,7 +412,7 @@ static void parse_commit_header(struct format_commit_context *context) if (i == eol) { state++; /* strip empty lines */ - while (msg[eol + 1] == '\n') + while (msg[eol] == '\n' && msg[eol + 1] == '\n') eol++; } else if (!prefixcmp(msg + i, "author ")) { context->author.off = i + 7; @@ -425,6 +425,8 @@ static void parse_commit_header(struct format_commit_context *context) context->encoding.len = eol - i - 9; } i = eol; + if (!msg[i]) + break; } context->body_off = i; context->commit_header_parsed = 1;