]> granicus.if.org Git - apache/blobdiff - modules/filters/mod_substitute.c
mod_substitute: follow up to r1687539.
[apache] / modules / filters / mod_substitute.c
index eb126847de4d807e433269d31b8b9831016fb6ac..efd1a06c6826ea1caeda6a8afa5eb568d32a839f 100644 (file)
@@ -57,8 +57,7 @@ typedef struct {
     apr_array_header_t *patterns;
     apr_size_t max_line_length;
     int max_line_length_set;
-    int inherit_before_set,
-        inherit_before;
+    int inherit_before;
 } subst_dir_conf;
 
 typedef struct {
@@ -76,6 +75,7 @@ static void *create_substitute_dcfg(apr_pool_t *p, char *d)
 
     dcfg->patterns = apr_array_make(p, 10, sizeof(subst_pattern_t));
     dcfg->max_line_length = AP_SUBST_MAX_LINE_LENGTH;
+    dcfg->inherit_before = -1;
     return dcfg;
 }
 
@@ -86,8 +86,8 @@ static void *merge_substitute_dcfg(apr_pool_t *p, void *basev, void *overv)
     subst_dir_conf *base = (subst_dir_conf *) basev;
     subst_dir_conf *over = (subst_dir_conf *) overv;
 
-    if (!over->inherit_before_set) {
-        over->inherit_before = base->inherit_before;
+    if (over->inherit_before < 0) {
+        over->inherit_before = (base->inherit_before > 0);
     }
     if (over->inherit_before) {
         a->patterns = apr_array_append(p, base->patterns,
@@ -699,7 +699,6 @@ static const char *set_inherit_before(cmd_parms *cmd, void *cfg, int flag)
     subst_dir_conf *dcfg = (subst_dir_conf *)cfg;
 
     dcfg->inherit_before = (flag != 0);
-    dcfg->inherit_before_set = 1;
 
     return NULL;
 }