You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/09/15 14:59:12 UTC
svn commit: r815304 - /httpd/httpd/trunk/server/util_expr.c
Author: trawick
Date: Tue Sep 15 12:59:12 2009
New Revision: 815304
URL: http://svn.apache.org/viewvc?rev=815304&view=rev
Log:
respect const-ness of string argument to ap_expr_string()
Modified:
httpd/httpd/trunk/server/util_expr.c
Modified: httpd/httpd/trunk/server/util_expr.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr.c?rev=815304&r1=815303&r2=815304&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr.c (original)
+++ httpd/httpd/trunk/server/util_expr.c Tue Sep 15 12:59:12 2009
@@ -901,7 +901,7 @@
/* 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 @@
/* 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)) {