diff options
author | Graham Leggett <minfrin@apache.org> | 2022-01-20 23:13:24 +0100 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2022-01-20 23:13:24 +0100 |
commit | 62db0c63abc6b66343eaa73a4811f8a1605f3366 (patch) | |
tree | 49c650f2aeed1e491db9e0ba43f52886b9073e40 /server/core.c | |
parent | SEDERR_TMAMES and SEDERR_TMRMES are used only in sed1.c with 'eval->lnum' as ... (diff) | |
download | apache2-62db0c63abc6b66343eaa73a4811f8a1605f3366.tar.xz apache2-62db0c63abc6b66343eaa73a4811f8a1605f3366.zip |
Revert 1897156.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897273 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 51 |
1 files changed, 16 insertions, 35 deletions
diff --git a/server/core.c b/server/core.c index 634d4c6b5d..67c36f8134 100644 --- a/server/core.c +++ b/server/core.c @@ -2506,7 +2506,6 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) char *old_path = cmd->path; core_dir_config *conf; ap_conf_vector_t *new_dir_conf = ap_create_per_dir_config(cmd->pool); - const char *regex; ap_regex_t *r = NULL; const command_rec *thiscmd = cmd->cmd; @@ -2530,20 +2529,15 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) if (!strcmp(cmd->path, "~")) { cmd->path = ap_getword_conf(cmd->pool, &arg); - if (!*cmd->path) { - return "<Directory ~ > block must specify a regex"; - } - regex = ap_getword_conf(cmd->pool, &arg); - r = ap_pregcomp(cmd->pool, *regex ? regex : cmd->path, - AP_REG_EXTENDED | USE_ICASE); + if (!cmd->path) + return "<Directory ~ > block must specify a path"; + r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE); if (!r) { return "Regex could not be compiled"; } } else if (thiscmd->cmd_data) { /* <DirectoryMatch> */ - regex = ap_getword_conf(cmd->pool, &arg); - r = ap_pregcomp(cmd->pool, *regex ? regex : cmd->path, - AP_REG_EXTENDED | USE_ICASE); + r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE); if (!r) { return "Regex could not be compiled"; } @@ -2605,8 +2599,8 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) ap_add_per_dir_conf(cmd->server, new_dir_conf); if (*arg != '\0') { - return apr_pstrcat(cmd->pool, "Additional ", thiscmd->name, - "> arguments not (yet) supported: ", arg, NULL); + return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name, + "> arguments not (yet) supported.", NULL); } cmd->path = old_path; @@ -2622,7 +2616,6 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg) int old_overrides = cmd->override; char *old_path = cmd->path; core_dir_config *conf; - const char *regex; ap_regex_t *r = NULL; const command_rec *thiscmd = cmd->cmd; ap_conf_vector_t *new_url_conf = ap_create_per_dir_config(cmd->pool); @@ -2645,21 +2638,14 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg) cmd->override = OR_ALL|ACCESS_CONF; if (thiscmd->cmd_data) { /* <LocationMatch> */ - regex = ap_getword_conf(cmd->pool, &arg); - r = ap_pregcomp(cmd->pool, *regex ? regex : cmd->path, - AP_REG_EXTENDED); + r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED); if (!r) { return "Regex could not be compiled"; } } else if (!strcmp(cmd->path, "~")) { cmd->path = ap_getword_conf(cmd->pool, &arg); - if (!*cmd->path) { - return "<Location ~ > block must specify a regex"; - } - regex = ap_getword_conf(cmd->pool, &arg); - r = ap_pregcomp(cmd->pool, *regex ? regex : cmd->path, - AP_REG_EXTENDED); + r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED); if (!r) { return "Regex could not be compiled"; } @@ -2685,8 +2671,8 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg) ap_add_per_url_conf(cmd->server, new_url_conf); if (*arg != '\0') { - return apr_pstrcat(cmd->pool, "Additional ", thiscmd->name, - "> arguments not (yet) supported: ", arg, NULL); + return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name, + "> arguments not (yet) supported.", NULL); } cmd->path = old_path; @@ -2702,7 +2688,6 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg) int old_overrides = cmd->override; char *old_path = cmd->path; core_dir_config *conf; - const char *regex; ap_regex_t *r = NULL; const command_rec *thiscmd = cmd->cmd; ap_conf_vector_t *new_file_conf = ap_create_per_dir_config(cmd->pool); @@ -2730,18 +2715,14 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg) } if (thiscmd->cmd_data) { /* <FilesMatch> */ - regex = ap_getword_conf(cmd->pool, &arg); - r = ap_pregcomp(cmd->pool, *regex ? regex : cmd->path, - AP_REG_EXTENDED | USE_ICASE); + r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE); if (!r) { return "Regex could not be compiled"; } } else if (!strcmp(cmd->path, "~")) { cmd->path = ap_getword_conf(cmd->pool, &arg); - regex = ap_getword_conf(cmd->pool, &arg); - r = ap_pregcomp(cmd->pool, *regex ? regex : cmd->path, - AP_REG_EXTENDED | USE_ICASE); + r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE); if (!r) { return "Regex could not be compiled"; } @@ -2777,8 +2758,8 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg) ap_add_file_conf(cmd->pool, (core_dir_config *)mconfig, new_file_conf); if (*arg != '\0') { - return apr_pstrcat(cmd->pool, "Additional ", thiscmd->name, - "> arguments not (yet) supported: ", arg, NULL); + return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name, + "> arguments not (yet) supported.", NULL); } cmd->path = old_path; @@ -2864,8 +2845,8 @@ static const char *ifsection(cmd_parms *cmd, void *mconfig, const char *arg) return errmsg; if (*arg != '\0') { - return apr_pstrcat(cmd->pool, "Additional ", thiscmd->name, - "> arguments not supported: ", arg, NULL); + return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name, + "> arguments not supported.", NULL); } cmd->path = old_path; |