diff --exclude='*~' --exclude='.*' -I '$Id:' -urN lighttpd-1.3.13.orig/src/base.h lighttpd-1.3.13/src/base.h --- lighttpd-1.3.13.orig/src/base.h 2005-03-03 17:28:50.000000000 +0000 +++ lighttpd-1.3.13/src/base.h 2005-05-22 09:13:18.142338232 +0000 @@ -223,6 +223,7 @@ buffer *error_handler; buffer *server_tag; buffer *dirlist_css; + buffer *dirlist_encoding; unsigned short dir_listing; unsigned short hide_dotfiles; diff --exclude='*~' --exclude='.*' -I '$Id:' -urN lighttpd-1.3.13.orig/src/config.c lighttpd-1.3.13/src/config.c --- lighttpd-1.3.13.orig/src/config.c 2005-03-03 17:28:50.000000000 +0000 +++ lighttpd-1.3.13/src/config.c 2005-05-22 09:13:04.826362568 +0000 @@ -75,6 +75,8 @@ { "dir-listing.hide-dotfiles", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 39 */ { "dir-listing.external-css", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 40 */ + { "dir-listing.encoding", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 41 */ + { "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, { "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, { "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, @@ -126,6 +128,7 @@ s->error_handler = buffer_init(); s->server_tag = buffer_init(); s->dirlist_css = buffer_init(); + s->dirlist_encoding = buffer_init(); s->max_keep_alive_requests = 128; s->max_keep_alive_idle = 30; s->max_read_idle = 60; @@ -173,6 +176,7 @@ cv[38].destination = s->ssl_ca_file; cv[39].destination = &(s->hide_dotfiles); cv[40].destination = s->dirlist_css; + cv[41].destination = s->dirlist_encoding; srv->config_storage[i] = s; @@ -195,6 +199,7 @@ PATCH(document_root); PATCH(dir_listing); PATCH(dirlist_css); + PATCH(dirlist_encoding); PATCH(hide_dotfiles); PATCH(indexfiles); PATCH(max_keep_alive_requests); @@ -245,6 +250,8 @@ PATCH(hide_dotfiles); } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.external-css"))) { PATCH(dirlist_css); + } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.encoding"))) { + PATCH(dirlist_encoding); } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.error-handler-404"))) { PATCH(error_handler); } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.indexfiles"))) { diff --exclude='*~' --exclude='.*' -I '$Id:' -urN lighttpd-1.3.13.orig/src/response.c lighttpd-1.3.13/src/response.c --- lighttpd-1.3.13.orig/src/response.c 2005-03-03 23:56:52.000000000 +0000 +++ lighttpd-1.3.13/src/response.c 2005-05-22 09:28:56.051754328 +0000 @@ -735,7 +735,15 @@ if (files.used) http_dirls_sort(files.ent, files.used); out = chunkqueue_get_append_buffer(con->write_queue); - BUFFER_COPY_STRING_CONST(out, "\n"); + + if (buffer_is_empty(con->conf.dirlist_encoding)) { + BUFFER_COPY_STRING_CONST(out, "\n"); + } else { + BUFFER_COPY_STRING_CONST(out, "conf.dirlist_encoding); + BUFFER_APPEND_STRING_CONST(out, "\"?>\n"); + } + http_list_directory_header(out, con); /* directories */ diff --exclude='*~' --exclude='.*' -I '$Id:' -urN lighttpd-1.3.13.orig/src/server.c lighttpd-1.3.13/src/server.c --- lighttpd-1.3.13.orig/src/server.c 2005-03-03 17:28:50.000000000 +0000 +++ lighttpd-1.3.13/src/server.c 2005-05-22 09:13:28.187811088 +0000 @@ -242,6 +242,7 @@ buffer_free(s->ssl_ca_file); buffer_free(s->error_handler); buffer_free(s->dirlist_css); + buffer_free(s->dirlist_encoding); array_free(s->indexfiles); array_free(s->mimetypes);