Re: Please document REG_STARTEND in man 3 regex.

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

 



[CC widened]

Hello Rob,

[Your mailer is breaking patches (wrapping long lines.)]

On 9/9/19 8:47 PM, Rob Landley wrote:
> Stab at it:
> 
> diff --git a/man3/regex.3 b/man3/regex.3
> index 0523bb124..b65799823 100644
> --- a/man3/regex.3
> +++ b/man3/regex.3
> @@ -157,6 +157,17 @@ The match-end-of-line operator always fails to match (but
> see the
>  compilation flag
>  .B REG_NEWLINE
>  above).
> +.SS BSD regex matching
> +.TP
> +.B REG_STARTEND
> +Use pmatch[0] on the input string, starting at byte pmatch[0].rm_so and ending
> +before byte pmatch[0].rm_eo. This allows matching embedded NUL bytes
> +and avoids a strlen() on large strings. It does not use nmatch on input,
> +and does not change
> +.B REG_NOTBOL
> +or
> +.B REG_NEWLINE
> +processing.
>  .SS Byte offsets
>  Unless
>  .B REG_NOSUB

Patch applied.

Thanks,

Michael


> On 9/9/19 1:23 PM, Rob Landley wrote:
>> Patch against what file? (The html? The /usr/share/man/man3/regex.3.gz in my
>> devuan ascii laptop? Is there a git repo somewhere?)
>>
>> It doesn't obviously say where your repo is in:
>>
>> https://www.kernel.org/doc/man-pages/contributing.html
>> https://www.kernel.org/doc/man-pages/patches.html
>> https://www.kernel.org/doc/man-pages/reporting_bugs.html
>>
>> Although that last one links to a directory of tarballs...
>>
>> Ah, I see. The downloading page has the git repo. Right...
>>
>> Rob
>>
>> On 9/9/19 12:43 AM, Michael Kerrisk (man-pages) wrote:
>>> Hello Rob,
>>>
>>> No reason to exclude it. But also no-one wrote a patch!
>>>
>>> Also, please CC the list on all man-pages related stuff
>>> (linux-man@xxxxxxxxxxxxxxx). Perhaps (okay, yes, chances are small)
>>> someone even sees your message and writes a patch...
>>>
>>> Thanks,
>>>
>>> Michael
>>>
>>> On Sun, 8 Sep 2019 at 00:09, Rob Landley <rob@xxxxxxxxxxx> wrote:
>>>>
>>>> Hi, this still isn't documented. Is there a reason to exclude it?
>>>>
>>>> Rob
>>>>
>>>> On 5/6/19 7:14 PM, Rob Landley wrote:
>>>>> The bionic maintainer suggested I use a regex extension in toybox that I was
>>>>> unaware of because it's not in the debian man page:
>>>>>
>>>>>   http://lists.landley.net/pipermail/toybox-landley.net/2019-May/010432.html
>>>>>
>>>>> But glibc added support for it in 2004:
>>>>>
>>>>>   http://lists.landley.net/pipermail/toybox-landley.net/2019-May/010433.html
>>>>>
>>>>> And uClibc picked it up in 2005, and it came from FreeBSD in the first place so
>>>>> presumably MacOS X has it...
>>>>>
>>>>> The obvious use for it is matching NUL bytes, but on glibc and bionic it also
>>>>> avoids calling strlen() on the target string before trying to match (without
>>>>> which a megabyte long xxxxx line takes forever for "sed s/x/y/g" to finish),
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Rob
>>>>>
>>>
>>>
>>>
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux