From 93c65e516d1b4c4cc38f141001e61dec5bf3f821 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:29:32 -0700 Subject: Keep the permission triplet beside its one caller --- source/ui-shared.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index b2a09ff..b2b7245 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1711,6 +1711,11 @@ void cgit_print_pageheader(void) html("
\n"); } +static void print_fileperm(unsigned short mode) +{ + htmlf("%c%c%c", (mode & 4 ? 'r' : '-'), (mode & 2 ? 'w' : '-'), (mode & 1 ? 'x' : '-')); +} + void cgit_print_filemode(unsigned short mode) { if (S_ISDIR(mode)) @@ -1721,9 +1726,9 @@ void cgit_print_filemode(unsigned short mode) html("m"); else html("-"); - html_fileperm(mode >> 6); - html_fileperm(mode >> 3); - html_fileperm(mode); + print_fileperm(mode >> 6); + print_fileperm(mode >> 3); + print_fileperm(mode); } // The tag names and their stems, a stem being the name with any leading v or V -- cgit