This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Rework join_exact()
authorKarl Williamson <public@khwilliamson.com>
Sat, 24 Dec 2011 02:46:10 +0000 (19:46 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 19 Jan 2012 18:58:19 +0000 (11:58 -0700)
commit86d6fcadb912bd04e5bb511a8188871eb12e4274
tree51f71c9c5a88ef9f3ab17af6bdd4500ccb5a1b95
parentca600955b124a74a55428f5d252241f4119646d4
regcomp.c: Rework join_exact()

This re formats and refactors portions of join_exact() that look for the
tricky Greek fold sequences.  I renamed various variables, etc, to help
me understand what was going on.  It turns out that there were two
off-by-one bugs that prevented this from working properly.

The first bug had the loop quit one too soon  The boundary should be
"<=", and not strictly less-than.  This means that if the sequence is
the last thing in the string (or only thing) it will not be found.
The other bug had the end-needle parameter be 1 too short, which means
that this would succeed with  only the first 3 bytes of the sequence
(now called 'tail'), thus matching many more things than it should
(provided it got the chance to match at all given the first bug).
regcomp.c