Unidiff1 files changed, 11 insertions, 18 deletions
|
diff --git a/html.c b/html.c index eb163d9..0962e71 100644 --- a/ html.c+++ b/ html.c |
|
@@ -7,5 +7,11 @@ |
7 | */ |
7 | */ |
8 | |
8 | |
9 | #include "cgit.h" |
9 | #include <unistd.h> |
| |
10 | #include <stdio.h> |
| |
11 | #include <stdlib.h> |
| |
12 | #include <stdarg.h> |
| |
13 | #include <string.h> |
| |
14 | |
| |
15 | int htmlfd = STDOUT_FILENO; |
10 | |
16 | |
11 | char *fmt(const char *format, ...) |
17 | char *fmt(const char *format, ...) |
@@ -22,6 +28,8 @@ char *fmt(const char *format, ...) |
22 | len = vsnprintf(buf[bufidx], sizeof(buf[bufidx]), format, args); |
28 | len = vsnprintf(buf[bufidx], sizeof(buf[bufidx]), format, args); |
23 | va_end(args); |
29 | va_end(args); |
24 | if (len>sizeof(buf[bufidx])) |
30 | if (len>sizeof(buf[bufidx])) { |
25 | die("[html.c] string truncated: %s", format); |
31 | fprintf(stderr, "[html.c] string truncated: %s\n", format); |
| |
32 | exit(1); |
| |
33 | } |
26 | return buf[bufidx]; |
34 | return buf[bufidx]; |
27 | } |
35 | } |
@@ -165,19 +173,4 @@ void html_fileperm(unsigned short mode) |
165 | } |
173 | } |
166 | |
174 | |
167 | void html_filemode(unsigned short mode) |
| |
168 | { |
| |
169 | if (S_ISDIR(mode)) |
| |
170 | html("d"); |
| |
171 | else if (S_ISLNK(mode)) |
| |
172 | html("l"); |
| |
173 | else if (S_ISGITLINK(mode)) |
| |
174 | html("m"); |
| |
175 | else |
| |
176 | html("-"); |
| |
177 | html_fileperm(mode >> 6); |
| |
178 | html_fileperm(mode >> 3); |
| |
179 | html_fileperm(mode); |
| |
180 | } |
| |
181 | |
| |
182 | int html_include(const char *filename) |
175 | int html_include(const char *filename) |
183 | { |
176 | { |
|