From a7cc25882b90d0dfccb8bc3f9887b889c0205dec Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 4 Dec 2003 06:40:13 +0000 Subject: [PATCH] merge this from 2.1-dev: Restore the ability to add a description for directories that don't contain an index file. (Broken in 2.0.48) Submitted by: nd Reviewed by: trawick, striker git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@101980 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 8 +------- modules/generators/mod_autoindex.c | 12 ++++-------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 6ca5633b403..5a0eef55abc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.49 + *) Restore the ability to add a description for directories that + don't contain an index file. (Broken in 2.0.48) [André Malo] + *) Fix a problem with the display of empty variables ("SetEnv foo") in mod_include. PR 24734 [Markus Julen ] diff --git a/STATUS b/STATUS index b2b5b286d88..34d93d451dc 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2003/12/04 06:31:01 $] +Last modified at [$Date: 2003/12/04 06:40:13 $] Release: @@ -338,12 +338,6 @@ PATCHES TO BACKPORT FROM 2.1 include/ap_mmn.h: r1.60 +1: nd - * mod_autoindex: Restore the ability to add a description for - directories that don't contain an index file. - PR 7990 - modules/generators/mod_autoindex.c: r1.125 - +1: nd, trawick, striker - * LDAP cache fixes from Matthieu Estrade; see PR 18756 include/util_ldap.h r1.12 modules/experimental/util_ldap.c r1.15, r1.16 diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 9aa3967927c..02b2958602e 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -1329,14 +1329,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); @@ -1362,6 +1354,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.47.2