From a9e5a7bd800d5c599bf44c00687a8c16b0cea0b9 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Tue, 2 Jun 2015 05:40:57 +0000 Subject: [PATCH] Small speed optimization when parsing , and environment variables git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1683044 13f79535-47bb-0310-9956-ffa450edef68 --- server/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/core.c b/server/core.c index 7138444070..4d1a4aa072 100644 --- a/server/core.c +++ b/server/core.c @@ -1263,8 +1263,8 @@ AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word) } if (*s == '$') { - if (s[1] == '{' && (e = ap_strchr_c(s, '}'))) { - char *name = apr_pstrndup(p, s+2, e-s-2); + if (s[1] == '{' && (e = ap_strchr_c(s+2, '}'))) { + char *name = apr_pstrmemdup(p, s+2, e-s-2); word = NULL; if (server_config_defined_vars) word = apr_table_get(server_config_defined_vars, name); @@ -2147,7 +2147,7 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, return unclosed_directive(cmd); } - limited_methods = apr_pstrndup(cmd->temp_pool, arg, endp - arg); + limited_methods = apr_pstrmemdup(cmd->temp_pool, arg, endp - arg); if (!limited_methods[0]) { return missing_container_arg(cmd); @@ -2164,7 +2164,7 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, return "TRACE cannot be controlled by , see TraceEnable"; } else if (methnum == M_INVALID) { - /* method has not been registered yet, but resorce restriction + /* method has not been registered yet, but resource restriction * is always checked before method handling, so register it. */ methnum = ap_method_register(cmd->pool, -- 2.40.0