diff options
author | Junio C Hamano <junkio@cox.net> | 2006-12-10 15:55:07 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-11 14:12:29 -0800 |
commit | bca73251da5cc3e4bea71e28e0096a5cd662bbd9 (patch) | |
tree | c50a60f84638ab8e7c19ddce19d2619f16b808c9 | |
parent | 73c7f5ec05428b7da2d1b00a02a3267f1235d8e4 (diff) | |
download | git-bca73251da5cc3e4bea71e28e0096a5cd662bbd9.tar.gz |
shortlog: remove "[PATCH]" prefix from shortlog output
Originally noticed by Nicolas Pitre; the real cause was the code
was prepared to deal with [PATCH] (and [PATCH n/m whatever])
prefixes but forgot that the string can be indented while acting
as a filter.
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | builtin-shortlog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c index 7a2ddfe797..3322c3a2ee 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -195,11 +195,17 @@ static void read_from_stdin(struct path_list *list) while (fgets(buffer2, sizeof(buffer2), stdin) && buffer2[0] != '\n') ; /* chomp input */ - if (fgets(buffer2, sizeof(buffer2), stdin)) + if (fgets(buffer2, sizeof(buffer2), stdin)) { + int l2 = strlen(buffer2); + int i; + for (i = 0; i < l2; i++) + if (!isspace(buffer2[i])) + break; insert_author_oneline(list, buffer + offset, bob - buffer - offset, - buffer2, strlen(buffer2)); + buffer2 + i, l2 - i); + } } } } |