diff --git a/pretty.c b/pretty.c
index 9db75b4e4f24b28ca44d65750ec6ebb4feb99eee..5b1078beb6b27f08b196d0e35b4acfb72df643b7 100644 (file)
--- a/pretty.c
+++ b/pretty.c
if (i == eol) {
state++;
/* strip empty lines */
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;
eol++;
} else if (!prefixcmp(msg + i, "author ")) {
context->author.off = i + 7;
context->encoding.len = eol - i - 9;
}
i = eol;
context->encoding.len = eol - i - 9;
}
i = eol;
+ if (!msg[i])
+ break;
}
context->body_off = i;
context->commit_header_parsed = 1;
}
context->body_off = i;
context->commit_header_parsed = 1;