git-shortlog: fix common repository prefix abbreviation.

The code to abbreviate the common repository prefix was totally
borked.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-11-25 00:01:27 -08:00
parent ac60c94d74
commit c95044d4f3

View File

@ -130,11 +130,16 @@ static void insert_author_oneline(struct path_list *list,
memcpy(buffer, oneline, onelinelen); memcpy(buffer, oneline, onelinelen);
buffer[onelinelen] = '\0'; buffer[onelinelen] = '\0';
if (dot3) {
int dot3len = strlen(dot3);
if (dot3len > 5) {
while ((p = strstr(buffer, dot3)) != NULL) { while ((p = strstr(buffer, dot3)) != NULL) {
memcpy(p, "...", 3); int taillen = strlen(p) - dot3len;
strcpy(p + 2, p + sizeof(dot3) - 1); memcpy(p, "/.../", 5);
memmove(p + 5, p + dot3len, taillen + 1);
}
}
} }
onelines = item->util; onelines = item->util;
if (onelines->nr >= onelines->alloc) { if (onelines->nr >= onelines->alloc) {