From cd26218b944fc702901d1385a581e923d97a879f Mon Sep 17 00:00:00 2001
From: Jim Jagielski <jim@apache.org>
Date: Tue, 11 Feb 2020 13:16:38 +0000
Subject: [PATCH] Merge r1873747 from trunk:

factor out default regex flags


Submitted by: covener
Reviewed by: covener, minfrin, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1873905 13f79535-47bb-0310-9956-ffa450edef68
---
 STATUS             | 6 ------
 include/ap_mmn.h   | 3 ++-
 include/ap_regex.h | 2 ++
 server/core.c      | 2 +-
 server/util_pcre.c | 3 +--
 5 files changed, 6 insertions(+), 10 deletions(-)

#diff --git a/STATUS b/STATUS
#index 26b37e16a2c..4afd862b385 100644
#--- a/STATUS
#+++ b/STATUS
#@@ -133,12 +133,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
#   [ start all new proposals below, under PATCHES PROPOSED. ]
# 
# 
#-  *) factor out default regex flags:
#-     trunk patch: http://svn.apache.org/r1873747
#-     2.4.x patch: http://people.apache.org/~covener/patches/httpd-2.4.x-reg_default.diff
#-         (MMN, ap_regex.h conflicts)
#-     +1: covener, minfrin, jorton
#-
#   *) factor out chunked TE checks
#      trunk patch: http://svn.apache.org/r1873748
#      2.4.x patch: http://people.apache.org/~covener/patches/httpd-2.4.x-chunk.diff
#diff --git a/include/ap_mmn.h b/include/ap_mmn.h
#index e257c606eea..acdf7f1b1ad 100644
#--- a/include/ap_mmn.h
#+++ b/include/ap_mmn.h
#@@ -531,6 +531,7 @@
#  * 20120211.88 (2.4.40-dev) Add ap_dir_nofnmatch() and ap_dir_fnmatch().
#  * 20120211.89 (2.4.42-dev) Add add dns_pool to proxy_conn_pool and define
#  *                          AP_VOLATILIZE_T.
#+ * 20120211.90 (2.4.42-dev) AP_REG_DEFAULT macro in ap_regex.h
#  */
# 
# #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#@@ -538,7 +539,7 @@
# #ifndef MODULE_MAGIC_NUMBER_MAJOR
# #define MODULE_MAGIC_NUMBER_MAJOR 20120211
# #endif
#-#define MODULE_MAGIC_NUMBER_MINOR 89                  /* 0...n */
#+#define MODULE_MAGIC_NUMBER_MINOR 90                  /* 0...n */
# 
# /**
#  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
--- a/include/ap_regex.h
+++ b/include/ap_regex.h
@@ -81,6 +81,8 @@ extern "C" {
 
 #define AP_REG_MATCH "MATCH_" /** suggested prefix for ap_regname */
 
+#define AP_REG_DEFAULT (AP_REG_DOTALL|AP_REG_DOLLAR_ENDONLY)
+
 /* Error values: */
 enum {
   AP_REG_ASSERT = 1,  /** internal error ? */
--- a/server/core.c
+++ b/server/core.c
@@ -4925,7 +4925,7 @@ static int core_pre_config(apr_pool_t *p
     apr_pool_cleanup_register(pconf, NULL, reset_config_defines,
                               apr_pool_cleanup_null);
 
-    ap_regcomp_set_default_cflags(AP_REG_DOLLAR_ENDONLY);
+    ap_regcomp_set_default_cflags(AP_REG_DEFAULT);
 
     mpm_common_pre_config(pconf);
 
--- a/server/util_pcre.c
+++ b/server/util_pcre.c
@@ -111,8 +111,7 @@ AP_DECLARE(void) ap_regfree(ap_regex_t *
  *            Compile a regular expression       *
  *************************************************/
 
-static int default_cflags = AP_REG_DOTALL |
-                            AP_REG_DOLLAR_ENDONLY;
+static int default_cflags = AP_REG_DEFAULT;
 
 AP_DECLARE(int) ap_regcomp_get_default_cflags(void)
 {
