]> granicus.if.org Git - apache/commitdiff
Assure that non-FancyIndexed listings properly shortcut dir entries,
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 19 Aug 2001 18:58:19 +0000 (18:58 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 19 Aug 2001 18:58:19 +0000 (18:58 +0000)
  and display and href the trailing slash, as well.

PR: 8206

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

modules/generators/mod_autoindex.c

index 5e3fa6d843b20b50fff6dc7ee6d3bf50aaa73e70..59c1135a447ffd2f326578bc8e37b5d123fd0b12 100644 (file)
@@ -1269,7 +1269,10 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
     }
 
     p = (struct ent *) apr_pcalloc(r->pool, sizeof(struct ent));
-    p->name = apr_pstrdup(r->pool, dirent->name);
+    if (rr->finfo.filetype == APR_DIR)
+        p->name = apr_pstrcat(r->pool, dirent->name, "/", NULL);
+    else
+        p->name = apr_pstrdup(r->pool, dirent->name);
     p->size = -1;
     p->icon = NULL;
     p->alt = NULL;
@@ -1293,7 +1296,6 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
                if (!(p->alt = find_default_alt(d, "^^DIRECTORY^^")))
                    p->alt = "DIR";
            }
-           p->name = apr_pstrcat(r->pool, dirent->name, "/", NULL);
        }
        else {
            p->icon = find_icon(d, rr, 0);