summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac60c94)
raw | patch | inline | side by side (parent: ac60c94)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 25 Nov 2006 08:01:27 +0000 (00:01 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 25 Nov 2006 08:01:27 +0000 (00:01 -0800) |
The code to abbreviate the common repository prefix was totally
borked.
Signed-off-by: Junio C Hamano <junkio@cox.net>
borked.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-shortlog.c | patch | blob | history |
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index b760b477ea40e7826982f3578ea17c49dd32492e..bdd952c2524140f35f788f5e0cd906c3b390dbe4 100644 (file)
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
memcpy(buffer, oneline, onelinelen);
buffer[onelinelen] = '\0';
- while ((p = strstr(buffer, dot3)) != NULL) {
- memcpy(p, "...", 3);
- strcpy(p + 2, p + sizeof(dot3) - 1);
+ if (dot3) {
+ int dot3len = strlen(dot3);
+ if (dot3len > 5) {
+ while ((p = strstr(buffer, dot3)) != NULL) {
+ int taillen = strlen(p) - dot3len;
+ memcpy(p, "/.../", 5);
+ memmove(p + 5, p + dot3len, taillen + 1);
+ }
+ }
}
-
onelines = item->util;
if (onelines->nr >= onelines->alloc) {
onelines->alloc = alloc_nr(onelines->nr);