From: Jeff Trawick Date: Tue, 15 Sep 2009 12:59:12 +0000 (+0000) Subject: respect const-ness of string argument to ap_expr_string() X-Git-Tag: 2.3.3~296 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f152c42726dca018e5ef75c7eeeab10f68b8f431;p=thirdparty%2Fapache%2Fhttpd.git respect const-ness of string argument to ap_expr_string() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815304 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util_expr.c b/server/util_expr.c index 65865b0c6e5..3acc8a31822 100644 --- a/server/util_expr.c +++ b/server/util_expr.c @@ -901,7 +901,7 @@ AP_DECLARE_NONSTD(const char*) ap_expr_string(request_rec *r, /* a default string evaluator: support headers and env */ const char *ret = str; ap_regmatch_t match[3]; - char *p; + const char *p; ap_assert(isvar != NULL); if (ap_regexec(isvar, str, 3, match, 0) == 0) { @@ -934,13 +934,13 @@ AP_DECLARE_NONSTD(const char*) ap_expr_string(request_rec *r, /* copy wholesale from mod_rewrite to support its %{varname} vars */ else if ((str[0] == '%') && (str[1] == '{') - && (p = ap_strchr(str, '}'), p != NULL)) { - char *var; + && (p = ap_strchr_c(str, '}'), p != NULL)) { + char *ch, *var; apr_time_exp_t tm; var = apr_pstrndup(r->pool, str+2, p-str-3); - for (p = var; *p; ++p) { - *p = apr_toupper(*p); + for (ch = var; *ch; ++ch) { + *ch = apr_toupper(*ch); } switch (strlen(var)) {