regmatch(): do nextchr=*locinput at top of loop
authorDavid Mitchell <davem@iabyn.com>
Fri, 14 Sep 2012 15:19:10 +0000 (16:19 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 26 Sep 2012 08:41:10 +0000 (09:41 +0100)
commit3640db6ba49a54c99246b5b4b2b9a2840cfdaef3
tree9aa1acc37b141b2d605a115e5cf036fd7d524cc3
parentbf798dc4f68faa2dc325a5c35f641f6a172a48bd
regmatch(): do nextchr=*locinput at top of loop

Currently each branch in the main regmatch() loop is responsible
re-initialising nextchar to UCHARAT(locinput) if locinput is modified.

By adding
    nextchr = UCHARAT(locinput);
to the head of the loop, we can remove most of the nextchar assignments
in the individual branches. We lose slightly for the zero-width assertions
like \b which will re-read the same nextchar, but this will make it
easier to handle non-null-terminated strings.
regexec.c