MCPcopy Create free account
hub / github.com/apache/httpd / do_expand_env

Function do_expand_env

modules/mappers/mod_rewrite.c:2694–2721  ·  view source on GitHub ↗

* perform all the expansions on the environment variables */

Source from the content-addressed store, hash-verified

2692 * perform all the expansions on the environment variables
2693 */
2694static void do_expand_env(data_item *env, rewrite_ctx *ctx)
2695{
2696 char *name, *val;
2697
2698 while (env) {
2699 name = do_expand(env->data, ctx, NULL, NULL);
2700 if (*name == '!') {
2701 name++;
2702 apr_table_unset(ctx->r->subprocess_env, name);
2703 rewritelog(ctx->r, 5, NULL, "unsetting env variable '%s'", name);
2704 }
2705 else {
2706 if ((val = ap_strchr(name, ':')) != NULL) {
2707 *val++ = '\0';
2708 } else {
2709 val = "";
2710 }
2711
2712 apr_table_set(ctx->r->subprocess_env, name, val);
2713 rewritelog(ctx->r, 5, NULL, "setting env variable '%s' to '%s'",
2714 name, val);
2715 }
2716
2717 env = env->next;
2718 }
2719
2720 return;
2721}
2722
2723/*
2724 * perform all the expansions on the cookies

Callers 1

apply_rewrite_ruleFunction · 0.85

Calls 2

do_expandFunction · 0.85
ap_strchrFunction · 0.85

Tested by

no test coverage detected