]> granicus.if.org Git - apache/commitdiff
mod_autoindex: AddDescription directives for directories
authorJeff Trawick <trawick@apache.org>
Thu, 21 Nov 2002 23:53:21 +0000 (23:53 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 21 Nov 2002 23:53:21 +0000 (23:53 +0000)
now work as in Apache 1.3, where no trailing '/' is
specified on the directory name.  Previously, the trailing
'/' *had* to be specified, which was incompatible with
Apache 1.3.

PR:       7990

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97590 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/generators/mod_autoindex.c

diff --git a/CHANGES b/CHANGES
index 3f1e9e06aa21ac35c39e91a544e2cb1e7ee2e449..0e6c4e1e0de29d47a87a32c514434c4578dc22c3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
 Changes with Apache 2.0.44
 
+  *) mod_autoindex: AddDescription directives for directories
+     now work as in Apache 1.3, where no trailing '/' is
+     specified on the directory name.  Previously, the trailing
+     '/' *had* to be specified, which was incompatible with
+     Apache 1.3.  PR 7990  [Jeff Trawick]
+
   *) Fix for PR 14556. The expiry calculations in mod_cache were
      trying to perform "now + ((date - lastmod) * factor)" where
      date == lastmod resulting in "now + 0". The code now follows
index 3e3eef46695e21ef390a2ed60ec4e533db8c3317..defc0c05fe47d81ce0781c12d0cca89a6391067a 100644 (file)
@@ -1321,6 +1321,14 @@ 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);