httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1687680 - /httpd/httpd/trunk/modules/filters/mod_substitute.c
Date Fri, 26 Jun 2015 07:08:16 GMT
Author: ylavic
Date: Fri Jun 26 07:08:16 2015
New Revision: 1687680

URL: http://svn.apache.org/r1687680
Log:
mod_substitute: follow up to r1687539.
Use tristate single inherit_before variable instead of two, according to
wrowe's advices.

Modified:
    httpd/httpd/trunk/modules/filters/mod_substitute.c

Modified: httpd/httpd/trunk/modules/filters/mod_substitute.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_substitute.c?rev=1687680&r1=1687679&r2=1687680&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_substitute.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_substitute.c Fri Jun 26 07:08:16 2015
@@ -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_
 
     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_p
     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(cm
     subst_dir_conf *dcfg = (subst_dir_conf *)cfg;
 
     dcfg->inherit_before = (flag != 0);
-    dcfg->inherit_before_set = 1;
 
     return NULL;
 }



Mime
View raw message