Lines 39-44
Link Here
|
39 |
|
39 |
|
40 |
typedef struct dir_config_struct { |
40 |
typedef struct dir_config_struct { |
41 |
apr_array_header_t *index_names; |
41 |
apr_array_header_t *index_names; |
|
|
42 |
apr_array_header_t *index_names_incr; |
42 |
slash_cfg do_slash; |
43 |
slash_cfg do_slash; |
43 |
} dir_config_rec; |
44 |
} dir_config_rec; |
44 |
|
45 |
|
Lines 55-60
Link Here
|
55 |
return NULL; |
56 |
return NULL; |
56 |
} |
57 |
} |
57 |
|
58 |
|
|
|
59 |
static const char *add_index_incr(cmd_parms *cmd, void *dummy, const char *arg) |
60 |
{ |
61 |
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); |
62 |
|
63 |
if (err != NULL) { |
64 |
return err; |
65 |
} |
66 |
|
67 |
dir_config_rec *d = dummy; |
68 |
|
69 |
if (!d->index_names_incr) { |
70 |
d->index_names_incr = apr_array_make(cmd->pool, 2, sizeof(char *)); |
71 |
} |
72 |
*(const char **)apr_array_push(d->index_names_incr) = arg; |
73 |
return NULL; |
74 |
} |
75 |
|
58 |
static const char *configure_slash(cmd_parms *cmd, void *d_, int arg) |
76 |
static const char *configure_slash(cmd_parms *cmd, void *d_, int arg) |
59 |
{ |
77 |
{ |
60 |
dir_config_rec *d = d_; |
78 |
dir_config_rec *d = d_; |
Lines 67-72
Link Here
|
67 |
{ |
85 |
{ |
68 |
AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS, |
86 |
AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS, |
69 |
"a list of file names"), |
87 |
"a list of file names"), |
|
|
88 |
AP_INIT_ITERATE("AddDirectoryIndex", add_index_incr, NULL, RSRC_CONF, |
89 |
"a list of file names"), |
70 |
AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS, |
90 |
AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS, |
71 |
"On or Off"), |
91 |
"On or Off"), |
72 |
{NULL} |
92 |
{NULL} |
Lines 77-82
Link Here
|
77 |
dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec)); |
97 |
dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec)); |
78 |
|
98 |
|
79 |
new->index_names = NULL; |
99 |
new->index_names = NULL; |
|
|
100 |
new->index_names_incr = NULL; |
80 |
new->do_slash = SLASH_UNSET; |
101 |
new->do_slash = SLASH_UNSET; |
81 |
return (void *) new; |
102 |
return (void *) new; |
82 |
} |
103 |
} |
Lines 87-93
Link Here
|
87 |
dir_config_rec *base = (dir_config_rec *)basev; |
108 |
dir_config_rec *base = (dir_config_rec *)basev; |
88 |
dir_config_rec *add = (dir_config_rec *)addv; |
109 |
dir_config_rec *add = (dir_config_rec *)addv; |
89 |
|
110 |
|
90 |
new->index_names = add->index_names ? add->index_names : base->index_names; |
111 |
|
|
|
112 |
if (add->index_names) { |
113 |
new->index_names = add->index_names; |
114 |
} else { |
115 |
new->index_names = base->index_names; |
116 |
if (base->index_names_incr) { |
117 |
if (!new->index_names) { |
118 |
new->index_names = apr_array_make(p, 2, sizeof(char *)); |
119 |
} |
120 |
apr_array_cat(new->index_names, base->index_names_incr); |
121 |
} |
122 |
} |
123 |
|
124 |
if (add->index_names_incr) { |
125 |
if (!new->index_names) { |
126 |
new->index_names = apr_array_make(p, 2, sizeof(char *)); |
127 |
} |
128 |
apr_array_cat(new->index_names, add->index_names_incr); |
129 |
} |
130 |
|
91 |
new->do_slash = |
131 |
new->do_slash = |
92 |
(add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash; |
132 |
(add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash; |
93 |
return new; |
133 |
return new; |
Lines 155-160
Link Here
|
155 |
return DECLINED; |
195 |
return DECLINED; |
156 |
} |
196 |
} |
157 |
|
197 |
|
|
|
198 |
if (d->index_names_incr) { |
199 |
if (!d->index_names) { |
200 |
d->index_names = d->index_names_incr; |
201 |
} else { |
202 |
apr_array_cat(d->index_names, d->index_names_incr); |
203 |
} |
204 |
} |
205 |
|
158 |
if (d->index_names) { |
206 |
if (d->index_names) { |
159 |
names_ptr = (char **)d->index_names->elts; |
207 |
names_ptr = (char **)d->index_names->elts; |
160 |
num_names = d->index_names->nelts; |
208 |
num_names = d->index_names->nelts; |