bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A little more regex.h pedantry


From: Eric Blake
Subject: Re: A little more regex.h pedantry
Date: Fri, 30 Jul 2010 16:52:26 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1

On 07/30/2010 04:45 PM, Reuben Thomas wrote:
> On 30 July 2010 23:33, Eric Blake <address@hidden> wrote:
>>>  and `no_sub' can't be set (because re_compile
>>> always overwrites it, as it does newline_anchor).
>>
>> Did you compile a pattern with grouping ()?  I'm not sure, but the
>> behavior on no_sub may be conditional on whether there are any
>> sub-fields to return in the first place.
> 
> The code in re_compile_pattern says:
> 
>   /* And GNU code determines whether or not to get register information
>      by passing null for the REGS argument to re_match, etc., not by
>      setting no_sub, unless RE_NO_SUB is set.  */
>   bufp->no_sub = !!(re_syntax_options & RE_NO_SUB);
> 
> It doesn't seem to be conditional on grouping.

Aha.  The answer, then, is that you used to be able to supply no_sub
prior to compilation; but nowadays you have the flag RE_NO_SUB to do the
job instead.  So I agree with documenting that no_sub is private (by not
listing it as public).

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]