mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-28 12:30:58 +00:00
Fix #2075. Add MG_HTTP_DIRLIST_TIME_FMT, remove MG_HTTP_DIRLIST_TIME and MG_HTTP_DIRLIST_TIME_UTC
This commit is contained in:
1 parent
999a32424f
commit
57c1d787e3
3 files changed
+8
-22
No files matched your search
+3
-10
@@ -562,22 +562,15 @@ static void printdirentry(const char *name, void *userdata) {
|
||||
} else {
|
||||
mg_snprintf(sz, sizeof(sz), "%lld", (uint64_t) size);
|
||||
}
|
||||
#if defined(MG_HTTP_DIRLIST_TIME)
|
||||
#if defined(MG_HTTP_DIRLIST_TIME_FMT)
|
||||
{
|
||||
char time_str[30];
|
||||
char time_str[40];
|
||||
struct tm *time_info = localtime(&t);
|
||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||
}
|
||||
#elif defined(MG_HTTP_DIRLIST_TIME_UTC)
|
||||
{
|
||||
char time_str[30];
|
||||
struct tm *time_info = gmtime(&t);
|
||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||
}
|
||||
#else
|
||||
mg_snprintf(mod, sizeof(mod), "%ld", (unsigned long) t);
|
||||
mg_snprintf(mod, sizeof(mod), "%lu", (unsigned long) t);
|
||||
#endif
|
||||
n = (int) mg_url_encode(name, strlen(name), path, sizeof(path));
|
||||
mg_printf(d->c,
|
||||
|
||||
Reference in new issue
Block a user