List for cgit developers and users
 help / color / mirror / Atom feed
From: plenz at cis.fu-berlin.de (Julius Plenz)
Subject: [PATCH 1/4] tree view: imitate proper permissions
Date: Tue, 30 Oct 2012 14:07:15 +0100	[thread overview]
Message-ID: <1351602438-955878-2-git-send-email-plenz@cis.fu-berlin.de> (raw)
In-Reply-To: <1351602438-955878-1-git-send-email-plenz@cis.fu-berlin.de>


Signed-off-by: Julius Plenz <plenz at cis.fu-berlin.de>
---
 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





  reply	other threads:[~2012-10-30 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 13:07 [PATCH 0/4] some miscellaneous features plenz
2012-10-30 13:07 ` plenz [this message]
2012-10-30 13:07 ` [PATCH 2/4] Introduce "dont-display-suffix" option plenz
2012-11-01  4:03   ` mathstuf
2012-11-01  4:22   ` Jason
2012-11-01 10:52     ` plenz
2012-10-30 13:07 ` [PATCH 3/4] Make number of columns in stat overview configurable plenz
2012-10-30 13:07 ` [PATCH 4/4] Introduce a fallback encoding (eg. for blobs) plenz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351602438-955878-2-git-send-email-plenz@cis.fu-berlin.de \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).