/[apache]/trunk/dist/2.2/patches/02_all_gentoo_mod_dir_incremental.patch
Gentoo

Contents of /trunk/dist/2.2/patches/02_all_gentoo_mod_dir_incremental.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 152 - (show annotations) (download)
Mon Jun 4 11:59:25 2007 UTC (7 years, 3 months ago) by phreak
File size: 2800 byte(s)
Adding the fixed AddDirectoryIndex patch from #139451 to our patchtarball. Many thanks to Joshua Pettett <bugs.gentoo.devel at homelinkcs.com> for providing the fixed version.
1 diff -ur httpd-2.0.58.orig/modules/mappers/mod_dir.c httpd-2.0.58/modules/mappers/mod_dir.c
2 --- httpd-2.0.58.orig/modules/mappers/mod_dir.c 2007-03-31 19:36:23.000000000 -0400
3 +++ httpd-2.0.58/modules/mappers/mod_dir.c 2007-03-31 19:39:22.000000000 -0400
4 @@ -39,6 +39,7 @@
5
6 typedef struct dir_config_struct {
7 apr_array_header_t *index_names;
8 + apr_array_header_t *index_names_incr;
9 slash_cfg do_slash;
10 } dir_config_rec;
11
12 @@ -55,6 +56,23 @@
13 return NULL;
14 }
15
16 +static const char *add_index_incr(cmd_parms *cmd, void *dummy, const char *arg)
17 +{
18 + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
19 +
20 + if (err != NULL) {
21 + return err;
22 + }
23 +
24 + dir_config_rec *d = dummy;
25 +
26 + if (!d->index_names_incr) {
27 + d->index_names_incr = apr_array_make(cmd->pool, 2, sizeof(char *));
28 + }
29 + *(const char **)apr_array_push(d->index_names_incr) = arg;
30 + return NULL;
31 +}
32 +
33 static const char *configure_slash(cmd_parms *cmd, void *d_, int arg)
34 {
35 dir_config_rec *d = d_;
36 @@ -67,6 +85,8 @@
37 {
38 AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
39 "a list of file names"),
40 + AP_INIT_ITERATE("AddDirectoryIndex", add_index_incr, NULL, RSRC_CONF,
41 + "a list of file names"),
42 AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS,
43 "On or Off"),
44 {NULL}
45 @@ -77,6 +97,7 @@
46 dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec));
47
48 new->index_names = NULL;
49 + new->index_names_incr = NULL;
50 new->do_slash = SLASH_UNSET;
51 return (void *) new;
52 }
53 @@ -87,7 +108,26 @@
54 dir_config_rec *base = (dir_config_rec *)basev;
55 dir_config_rec *add = (dir_config_rec *)addv;
56
57 - new->index_names = add->index_names ? add->index_names : base->index_names;
58 +
59 + if (add->index_names) {
60 + new->index_names = add->index_names;
61 + } else {
62 + new->index_names = base->index_names;
63 + if (base->index_names_incr) {
64 + if (!new->index_names) {
65 + new->index_names = apr_array_make(p, 2, sizeof(char *));
66 + }
67 + apr_array_cat(new->index_names, base->index_names_incr);
68 + }
69 + }
70 +
71 + if (add->index_names_incr) {
72 + if (!new->index_names) {
73 + new->index_names = apr_array_make(p, 2, sizeof(char *));
74 + }
75 + apr_array_cat(new->index_names, add->index_names_incr);
76 + }
77 +
78 new->do_slash =
79 (add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash;
80 return new;
81 @@ -155,6 +195,14 @@
82 return DECLINED;
83 }
84
85 + if (d->index_names_incr) {
86 + if (!d->index_names) {
87 + d->index_names = d->index_names_incr;
88 + } else {
89 + apr_array_cat(d->index_names, d->index_names_incr);
90 + }
91 + }
92 +
93 if (d->index_names) {
94 names_ptr = (char **)d->index_names->elts;
95 num_names = d->index_names->nelts;

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20