]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r300683:
authorpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 24 Jun 2016 02:24:34 +0000 (02:24 +0000)
committerpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 24 Jun 2016 02:24:34 +0000 (02:24 +0000)
commit93de85258f271bb050e9268aaf11c41d648f9c39
tree39088ff1700d95a9713154b77b4299f1cd2feafa
parent448aea86cd1f64d67ff77b670e531787e9a10aec
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/10@302168 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/regex/engine.c
lib/libc/regex/regex.3