* (Note: If out==NULL, this function allocs a buffer for the resulting
* string from r->pool. The return value is the parsed string)
*/
-static char *ap_ssi_parse_string(request_rec *r, include_ctx_t *ctx,
- const char *in, char *out,
+static char *ap_ssi_parse_string(include_ctx_t *ctx, const char *in, char *out,
apr_size_t length, int leave_name)
{
char ch;
char *next;
char *end_out;
apr_size_t out_size;
+ request_rec *r = ctx->intern->r;
/* allocate an output buffer if needed */
if (!out) {
sizeof (" Evaluate string\n"));
debug_pos += sizeof (" Evaluate string\n");
#endif
- buffer = ap_ssi_parse_string(r, ctx, current->token.value, NULL,
+ buffer = ap_ssi_parse_string(ctx, current->token.value, NULL,
MAX_STRING_LEN, 0);
current->token.value = buffer;
current->value = (current->token.value[0] != '\0');
if (!current->left->done) {
switch (current->left->token.type) {
case token_string:
- buffer = ap_ssi_parse_string(r, ctx, current->left->token.value,
+ buffer = ap_ssi_parse_string(ctx, current->left->token.value,
NULL, MAX_STRING_LEN, 0);
current->left->token.value = buffer;
current->left->value =
if (!current->right->done) {
switch (current->right->token.type) {
case token_string:
- buffer = ap_ssi_parse_string(r, ctx, current->right->token.value,
+ buffer = ap_ssi_parse_string(ctx, current->right->token.value,
NULL, MAX_STRING_LEN, 0);
current->right->token.value = buffer;
current->right->value =
*was_error = 1;
return retval;
}
- buffer = ap_ssi_parse_string(r, ctx, current->left->token.value,
+ buffer = ap_ssi_parse_string(ctx, current->left->token.value,
NULL, MAX_STRING_LEN, 0);
current->left->token.value = buffer;
- buffer = ap_ssi_parse_string(r, ctx, current->right->token.value,
+ buffer = ap_ssi_parse_string(ctx, current->right->token.value,
NULL, MAX_STRING_LEN, 0);
current->right->token.value = buffer;
if (current->right->token.type == token_re) {
*was_error = 1;
return retval;
}
- buffer = ap_ssi_parse_string(r, ctx, current->left->token.value,
- NULL, MAX_STRING_LEN, 0);
+ buffer = ap_ssi_parse_string(ctx, current->left->token.value, NULL,
+ MAX_STRING_LEN, 0);
current->left->token.value = buffer;
- buffer = ap_ssi_parse_string(r, ctx, current->right->token.value,
- NULL, MAX_STRING_LEN, 0);
+ buffer = ap_ssi_parse_string(ctx, current->right->token.value, NULL,
+ MAX_STRING_LEN, 0);
current->right->token.value = buffer;
#ifdef DEBUG_INCLUDE
debug_pos += sprintf (&debug[debug_pos],
break;
}
- parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL,
- MAX_STRING_LEN,
+ parsed_string = ap_ssi_parse_string(ctx, tag_val, NULL, MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME);
if (tag[0] == 'f') {
/* XXX: Port to apr_filepath_merge
apr_size_t e_len;
val = get_include_var(r, ctx,
- ap_ssi_parse_string(r, ctx, tag_val, NULL,
+ ap_ssi_parse_string(ctx, tag_val, NULL,
MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME));
if (val) {
ctx->error_str = ctx->intern->error_str_override;
}
- ap_ssi_parse_string(r, ctx, tag_val,ctx->intern->error_str_override,
+ ap_ssi_parse_string(ctx, tag_val, ctx->intern->error_str_override,
MAX_STRING_LEN, SSI_EXPAND_DROP_NAME);
}
else if (!strcmp(tag, "timefmt")) {
MAX_STRING_LEN);
ctx->time_str = ctx->intern->time_str_override;
}
- ap_ssi_parse_string(r, ctx, tag_val, ctx->intern->time_str_override,
+ ap_ssi_parse_string(ctx, tag_val, ctx->intern->time_str_override,
MAX_STRING_LEN, SSI_EXPAND_DROP_NAME);
apr_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date,
ctx->time_str, 0));
}
else if (!strcmp(tag, "sizefmt")) {
- parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL,
+ parsed_string = ap_ssi_parse_string(ctx, tag_val, NULL,
MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME);
if (!strcmp(parsed_string, "bytes")) {
break;
}
- parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL,
- MAX_STRING_LEN,
+ parsed_string = ap_ssi_parse_string(ctx, tag_val, NULL, MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME);
if (!find_file(r, "fsize", tag, parsed_string, &finfo)) {
break;
}
- parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL,
- MAX_STRING_LEN,
+ parsed_string = ap_ssi_parse_string(ctx, tag_val, NULL, MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME);
if (!find_file(r, "flastmod", tag, parsed_string, &finfo)) {
}
if (!strcmp(tag, "var")) {
- var = ap_ssi_parse_string(r, ctx, tag_val, NULL, MAX_STRING_LEN,
+ var = ap_ssi_parse_string(ctx, tag_val, NULL, MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME);
}
else if (!strcmp(tag, "value")) {
break;
}
- parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL,
+ parsed_string = ap_ssi_parse_string(ctx, tag_val, NULL,
MAX_STRING_LEN,
SSI_EXPAND_DROP_NAME);
apr_table_setn(r->subprocess_env, apr_pstrdup(p, var),