[Libguestfs] [PATCH v3 02/22] common/mlpcre: Add PCRE.subi to return indexes instead of the substring.

Pino Toscano ptoscano at redhat.com
Wed Sep 27 12:37:24 UTC 2017


On Friday, 22 September 2017 09:36:03 CEST Richard W.M. Jones wrote:
> diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c
> index da9b50d34..15775dad0 100644
> --- a/common/mlpcre/pcre-c.c
> +++ b/common/mlpcre/pcre-c.c
> @@ -225,3 +225,30 @@ guestfs_int_pcre_sub (value nv)
>    memcpy (String_val (strv), str, len);
>    CAMLreturn (strv);
>  }
> +
> +value
> +guestfs_int_pcre_subi (value nv)
> +{
> +  CAMLparam1 (nv);
> +  int n = Int_val (nv);
> +  CAMLlocal1 (rv);
> +  struct last_match *m = gl_tls_get (last_match);

Both 'n' and 'm' can be const.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170927/1763a2ff/attachment.sig>


More information about the Libguestfs mailing list