Ok, here is a rough patch that fixes the \b failures. I have not
tested it extensively but it does pass the regexp test. However, I
notice the tests never try the \B case so I want to test that more.
The patch is against 21.5-b11 but the same problem exists in 21.4.
Cheers,
Sean
Index: regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.42
diff -u -r1.42 regex.c
--- regex.c 2003/03/09 12:59:44 1.42
+++ regex.c 2003/03/21 16:29:17
@@ -6071,8 +6071,13 @@
{
/* XEmacs change */
int result;
- if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
- result = 1;
+ // SAM
+ if (AT_STRINGS_BEG (d))
+ {
+ re_char *d_after = POS_AFTER_GAP_UNSAFE (d);
+ Ichar emch2 = itext_ichar_fmt (d_after, fmt, lispobj);
+ result = WORDCHAR_P(emch2);
+ }
else
{
re_char *d_before = POS_BEFORE_GAP_UNSAFE (d);
@@ -6114,8 +6119,10 @@
case notwordbound:
DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
- should_succeed = 0;
- goto matchwordbound;
+ if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
+ goto fail;
+ should_succeed = 0;
+ goto matchwordbound;
case wordbeg:
DEBUG_PRINT1 ("EXECUTING wordbeg.\n");