httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: Question about mod_sed
Date Fri, 17 Jun 2016 12:40:43 GMT
Am 17.06.2016 um 12:00 schrieb Ruediger Pluem:
>
>
> 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?

I think Christophe added the memcpy and the below lines as a suggestion 
("Should it look like").

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

Regards,

Rainer


Mime
View raw message