httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: Question about mod_sed
Date Fri, 17 Jun 2016 10:00:41 GMT


On 06/16/2016 10:33 PM, Christophe JAILLET wrote:
> Hi,
> 
> 
> I'm not familiar with sed implementation, but 'copy_to_genbuf' looks spurious.
> 
> Actually it only expands a buffer if some space is needed, but nothing is copied.
> 
> 
> Should it look like:
> 
> static void copy_to_genbuf(sed_eval_t *eval, const char* sz)
> {
>     int len = strlen(sz);
>     unsigned int reqsize = len + 1;
>     if (eval->gsize < reqsize) {
>         grow_gen_buffer(eval, reqsize, NULL);
>     }
>     memcpy(eval->gspend, sz, len + 1);

The above does a copy, or do I miss your point?

>     /* hspend will now point to NULL character */
>     eval->gspend += len;
> }

Regards

RĂ¼diger

Mime
View raw message