Hi,
On Thu, Feb 5, 2015 at 9:33 PM, <[email protected]> wrote:
> Author: rjung
> Date: Thu Feb 5 20:33:59 2015
> New Revision: 1657685
>
> URL: http://svn.apache.org/r1657685
[...]
>
> Modified:
> httpd/httpd/trunk/server/util_expr_eval.c
>
> Modified: httpd/httpd/trunk/server/util_expr_eval.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_eval.c?rev=1657685&r1=1657684&r2=1657685&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/util_expr_eval.c (original)
> +++ httpd/httpd/trunk/server/util_expr_eval.c Thu Feb 5 20:33:59 2015
[...]
> @@ -113,6 +114,30 @@ static const char *ap_expr_eval_word(ap_
> else
> result = apr_pstrcat(ctx->p, s1, s2, NULL);
> }
> + else if (((ap_expr_t *)node->node_arg1)->node_op == op_Concat) {
> + const ap_expr_t *nodep = node;
> + int n;
> + int i = 1;
> + struct iovec *vec;
> + do {
> + nodep = nodep->node_arg1;
> + i++;
> + } while (nodep->node_op == op_Concat);
> + vec = apr_palloc(ctx->p, i * sizeof(struct iovec));
> + n = i;
> + nodep = node;
> + i--;
> + do {
> + vec[i].iov_base = (void *)ap_expr_eval_word(ctx,
> +
> nodep->node_arg2);
> + vec[i].iov_len = strlen(vec[i].iov_base);
> + i--;
> + nodep = nodep->node_arg1;
> + } while (nodep->node_op == op_Concat);
> + vec[i].iov_base = (void *)ap_expr_eval_word(ctx, nodep);
> + vec[i].iov_len = strlen(vec[i].iov_base);
> + result = apr_pstrcatv(ctx->p, vec, n, NULL);
> + }
> else {
Why concatenating in reverse order here?
Actually, I cannot manage to test this because I'm not able to find an
expression that produces node_arg1->node_op == op_Concat.
Due to the %right association of T_OP_CONCAT in the parser/yacc, "'x'
. 'y' . 'z'" gives "concat( 'x', concat ('y, 'z'))", which is
node_arg1->node_op == op_String and node_arg2->node_op == op_Concat...
Can you please share an expression for the new branch to be taken?
Regards,
Yann.