-rw-r--r-- | ui-shared.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c index 2596023..aa65988 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -560,17 +560,32 @@ void cgit_print_pageheader(struct cgit_context *ctx) | |||
560 | 560 | ||
561 | void cgit_print_filemode(unsigned short mode) | 561 | void cgit_print_filemode(unsigned short mode) |
562 | { | 562 | { |
563 | if (S_ISDIR(mode)) | 563 | if (S_ISDIR(mode)) |
564 | html("d"); | 564 | html("d"); |
565 | else if (S_ISLNK(mode)) | 565 | else if (S_ISLNK(mode)) |
566 | html("l"); | 566 | html("l"); |
567 | else if (S_ISGITLINK(mode)) | 567 | else if (S_ISGITLINK(mode)) |
568 | html("m"); | 568 | html("m"); |
569 | else | 569 | else |
570 | html("-"); | 570 | html("-"); |
571 | html_fileperm(mode >> 6); | 571 | html_fileperm(mode >> 6); |
572 | html_fileperm(mode >> 3); | 572 | html_fileperm(mode >> 3); |
573 | html_fileperm(mode); | 573 | html_fileperm(mode); |
574 | } | 574 | } |
575 | 575 | ||
576 | /* vim:set sw=8: */ | 576 | void cgit_print_snapshot_links(const char *repo, const char *head, |
577 | const char *hex, int snapshots) | ||
578 | { | ||
579 | const struct cgit_snapshot_format* f; | ||
580 | char *filename; | ||
581 | |||
582 | for (f = cgit_snapshot_formats; f->suffix; f++) { | ||
583 | if (!(snapshots & f->bit)) | ||
584 | continue; | ||
585 | filename = fmt("%s-%s%s", cgit_repobasename(repo), hex, | ||
586 | f->suffix); | ||
587 | cgit_snapshot_link(filename, NULL, NULL, (char *)head, | ||
588 | (char *)hex, filename); | ||
589 | html("<br/>"); | ||
590 | } | ||
591 | } | ||