Skip to content

Commit bca7325

Browse files
author
Junio C Hamano
committed
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>
1 parent 73c7f5e commit bca7325

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

builtin-shortlog.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,17 @@ static void read_from_stdin(struct path_list *list)
195195
while (fgets(buffer2, sizeof(buffer2), stdin) &&
196196
buffer2[0] != '\n')
197197
; /* chomp input */
198-
if (fgets(buffer2, sizeof(buffer2), stdin))
198+
if (fgets(buffer2, sizeof(buffer2), stdin)) {
199+
int l2 = strlen(buffer2);
200+
int i;
201+
for (i = 0; i < l2; i++)
202+
if (!isspace(buffer2[i]))
203+
break;
199204
insert_author_oneline(list,
200205
buffer + offset,
201206
bob - buffer - offset,
202-
buffer2, strlen(buffer2));
207+
buffer2 + i, l2 - i);
208+
}
203209
}
204210
}
205211
}

0 commit comments

Comments
 (0)