You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2015/06/30 04:40:10 UTC

svn commit: r1688343 - /httpd/httpd/trunk/modules/filters/mod_substitute.c

Author: wrowe
Date: Tue Jun 30 02:40:09 2015
New Revision: 1688343

URL: http://svn.apache.org/r1688343
Log:
Net -8 LoC, my usual specialty.

This didn't need to be reinvented; please use established helpers.


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=1688343&r1=1688342&r2=1688343&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_substitute.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_substitute.c Tue Jun 30 02:40:09 2015
@@ -701,15 +701,6 @@ static const char *set_max_line_length(c
     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}
 };