This commit is contained in:
cpq committed 2021-04-29 09:50:33 +01:00
1 parent 758572872d
commit 7851930ac3
5 files changed
+28 -4

No files matched your search

+2 -1
View File
@@ -648,6 +648,7 @@ static void printdirentry(struct mg_connection *c, const char *name,
char size[64], mod[64], path[MG_PATH_MAX];
int is_dir = S_ISDIR(stp->st_mode), n = 0;
const char *slash = is_dir ? "/" : "";
struct tm t;
if (is_dir) {
snprintf(size, sizeof(size), "%s", "[DIR]");
@@ -662,7 +663,7 @@ static void printdirentry(struct mg_connection *c, const char *name,
snprintf(size, sizeof(size), "%.1fG", (double) stp->st_size / 1073741824);
}
}
strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&stp->st_mtime));
strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime_r(&stp->st_mtime, &t));
n = mg_url_encode(name, strlen(name), path, sizeof(path));
mg_printf(c,
" <tr><td><a href=\"%.*s%s\">%s%s</a></td>"