I tried to keep the changes minimal to make it easy to synchronize with
upstream changes and to not introduce new bugs. However there were some
changes that needed to be made because of differences between OpenBSD and
Linux and these are:

Ignore REG_STARTEND for compatibility with Musl. At the time of writing it
doesn't support the REG_STARTEND flag for regexec() (non-POSIX).
NOTE: there are differences in glibc's REG_STARTEND implementation compared to
OpenBSD aswell. So expect it to behave a bit differently.