[PATCH] Fix \'. regex
Bonzini
bonzini@gnu.org
Wed Jun 4 09:24:00 GMT 2003
The attached patch fixes the problem with \' not being considered unless it is the last
atom in the regexp. As I had hinted a few months ago, the problem is that the
transition table for the token immediately following \' does not take into
consideration the constraint of being at the end of the buffer: and indeed it turns out
that group_nodes_into_DFAstates does not have a test for NEXT_ENDBUF_CONSTRAINT.
The patch shuffles a bit the constraint-enforcing ifs, so that constraints that have a
`continue' in them are put first. Otherwise, the `continue' has no effect because the
loop is already ending right after it.
I also ping you to apply Isamu's patches at
http://sources.redhat.com/ml/libc-alpha/2003-02/msg00243.html
Tested against GNU sed's testsuite.
2003-06-04 Paolo Bonzini <bonzini@gnu.org>
* posix/regexec.c (group_nodes_into_DFAstates): check for
NEXT_ENDBUF_CONSTRAINT. Move check for constraints which
do a `continue' before the others.
|_ _ _ __
|_)(_)| ),'
------- '---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regex-fix-endbuf.patch
Type: application/octet-stream
Size: 1472 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030604/9fba0fa3/attachment.obj>
More information about the Libc-alpha
mailing list