]> granicus.if.org Git - apache/commitdiff
darn, the patch for bug 9587 (wrong icon for directories shown) broke
authorAndré Malo <nd@apache.org>
Mon, 3 Nov 2003 21:57:51 +0000 (21:57 +0000)
committerAndré Malo <nd@apache.org>
Mon, 3 Nov 2003 21:57:51 +0000 (21:57 +0000)
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
modules/generators/mod_autoindex.c

diff --git a/CHANGES b/CHANGES
index cc0a9c19efa16e8bbf2712c54f582b7f6e95f1d9..782c840c19d9a31b3e64e9376cb79740abfd7722 100644 (file)
--- 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 <geoff@apache.org>, André Malo]
 
index d2fd5c178a402cd742af20be1815edfecfdd53ba..96d3349dc39e4956cec37f1d48c1ddae4782c42f 100644 (file)
@@ -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^^");
             }