diff --git a/mongoose.c b/mongoose.c index e01ba0a9..eab88d93 100644 --- a/mongoose.c +++ b/mongoose.c @@ -7731,7 +7731,7 @@ static void mg_print_dir_entry(struct mg_connection *nc, const char *file_name, href = mg_url_encode(mg_mk_str(file_name)); mg_printf_http_chunk(nc, "%s%s" - "%s%s\n", + "%s%s", href.p, slash, path, slash, mod, is_dir ? -1 : fsize, size); free((void *) href.p); @@ -7797,23 +7797,24 @@ static void mg_send_directory_listing(struct mg_connection *nc, const char *dir, mg_printf_http_chunk( nc, - "Index of %.*s%s%s" + "Index of %.*s%s%s" "\n" - "

Index of %.*s

\n" - "" - "\n" - "\n" - "", + "font-family: monospace; }" + "

Index of %.*s

Name" - "Modified" - "Size

" + "" + "" + "" + "" + "", (int) hm->uri.len, hm->uri.p, sort_js_code, sort_js_code2, (int) hm->uri.len, hm->uri.p); mg_scan_directory(nc, dir, opts, mg_print_dir_entry); mg_printf_http_chunk(nc, - "\n" - "
Name" + "ModifiedSize


\n" - "
%s
\n" + "" + "
" + "" + "
%s
" "", mg_version_header); mg_send_http_chunk(nc, "", 0); diff --git a/src/mg_http.c b/src/mg_http.c index 6d159192..7f780247 100644 --- a/src/mg_http.c +++ b/src/mg_http.c @@ -2102,7 +2102,7 @@ static void mg_print_dir_entry(struct mg_connection *nc, const char *file_name, href = mg_url_encode(mg_mk_str(file_name)); mg_printf_http_chunk(nc, "%s%s" - "%s%s\n", + "%s%s", href.p, slash, path, slash, mod, is_dir ? -1 : fsize, size); free((void *) href.p); @@ -2168,23 +2168,24 @@ static void mg_send_directory_listing(struct mg_connection *nc, const char *dir, mg_printf_http_chunk( nc, - "Index of %.*s%s%s" + "Index of %.*s%s%s" "\n" - "

Index of %.*s

\n" - "" - "\n" - "\n" - "", + "font-family: monospace; }" + "

Index of %.*s

Name" - "Modified" - "Size

" + "" + "" + "" + "" + "", (int) hm->uri.len, hm->uri.p, sort_js_code, sort_js_code2, (int) hm->uri.len, hm->uri.p); mg_scan_directory(nc, dir, opts, mg_print_dir_entry); mg_printf_http_chunk(nc, - "\n" - "
Name" + "ModifiedSize


\n" - "
%s
\n" + "" + "
" + "" + "
%s
" "", mg_version_header); mg_send_http_chunk(nc, "", 0);