]> granicus.if.org Git - apache/commitdiff
Net -8 LoC, my usual specialty.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 30 Jun 2015 02:40:09 +0000 (02:40 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 30 Jun 2015 02:40:09 +0000 (02:40 +0000)
This didn't need to be reinvented; please use established helpers.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1688343 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_substitute.c

index e3101933d77346049655ebe47b8c44564392be0d..87621975209584e15f2d247a73c4c0d5b9f20688 100644 (file)
@@ -701,15 +701,6 @@ static const char *set_max_line_length(cmd_parms *cmd, void *cfg, const char *ar
     return NULL;
 }
 
-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);
-
-    return NULL;
-}
-
 #define PROTO_FLAGS AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH
 static void register_hooks(apr_pool_t *pool)
 {
@@ -722,7 +713,8 @@ static const command_rec substitute_cmds[] = {
                   "Pattern to filter the response content (s/foo/bar/[inf])"),
     AP_INIT_TAKE1("SubstituteMaxLineLength", set_max_line_length, NULL, OR_FILEINFO,
                   "Maximum line length"),
-    AP_INIT_FLAG("SubstituteInheritBefore", set_inherit_before, NULL, OR_FILEINFO,
+    AP_INIT_FLAG("SubstituteInheritBefore", ap_set_flag_slot,
+                 (void *)APR_OFFSETOF(subst_dir_conf, inherit_before), OR_FILEINFO,
                  "Apply inherited patterns before those of the current context"),
     {NULL}
 };