httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe JAILLET <christophe.jail...@wanadoo.fr>
Subject Question about mod_sed
Date Thu, 16 Jun 2016 20:33:16 GMT
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);
     /* hspend will now point to NULL character */
     eval->gspend += len;
}

?




Mime
View raw message