Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep the permission triplet beside its one caller
Diffstat (limited to 'source/ui-shared.c')
| -rw-r--r-- | source/ui-shared.c | 11 |
1 file changed, 8 insertions, 3 deletions
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("<main class='content'>\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 |
