From mboxrd@z Thu Jan 1 00:00:00 1970 From: plenz at cis.fu-berlin.de (Julius Plenz) Date: Tue, 30 Oct 2012 14:07:15 +0100 Subject: [PATCH 1/4] tree view: imitate proper permissions In-Reply-To: <1351602438-955878-1-git-send-email-plenz@cis.fu-berlin.de> References: <1351602438-955878-1-git-send-email-plenz@cis.fu-berlin.de> Message-ID: <1351602438-955878-2-git-send-email-plenz@cis.fu-berlin.de> Signed-off-by: Julius Plenz --- ui-shared.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index 43166af..e1f6124 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -946,17 +946,20 @@ void cgit_print_pageheader(struct cgit_context *ctx) void cgit_print_filemode(unsigned short mode) { - if (S_ISDIR(mode)) + unsigned short m = mode; + if (S_ISDIR(mode)) { html("d"); - else if (S_ISLNK(mode)) + m = 0755; + } else if (S_ISLNK(mode)) { html("l"); - else if (S_ISGITLINK(mode)) + m = 0777; + } else if (S_ISGITLINK(mode)) html("m"); else html("-"); - html_fileperm(mode >> 6); - html_fileperm(mode >> 3); - html_fileperm(mode); + html_fileperm(m >> 6); + html_fileperm(m >> 3); + html_fileperm(m); } void cgit_print_snapshot_links(const char *repo, const char *head, -- 1.7.12.3-zedat