Maybe defining (naming) inherit_before tristate values would help:
Index: modules/filters/mod_substitute.c
===================================================================
--- modules/filters/mod_substitute.c (revision 1688331)
+++ modules/filters/mod_substitute.c (working copy)
@@ -68,6 +68,10 @@ typedef struct {
apr_pool_t *tpool;
} substitute_module_ctx;
+#define INHERIT_UNSET -1
+#define INHERIT_OFF 0
+#define INHERIT_ON 1
+
static void *create_substitute_dcfg(apr_pool_t *p, char *d)
{
subst_dir_conf *dcfg =
@@ -75,7 +79,7 @@ static void *create_substitute_dcfg(apr_pool_t *p,
dcfg->patterns = apr_array_make(p, 10, sizeof(subst_pattern_t));
dcfg->max_line_length = AP_SUBST_MAX_LINE_LENGTH;
- dcfg->inherit_before = -1;
+ dcfg->inherit_before = INHERIT_UNSET;
return dcfg;
}
@@ -86,8 +90,9 @@ static void *merge_substitute_dcfg(apr_pool_t *p,
subst_dir_conf *base = (subst_dir_conf *) basev;
subst_dir_conf *over = (subst_dir_conf *) overv;
- a->inherit_before = (over->inherit_before > 0 ||
(over->inherit_before < 0 &&
-
base->inherit_before > 0));
+ a->inherit_before = (over->inherit_before == INHERIT_ON
+ || (over->inherit_before == INHERIT_UNSET
+ && base->inherit_before == INHERIT_ON));
if (a->inherit_before) {
a->patterns = apr_array_append(p, base->patterns,
over->patterns);
?
Which would be:
+ a->inherit_before = (over->inherit_before == INHERIT_ON
+ || (over->inherit_before == INHERIT_UNSET
+ && base->inherit_before != INHERIT_OFF));
in 2.2 and 2.4.
On Tue, Jun 30, 2015 at 2:50 AM, William A Rowe Jr <[email protected]> wrote:
> I was literally switching between a dead and live box repairing a corrupted
> boot volume, so you may be right or I might have studied a stale patch.
>
> Will refresh trunk in a few minutes here with suggested changes.
>
> On Jun 29, 2015 7:42 PM, "Yann Ylavic" <[email protected]> wrote:
>>
>> On Tue, Jun 30, 2015 at 2:03 AM, William A Rowe Jr <[email protected]>
>> wrote:
>> > I can't approve this semantic mess.
>> >
>> > EITHER it is inherit_before on trunk-2.4-2.2 with a change of default
>> > behavior, or it is inherit_after, again across all branches with a
>> > change of
>> > default behavior. The delta should consist of a one line difference,
>> > evaluating inheritance behavior within the merge.
>>
>> Well, that's the case already, no?
>> With 2.4.x patch applied:
>>
>> --- 2.4.x/modules/filters/mod_substitute.c 2015-06-30
>> 01:52:18.595947091 +0200
>> +++ trunk/modules/filters/mod_substitute.c 2015-06-30
>> 01:41:18.027679427 +0200
>> @@ -87,7 +87,7 @@
>> subst_dir_conf *over = (subst_dir_conf *) overv;
>>
>> a->inherit_before = (over->inherit_before > 0 ||
>> (over->inherit_before < 0 &&
>> -
>> base->inherit_before != 0));
>> +
>> base->inherit_before > 0));
>> if (a->inherit_before) {
>> a->patterns = apr_array_append(p, base->patterns,
>> over->patterns);
>>
>> >
>> > Please express your preference and I will offer several style fixes on
>> > trunk
>> > that make this easier to follow, but we are not adding one directive to
>> > trunk and a different one to 2.4 & 2.2 :-/
>>
>> Same directive in trunk and 2.[24] branches, default only changes, I
>> don't see what you mean.
>> This proposal allows to merge the inherit_before flag itself, that may
>> be confusing / not suitable / overkill (dunno), so feel free to
>> implement simpler/better code (the default merge-base-before-over
>> semantic must be preserved for the branches, though).