about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui-shared.c19
-rw-r--r--ui-shared.h2
2 files changed, 9 insertions, 12 deletions
diff --git a/ui-shared.c b/ui-shared.c index 2547e43..315dedb 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -347,18 +347,11 @@ void cgit_log_link(const char *name, const char *title, const char *class,
347 html("</a>"); 347 html("</a>");
348} 348}
349 349
350void cgit_commit_link(char *name, const char *title, const char *class, 350void cgit_commit_link(const char *name, const char *title, const char *class,
351 const char *head, const char *rev, const char *path) 351 const char *head, const char *rev, const char *path)
352{ 352{
353 char *delim; 353 char *delim;
354 354
355 if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
356 name[ctx.cfg.max_msg_len] = '\0';
357 name[ctx.cfg.max_msg_len - 1] = '.';
358 name[ctx.cfg.max_msg_len - 2] = '.';
359 name[ctx.cfg.max_msg_len - 3] = '.';
360 }
361
362 delim = repolink(title, class, "commit", head, path); 355 delim = repolink(title, class, "commit", head, path);
363 if (rev && ctx.qry.head && strcmp(rev, ctx.qry.head)) { 356 if (rev && ctx.qry.head && strcmp(rev, ctx.qry.head)) {
364 html(delim); 357 html(delim);
@@ -387,9 +380,13 @@ void cgit_commit_link(char *name, const char *title, const char *class,
387 html("follow=1"); 380 html("follow=1");
388 } 381 }
389 html("'>"); 382 html("'>");
390 if (name[0] != '\0') 383 if (name[0] != '\0') {
391 html_txt(name); 384 if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
392 else 385 html_ntxt(name, ctx.cfg.max_msg_len - 3);
386 html("...");
387 } else
388 html_txt(name);
389 } else
393 html_txt("(no commit message)"); 390 html_txt("(no commit message)");
394 html("</a>"); 391 html("</a>");
395} 392}
diff --git a/ui-shared.h b/ui-shared.h index 40f6207..2cd7ac9 100644 --- a/ui-shared.h +++ b/ui-shared.h
@@ -30,7 +30,7 @@ extern void cgit_log_link(const char *name, const char *title,
30 const char *class, const char *head, const char *rev, 30 const char *class, const char *head, const char *rev,
31 const char *path, int ofs, const char *grep, 31 const char *path, int ofs, const char *grep,
32 const char *pattern, int showmsg, int follow); 32 const char *pattern, int showmsg, int follow);
33extern void cgit_commit_link(char *name, const char *title, 33extern void cgit_commit_link(const char *name, const char *title,
34 const char *class, const char *head, 34 const char *class, const char *head,
35 const char *rev, const char *path); 35 const char *rev, const char *path);
36extern void cgit_patch_link(const char *name, const char *title, 36extern void cgit_patch_link(const char *name, const char *title,