From 256c57f35048a41e0a081f0dee46c73f5fc24d60 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Mon, 3 Nov 2003 21:57:51 +0000 Subject: [PATCH] darn, the patch for bug 9587 (wrong icon for directories shown) broke the directory descriptions more or less completely. Fix it now. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101693 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/generators/mod_autoindex.c | 12 ++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index cc0a9c19ef..782c840c19 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_autoindex: Restore the ability to add a description for + directories that don't contain an index file. [André Malo] + *) mod_include no longer allows an ETag header on 304 responses. PR 19355. [Geoffrey Young , André Malo] diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index d2fd5c178a..96d3349dc3 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -1331,14 +1331,6 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent, return (NULL); } - if (rr->finfo.filetype == APR_DIR) { - /* ap_sub_req_lookup_dirent() adds '/' to end of any directory, - * but that messes up our attempt to find relevant - * AddDescription directives. - */ - rr->filename[strlen(rr->filename) - 1] = '\0'; - } - p = (struct ent *) apr_pcalloc(r->pool, sizeof(struct ent)); if (dirent->filetype == APR_DIR) { p->name = apr_pstrcat(r->pool, dirent->name, "/", NULL); @@ -1364,6 +1356,10 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent, p->isdir = 1; } rr->filename = ap_make_dirstr_parent (rr->pool, rr->filename); + + /* omit the trailing slash (1.3 compat) */ + rr->filename[strlen(rr->filename) - 1] = '\0'; + if (!(p->icon = find_icon(d, rr, 1))) { p->icon = find_default_icon(d, "^^DIRECTORY^^"); } -- 2.40.0