Re: [PATCH v5 4/8] regex.3: Improve REG_STARTEND

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

 



On Thu, Apr 20, 2023 at 09:30:06PM +0200, наб wrote:
> If REG_STARTEND, pmatch must point to a valid readable object.
> (Naturally, if you pass in uninitialised memory or a null pointer,
>  then you get UB.)
> nmatch is not consulted and has no bearing on this.
This is all to say:
  regexec(&reg, "str", 0, &rm, REG_STARTEND);
is valid, looks in ["str"+rm.so, "str"+rm.eo),
and doesn't change rm, whereas
  regexec(&reg, "str", 1, &rm, REG_STARTEND);
is valid, looks in ["str"+rm.so, "str"+rm.eo),
and will update rm with the match, if any.

Attachment: signature.asc
Description: PGP signature


[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