--- http-2.2.6.orig/modules/generators/mod_autoindex.c.orig 2007-08-30 06:37:26.000000000 +0800 +++ http-2.2.6/modules/generators/mod_autoindex.c 2007-10-01 15:19:39.000000000 +0800 @@ -160,8 +160,23 @@ d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config, &autoindex_module); - ap_rvputs(r, xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2, - "\n \n Index of ", title, + ap_rvputs(r, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2, + "<html>\n <head>\n", + " <style type=\"text/css\">\n", + " a, a:active {text-decoration: none; color: blue;}\n", + " a:visited {color: #48468F;}\n", + " a:hover, a:focus {text-decoration: underline; color: red;}\n", + " body {background-color: #F5F5F5;}\n", + " h2 {margin-bottom: 12px;}\n", + " table {margin-left: 12px;}\n", + " th, td { font-family: \"Courier New\", Courier, monospace; font-size: 10pt; text-align: left;}\n", + " th { font-weight: bold; padding-right: 14px; padding-bottom: 3px;}\n", + " td {padding-right: 14px;}\n", + " td.s, th.s {text-align: right;}\n", + " div.list { background-color: white; border-top: 1px solid #646464; border-bottom: 1px solid #646464; padding-top: 10px; padding-bottom: 14px;}\n", + " div.foot { font-family: \"Courier New\", Courier, monospace; font-size: 10pt; color: #787878; padding-top: 4px;}\n", + " </style>\n", + " <title>Index of ", title, "\n", NULL); if (d->style_sheet != NULL) { ap_rvputs(r, " style_sheet, @@ -1090,7 +1105,7 @@ emit_preamble(r, emit_xhtml, title); } if (emit_H1) { - ap_rvputs(r, "

Index of ", title, "

\n", NULL); + ap_rvputs(r, "

Index of ", title, "

\n", NULL); } if (rr != NULL) { ap_destroy_sub_req(rr); @@ -1585,7 +1600,7 @@ ap_rvputs(r, "", breakrow, NULL); } else if (autoindex_opts & FANCY_INDEXING) { - ap_rputs("
", r);
+        ap_rputs("
\n\n\n\n", r); } else { ap_rputc('\n', r); @@ -1756,7 +1768,7 @@ ap_rvputs(r, "", NULL); } if ((ar[x]->icon) || d->default_icon) { - ap_rvputs(r, "", pad_scratch + nwidth, NULL); /* * The blank before the storm.. er, before the next field. */ - ap_rputs(" ", r); + ap_rputs(" ", &ts); ap_rputs(time_str, r); } else { @@ -1817,15 +1829,18 @@ } if (!(autoindex_opts & SUPPRESS_SIZE)) { char buf[5]; + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_DESC)) { + ap_rputs(" ", r); } ap_rputc('\n', r); } @@ -1840,11 +1855,7 @@ } else if (autoindex_opts & FANCY_INDEXING) { if (!(autoindex_opts & SUPPRESS_RULES)) { - ap_rputs("\n", r); + ap_rputs("\n
", r); if (!(autoindex_opts & SUPPRESS_ICON)) { if ((tp = find_default_icon(d, "^^BLANKICON^^"))) { ap_rvputs(r, "", r); /* * Emit the guaranteed-at-least-one-space-between-columns byte. */ - ap_rputs(" ", r); + ap_rputs(" ", r); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { emit_link(r, "Last modified", K_LAST_MOD, keyid, direction, colargs, static_columns); - ap_rputs(" ", r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_SIZE)) { emit_link(r, "Size", K_SIZE, keyid, direction, colargs, static_columns); - ap_rputs(" ", r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_DESC)) { emit_link(r, "Description", K_DESC, keyid, direction, colargs, static_columns); } if (!(autoindex_opts & SUPPRESS_RULES)) { - ap_rputs("", r); + ap_rputs("
icon ? ar[x]->icon : d->default_icon), @@ -1796,18 +1808,18 @@ } ap_rvputs(r, "", ap_escape_html(scratch, t2), - "", pad_scratch + nwidth, NULL); + "", r); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { if (ar[x]->lm != -1) { char time_str[MAX_STRING_LEN]; apr_time_exp_t ts; apr_time_exp_lt(&ts, ar[x]->lm); apr_strftime(time_str, &rv, MAX_STRING_LEN, - "%d-%b-%Y %H:%M ", &ts); + "%d-%b-%Y %H:%M", r); ap_rputs(apr_strfsize(ar[x]->size, buf), r); - ap_rputs(" ", r); + ap_rputs("", r); if (ar[x]->desc) { ap_rputs(terminate_description(d, ar[x]->desc, autoindex_opts, desc_width), r); } + ap_rputs("
\n
\n", r); } else { ap_rputs("
\n", r); @@ -2001,7 +2012,7 @@ #if APR_HAS_UNICODE_FS charset = "UTF-8"; #else - charset = "ISO-8859-1"; + charset = "UTF-8"; #endif } if (*charset) {