]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r300683:
authorpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 24 Jun 2016 02:28:24 +0000 (02:28 +0000)
committerpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 24 Jun 2016 02:28:24 +0000 (02:28 +0000)
commit0b18b9013a12ae7b8489c1641efe4be62fd26221
tree8cad0f1d5587c4060871200b562ae0563748d73d
parent97d140741950be515663238ae9b27fde18cde1ef
MFC r300683:
libc: regexec(3) adjustment.

Change the behavior of when REG_STARTEND is combined with REG_NOTBOL.

From the original posting[1]:

"Enable the assumption that pmatch[0].rm_so is a continuation offset
to  a string and allows us to do a proper assessment of the character
in  regards to it's word position ('^' or '\<'), without risking going
into unallocated memory."

This change makes us similar to how glibc handles REG_STARTEND |
REG_NOTBOL, and is closely related to a soon-to-land fix to sed.

Special thanks to Martijn van Duren and Ingo Schwarze for working
out some consistent behaviour.

Differential Revision: https://reviews.freebsd.org/D6257
Taken from: openbsd-tech 2016-05-24 [1]  (Martijn van Duren)

git-svn-id: svn://svn.freebsd.org/base/stable/9@302169 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/regex/engine.c
lib/libc/regex/regex.3