return NULL;
}
-static struct ent *make_autoindex_entry(const char *name, int autoindex_opts,
+static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
+ int autoindex_opts,
autoindex_config_rec *d,
request_rec *r, char keyid,
char direction)
{
struct ent *p;
- if ((name[0] == '.') && (!name[1])) {
+ if ((dirent->name[0] == '.') && (!dirent->name[1])) {
return (NULL);
}
- if (ignore_entry(d, ap_make_full_path(r->pool, r->filename, name))) {
+ if (ignore_entry(d, ap_make_full_path(r->pool, r->filename, dirent->name))) {
return (NULL);
}
p = (struct ent *) apr_pcalloc(r->pool, sizeof(struct ent));
- p->name = apr_pstrdup(r->pool, name);
+ p->name = apr_pstrdup(r->pool, dirent->name);
p->size = -1;
p->icon = NULL;
p->alt = NULL;
p->version_sort = autoindex_opts & VERSION_SORT;
if (autoindex_opts & FANCY_INDEXING) {
- request_rec *rr = ap_sub_req_lookup_file(name, r, NULL);
+ request_rec *rr = ap_sub_req_lookup_dirent(dirent, r, NULL);
if (rr->finfo.filetype != 0) {
p->lm = rr->finfo.mtime;
p->alt = "DIR";
}
p->size = -1;
- p->name = apr_pstrcat(r->pool, name, "/", NULL);
+ p->name = apr_pstrcat(r->pool, dirent->name, "/", NULL);
}
else {
p->icon = find_icon(d, rr, 0);
*/
head = NULL;
while (apr_dir_read(&dirent, APR_FINFO_DIRENT, thedir) == APR_SUCCESS) {
- p = make_autoindex_entry(dirent.name, autoindex_opts,
+ p = make_autoindex_entry(&dirent, autoindex_opts,
autoindex_conf, r, keyid, direction);
if (p != NULL) {
p->next = head;