static const char *header_request_env_var(request_rec *r, char *a)
{
const char *s = apr_table_get(r->subprocess_env,a);
-
+
if (s)
return s;
else
s = *sa;
while (*s && *s != '%') {
- s++;
+ s++;
}
/*
* This might allocate a few chars extra if there's a backslash
d = tag->arg;
s = *sa;
while (*s && *s != '%') {
- if (*s != '\\') {
- *d++ = *s++;
- }
- else {
- s++;
- switch (*s) {
- case '\\':
- *d++ = '\\';
- s++;
- break;
- case 'r':
- *d++ = '\r';
- s++;
- break;
- case 'n':
- *d++ = '\n';
- s++;
- break;
- case 't':
- *d++ = '\t';
- s++;
- break;
- default:
- /* copy verbatim */
- *d++ = '\\';
- /*
- * Allow the loop to deal with this *s in the normal
- * fashion so that it handles end of string etc.
- * properly.
- */
- break;
- }
- }
+ if (*s != '\\') {
+ *d++ = *s++;
+ }
+ else {
+ s++;
+ switch (*s) {
+ case '\\':
+ *d++ = '\\';
+ s++;
+ break;
+ case 'r':
+ *d++ = '\r';
+ s++;
+ break;
+ case 'n':
+ *d++ = '\n';
+ s++;
+ break;
+ case 't':
+ *d++ = '\t';
+ s++;
+ break;
+ default:
+ /* copy verbatim */
+ *d++ = '\\';
+ /*
+ * Allow the loop to deal with this *s in the normal
+ * fashion so that it handles end of string etc.
+ * properly.
+ */
+ break;
+ }
+ }
}
*d = '\0';
{
const char *s = *sa;
const char * (*tag_handler)(request_rec *,char *);
-
+
/* Handle string literal/conditionals */
if (*s != '%') {
return parse_misc_string(p, tag, sa);
if (inout != hdr_out) {
return "error: envclause (env=...) only valid on Header directive";
}
- if (strncasecmp(envclause, "env=", 4) != 0) {
- return "error: envclause should be in the form env=envar";
- }
- if ((envclause[4] == '\0')
- || ((envclause[4] == '!') && (envclause[5] == '\0'))) {
- return "error: missing environment variable name. envclause should be in the form env=envar ";
- }
- condition_var = apr_pstrdup(cmd->pool, &envclause[4]);
+ if (strncasecmp(envclause, "env=", 4) != 0) {
+ return "error: envclause should be in the form env=envar";
+ }
+ if ((envclause[4] == '\0')
+ || ((envclause[4] == '!') && (envclause[5] == '\0'))) {
+ return "error: missing environment variable name. envclause should be in the form env=envar ";
+ }
+ condition_var = apr_pstrdup(cmd->pool, &envclause[4]);
}
if ((colon = strchr(hdr, ':')))
&headers_module);
if (serverconf->fixup_out->nelts || dirconf->fixup_out->nelts) {
- ap_add_output_filter("FIXUP_HEADERS_OUT", NULL, r, r->connection);
+ ap_add_output_filter("FIXUP_HEADERS_OUT", NULL, r, r->connection);
}
}
&headers_module);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, f->r->server,
- "headers: ap_headers_output_filter()");
+ "headers: ap_headers_output_filter()");
/* do the fixup */
do_headers_fixup(f->r, hdr_out, serverconf->fixup_out);