From: André Malo Date: Sun, 3 Aug 2003 18:38:14 +0000 (+0000) Subject: incorporate the add_env_variable function in do_expand_env. X-Git-Tag: pre_ajp_proxy~1305 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a281ae21183bca112da1b68770bd76b7f0026288;p=apache incorporate the add_env_variable function in do_expand_env. I see no real reason to use an extra function call here (other than decreasing performance :) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100891 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 8abdcac93c..e25a711205 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -2111,23 +2111,20 @@ static char *do_expand(request_rec *r, char *input, /* * perform all the expansions on the environment variables */ -static void add_env_variable(request_rec *r, char *s) -{ - char *val; - - if ((val = ap_strchr(s, ':')) != NULL) { - *val++ = '\0'; - - apr_table_set(r->subprocess_env, s, val); - rewritelog(r, 5, "setting env variable '%s' to '%s'", s, val); - } -} - static void do_expand_env(request_rec *r, data_item *env, backrefinfo *briRR, backrefinfo *briRC) { + char *name, *val; + while (env) { - add_env_variable(r, do_expand(r, env->data, briRR, briRC)); + name = do_expand(r, env->data, briRR, briRC); + if ((val = ap_strchr(name, ':')) != NULL) { + *val++ = '\0'; + + apr_table_set(r->subprocess_env, name, val); + rewritelog(r, 5, "setting env variable '%s' to '%s'", name, val); + } + env = env->next; }