summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-shortlog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 3322c3a..3fc43dd 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -188,7 +188,8 @@ static void read_from_stdin(struct path_list *list)
bob = buffer + strlen(buffer);
else {
offset = 8;
- if (isspace(bob[-1]))
+ while (buffer + offset < bob &&
+ isspace(bob[-1]))
bob--;
}