diff options
author | Eric Covener <covener@apache.org> | 2011-11-21 03:30:30 +0000 |
---|---|---|
committer | Eric Covener <covener@apache.org> | 2011-11-21 03:30:30 +0000 |
commit | cebd681cfe91239e036215a135b82c2441bf3a2f (patch) | |
tree | 3334f6c3a778c1e8e30b24d1956a483bf823643e /modules/generators | |
parent | c3dcbc01f306a414f16abb8390e31b16931a6e47 (diff) | |
download | httpd-cebd681cfe91239e036215a135b82c2441bf3a2f.tar.gz |
Merge r1204341 from trunk:
PR51471: IndexIgnore doesn't work in DirectoryMatch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1204342 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r-- | modules/generators/mod_autoindex.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 1007b8e7db..b192b57946 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -326,7 +326,7 @@ static const char *add_desc(cmd_parms *cmd, void *d, const char *desc, static const char *add_ignore(cmd_parms *cmd, void *d, const char *ext) { - push_item(((autoindex_config_rec *) d)->ign_list, 0, ext, cmd->path, NULL); + push_item(((autoindex_config_rec *) d)->ign_list, cmd->info, ext, cmd->path, NULL); return NULL; } @@ -587,7 +587,7 @@ static const command_rec autoindex_cmds[] = "one or more index options [+|-][]"), AP_INIT_TAKE2("IndexOrderDefault", set_default_order, NULL, DIR_CMD_PERMS, "{Ascending,Descending} {Name,Size,Description,Date}"), - AP_INIT_ITERATE("IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS, + AP_INIT_ITERATE("IndexIgnore", add_ignore, BY_PATH, DIR_CMD_PERMS, "one or more file extensions"), AP_INIT_FLAG("IndexIgnoreReset", ap_set_flag_slot, (void *)APR_OFFSETOF(autoindex_config_rec, ign_noinherit), @@ -876,30 +876,13 @@ static int ignore_entry(autoindex_config_rec *d, char *path) { apr_array_header_t *list = d->ign_list; struct item *items = (struct item *) list->elts; - char *tt; int i; - if ((tt = strrchr(path, '/')) == NULL) { - tt = path; - } - else { - tt++; - } - for (i = 0; i < list->nelts; ++i) { struct item *p = &items[i]; - char *ap; - - if ((ap = strrchr(p->apply_to, '/')) == NULL) { - ap = p->apply_to; - } - else { - ap++; - } #ifndef CASE_BLIND_FILESYSTEM - if (!ap_strcmp_match(path, p->apply_path) - && !ap_strcmp_match(tt, ap)) { + if (!ap_strcmp_match(path, p->apply_to)) { return 1; } #else /* !CASE_BLIND_FILESYSTEM */ @@ -908,8 +891,7 @@ static int ignore_entry(autoindex_config_rec *d, char *path) * a factor of the filesystem involved, but we can't detect that * reliably - so we have to granularise at the OS level. */ - if (!ap_strcasecmp_match(path, p->apply_path) - && !ap_strcasecmp_match(tt, ap)) { + if (!ap_strcasecmp_match(path, p->apply_to)) { return 1; } #endif /* !CASE_BLIND_FILESYSTEM */ |