From ee283b4cf3e88133bbffd40620ca0bb5e0ac2255 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 19 Aug 2001 18:58:19 +0000 Subject: [PATCH] Assure that non-FancyIndexed listings properly shortcut dir entries, 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 5e3fa6d843..59c1135a44 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -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); -- 2.40.0