On Aug 28, 2011, at 1:52 PM, [email protected] wrote:
> +    *indexes = apr_array_make(r->pool, ranges, sizeof(indexes_t));
> +    merged = apr_array_make(r->pool, ranges, sizeof(char *));
>     while ((cur = ap_getword(r->pool, &range, ','))) {
>         char *dash;
>         char *errp;
> @@ -560,7 +571,7 @@ static int ap_set_byterange(request_rec 
>             new = (char **)apr_array_push(merged);
>             *new = apr_psprintf(r->pool, "%" APR_OFF_T_FMT "-%" APR_OFF_T_FMT,
>                                     ostart, oend);
> -            idx = (indexes_t *)apr_array_push(indexes);
> +            idx = (indexes_t *)apr_array_push(*indexes);
>             idx->start = ostart;
>             idx->end = oend;
>             sum_lengths += oend - ostart + 1;

If we wanted to get really fancy, we could just prealloc the
indexes array, and then then, at the end, create merged from
that…

Maybe an enhancement for trunk, but let's get 2.2 out first I guess !

Reply via email to