diff options
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 19 |
1 files changed, 8 insertions, 11 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 | ||
350 | void cgit_commit_link(char *name, const char *title, const char *class, | 350 | void 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 | } |